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

+34 -4
View File
@@ -176,6 +176,18 @@ struct SlabClass {
#define RAD_PLACE_FILE_WINDOWS 4
#define RAD_PLACE_FILE_WINDOW_BYTES ((int64_t)32 << 20)
/* THE HEAT ENGINE'S MOVE BUDGET: swaps a STEP, a slab class. HeatParams::moves_per_step defaults
* to it, and the free slots below are sized from it, because the two are one quantity: a swap
* that finds no free slot does not happen.
*
* The engine proposes once a step (Engine::tiering_dispatch), and a step routes every layer, so
* the budget has to cover the whole model's turnover. Replaying the routing of a mixed workload
* through the engine's policy at Qwen3.8-Flash-Next TP1 (40% of the experts resident), the hit
* rate on decode rows is 63.8% at 8 a step, 74.1% at 32, 77.1% at 64 and 77.8% at 128 -- and an
* oracle that knows every future routing, held to the same 64 swaps a step, reaches 78.0%. Past
* this the move rate, not the ranking, is what bounds the hit rate. */
#define RAD_PLACE_MOVES_PER_STEP 64
/* SHADOW SLOTS: slab slots that are allocated but hold no unit, so a promotion writes into one
* and only then publishes and never DMAs over a slot a kernel might still be reading (mover.h).
*
@@ -184,12 +196,28 @@ struct SlabClass {
* explicitly and --gpu-headroom-mib is memory the engine promises NOT to touch. So dynamic
* placement costs a few resident units, and the plan report prints exactly how many.
*
* 32 is far past where the knob stops mattering, and MORE is the wrong end of the problem: extra
* shadows raise the move rate and run SLOWER, because more copies in flight contend with the
* zero-copy tier for the same link. The quarter-of-the-slab cap only ever binds on a slab too
* small for the number to be meaningful. */
* THESE ARE THE SLOTS THE ENGINE CAN ALWAYS COUNT ON, and the expert floor charges for them
* (expert_vram_floor), so every slot here is one the KV cache can never have. The rest of what the
* move budget needs is RAD_PLACE_TURNOVER_SLOTS, taken out of the cache's loan instead. The
* quarter-of-the-slab cap only ever binds on a slab too small for the number to be meaningful. */
#define RAD_PLACE_SHADOW_SLOTS 32
/* THE TURNOVER SLOTS: free slab slots the mover keeps out of a loan (Mover::lend_from), past the
* shadow slots, by filling the loan's slots only up to them. A swap holds a slot for about three
* steps -- the copies go out behind the step that proposed them, the next step's retire publishes
* them, and the slot the demotion left comes back only once the compute stream has passed the
* quarantine recorded after that publish -- so a budget of RAD_PLACE_MOVES_PER_STEP needs three
* times as many free slots, and with fewer the budget is smaller than it says. At 64 a step,
* replaying the routing with 32 slots in all reaches 65.9% against 77.9% with 192.
*
* Out of the loan because that costs the cache nothing: a lent slot left free is one the experts
* were borrowing anyway, and charged to the expert floor instead the same slots would come out of
* the cache's largest size. When the cache takes memory back, the free slots at the loan's top go
* first and the mover rebuilds them by dropping its coldest lent units, which still have their
* host copies (Mover::balance); only once nothing is lent does the move rate fall back to what
* the shadow slots alone allow. */
#define RAD_PLACE_TURNOVER_SLOTS (3 * RAD_PLACE_MOVES_PER_STEP - RAD_PLACE_SHADOW_SLOTS)
/* ------------------------------------------------------------------ per-weight result */
struct Placement {
Tier tier = Tier::VRAM;
@@ -206,6 +234,8 @@ class Plan {
public:
int rank = 0, world_size = 1;
Strategy strategy = Strategy::Auto;
/* Why `strategy` is the one it is, when `auto` chose it; empty when it was asked for. */
std::string strategy_why;
/* False under Config::deterministic. Dynamic placement sets which experts are resident and
* residency sets the summation order, so identical inputs do not give identical outputs