radiance 1.4.0

- Qwen3.8-Flash-Next on one card: the heat engine moves 64 experts a step (was 8), its copies and
  the prefill's expert staging run on the card's DMA engines instead of as copy kernels, and at
  decode the next layer's likeliest experts are copied onto the card ahead of its GEMMs. Against
  1.3.0 at --tp 1: prefill +17-20% from 8K tokens up, throughput under load +16-20%
- deploy/compose/flashnext-tp1.yaml: Qwen3.8-Flash-Next on one card and 64 GB of host RAM
  (4096-token prefill steps, 4 sequences, a 301K-token cache)
- #61: --busy-prefill-chunk (default auto): a long prefill leaves the rest of the step to the
  requests decoding beside it and to new arrivals, instead of taking all of it (baKon)
- LiquidAI's LFM2 and LFM2-VL, and d1's /v1/systemone (after zivius's PR #50)
- a startup report: every option with its value and where it came from, the hardware, and what
  on it costs speed with the fix; /diagnostics serves it (behind the API key; without one, only
  to the same machine)
- #69: a GPU memory fault names the buffer and kernel argument behind it and ends the server at
  once (exit status 70), instead of hanging or writing a core of tens of gigabytes
- #64: a card without Resizable BAR is refused at startup, naming what to turn on, instead of
  crashing at the first launch
- the image is built with ROCm 10.1 (the host's amdgpu driver must support it), with ROCm's
  libLLVM rebuilt so the same source compiles to the same kernels every time; a source build
  takes ROCm 10.1 or 7.2
- #71: the image ships curl, jq and a CA bundle, so --model <HF repo id> works in the container,
  and hfget.sh runs under its busybox (baKon)
- --profile-ops shows how long each op's lane sat idle before it; cardclock.py skips an
  integrated GPU instead of stopping
This commit is contained in:
Deadcode committed 2026-10-12 11:46:14 +02:00
1 parent d5b65cddc6
commit dc339b4cd2
153 files changed
+12956 -1067

No files matched your search

+33 -1
View File
@@ -5,7 +5,7 @@
// instance's buffers has to take the step identically or the two ranks stop agreeing.
//
// THE COUNTER ALLOCATION IS 2 * nbw WORDS, zeroed once, where nbw is the block capacity the flag
// array was sized for:
// array was sized for, and the landed counter after them (r4d_ar_link_landed):
//
// [0, nbw) HANDSHAKE counters, one a block. Block b advances word b once per launch it
// runs in, publishes the new value to the peer and waits for the peer's. Kept per
@@ -19,6 +19,9 @@
// of them always equal the number of launches, and each block reads the slot
// parity off its own word without talking to any other block.
//
// [2*nbw] the LANDED counter: the blocks of the running launch that have seen their
// peer's push land, back at zero when the launch ends.
//
// WHY THE SLOT CANNOT COME OFF THE HANDSHAKE COUNTER. The double-buffered scratch is safe only if
// consecutive launches on one instance use opposite slots: launch k+1 may push while the peer is
// still reducing launch k, and it must not land in the bytes being read. Block counts differ from
@@ -56,6 +59,35 @@ __device__ __forceinline__ void r4d_ar_seq_take(unsigned int* __restrict__ ctrs,
__builtin_amdgcn_fence(__ATOMIC_ACQUIRE, "workgroup", "local");
}
// THE ENGINE'S HOLD ON THE LINK, ENDED BY THE LAUNCH (rad_abi.h, rad_kernel_collective answering
// 2). The word is odd exactly while the engine holds the link for this launch, and nothing else
// writes it while the launch runs, so its value is read once, at the start, by each block's first
// thread (r4d_ar_link_word): the read crosses to host memory, and at the start it overlaps the push
// where at the end it would hold up the reduce.
//
// r4d_ar_link_landed is called by every block once its handshake has seen the peer's push to it
// land. The last block to get there knows every byte the peer sends this card has arrived, so the
// link is free for the rest of the kernel's run -- the reduce and whatever it writes -- and takes
// one off the word if it was odd, with an atomic so it commutes with any barrier counting the same
// word down. `ctr` counts the blocks and is back at zero when the launch ends, ready for the next
// one on the stream. The word is in memory the DMA engine polls past every cache, so it is read and
// written at system scope.
__device__ __forceinline__ long long r4d_ar_link_word(const long long* gate, unsigned int tid) {
return gate && tid == 0 ? __hip_atomic_load(gate, __ATOMIC_RELAXED, __HIP_MEMORY_SCOPE_SYSTEM)
: 0;
}
__device__ __forceinline__ void r4d_ar_link_landed(long long* gate, long long word,
unsigned int* ctr, unsigned int nb,
unsigned int tid) {
if (!gate || tid != 0) return;
const unsigned int prev = __hip_atomic_fetch_add(ctr, 1u, __ATOMIC_RELAXED,
__HIP_MEMORY_SCOPE_AGENT);
if (prev + 1u != nb) return;
__hip_atomic_store(ctr, 0u, __ATOMIC_RELAXED, __HIP_MEMORY_SCOPE_AGENT);
if (word & 1) __hip_atomic_fetch_add(gate, -1LL, __ATOMIC_RELAXED, __HIP_MEMORY_SCOPE_SYSTEM);
}
// True while `flag` has not yet reached `want`. The counters are u32 and wrap, so the comparison is
// on the signed difference: a peer at or past `want` -- it may already be a launch ahead -- reads
// as arrived on either side of the wrap, where a plain `flag < want` stops waiting altogether once