arch_test: flashnext_tp3_zeroes_the_third_ranks_attention_and_splits_gdn_heads_unevenly
holds the three-rank declaration of the Flash-Next fixture: the three
programs declare the same ops and KV groups in the same order; every
rank the two-rank attention geometry with the span of its heads, rank 2
zero; the delta net 6/5/5 K and 18/15/15 V heads as per-part spans of
[q|k|v|z] and the conv channels, a span of A_log, the output columns,
and the state group at each rank's own V count. The fake builder
records the two new exports as it records the span. The TP4 case's
"world 3 is refused" check becomes "world 3 declares".
docs/TP3.md is rewritten: what replaced the padded checkpoint, the two
rules, what they are built from, the serve line and the log lines. The
pad tools stay in the tree for an engine without an attention world.
- Four-rank Qwen3.8-Flash-Next (PRs 14 and 16 by keptn42): the all-reduce runs fused with the
hyper-connection's write, and with the MoE gather in front of it, on decode and verify steps on
the exact wire. The routed experts are split in four classes, so every rank computes the same
share; moe_gemm_q_mod4 is the new grouped GEMM. The oracle now checks moe_gemm_q on w4nl and
w5nl containers.
- --embedding-placement and --ngram-placement, each auto | vram | ram | disk. The token embedding
can live in the pinned host pool, read in place over the link (from PR 17 by mechkbfan). An n-gram
table can be copied into locked RAM at load instead of read from the container (from PR 15 by
keptn42). auto takes the fastest tier with room once every other weight is placed, and startup
prints what it chose and why. A tier that cannot be honoured stops the start with the reason; the
embedding on disk and the n-gram table in VRAM are refused, since nothing can serve them.
- The expert_tiered placement no longer spends the pinned host pool twice when it falls back to
layer offload, and a lossy-wire request for a four-rank fused write is a selection miss rather
than a startup abort.
At --tp 4 each MoE connection ran moe_gather and the fused write as two
launches, three or four with the inverse table. ar_gather_hc_write_4rank
runs r4d_ar_gather_word as the prologue of ar_hc_write_4rank, with the
two-rank slot table and grid rule. The arithmetic is moe_gather's plus
ar_hc_write_4rank's, so the bytes are unchanged. One and two ranks unchanged.
At --tp 4 each gated-residual connection ran all_reduce and hc_write_bf16
as two launches. ar_hc_write_4rank fuses them: the wide exact one-shot,
reduced in place, with r4d_ar_hc_write_word as its epilogue. It takes the
steps the exact one-shot would (under 1 MiB, and under min_bytes on wht6);
larger and lossy messages keep the two launches. Two ranks unchanged.
The parity split gave ranks 0..3 30/30/20/20 % of the routed work. The extra
block of each five-block expert now goes round all four ranks by expert id
mod 4: rank r takes two blocks of class r and one of each other class, a
quarter each. The plain experts' extra tiles move to ranks 0 and 1 so they
do not stack on the shared expert's. One and two ranks declare as before.
At four ranks the routed parity split leaves ranks 0 and 1 widest, and the
shared expert's extra block and the plain bf16 experts' extra tiles were cut
from rank 0 as well. Both remainders now go to the ranks the routed split
leaves narrowest. One and two ranks declare byte for byte as before.
- Qwen3.8-Flash-Next serves at --tp 4, contributed by goodman-b (PR 9). Rank pairs share each of
the model's two KV heads, every rank computes a slice of every expert's width, and four ranks
run the unfused all-reduce plus a new four-rank all-gather for the vocab-parallel sampler. Two
ranks declare and compute exactly as before. The README has a four-rank flag row; it pins
--host-pool-mib on every card, 48 GiB in all. At four ranks the expert shares are not equal:
ranks 0 and 1 compute three blocks of every even/odd pair of experts and ranks 2 and 3 two
(docs/ARCHITECTURES.md).
- The four- and eight-rank all-gathers require peer access between the cards, as every other
collective does since 1.0.7, and the kernel library's selftest now refuses any multi-rank kernel
that does not.
radiance: 'layer 34's plain experts are 384 wide, which 4 ranks cannot share in
64-wide tiles' -- on ranks 1 and 2 only. The protected experts are declared by a
second grouped GEMM over their own slice of the expert's width, and that width
was read off THIS RANK's parity slices (max ff_hi). At two ranks that is the
model's width; at four it is 384, 512, 640 depending on who asks. Ranks 0 and 3
passed the check, ranks 1 and 2 refused, so the all-reduce's rendezvous got two
of four ranks and the launch died -- the AR error was the cascade, not a bug.
The width is g.n_ff_all. And an even share of it is not available here: 640
columns are ten 64-wide output tiles, which four ranks take as 3, 3, 2, 2. An
uneven share is still whole tiles and every tile still has exactly one owner, so
the rank takes a span -- uniform across a layer's protected experts, because
their GEMM takes ONE table and every entry of a table has one geometry (unlike
the quantised experts, which alternate by parity precisely because they have two).
A rank count that divides the width keeps the old declaration verbatim, span
included: no span at all, the loader dividing the entry itself.
The old assertions pinned expert parallelism -- n_expert = 128, expert_base =
r*128 -- which is the design this replaces. What the four ranks divide is each
expert's width, so what the test pins is a span on every expert's down
projection, per parity, plus the property that actually matters: the four
ranks' slices of one parity TILE the width, each block claimed exactly once.
Neither unserved (a rank quietly dropping a fifth of every expert) nor twice
(the all-reduce then double-counts that block).
Read off the declared spans, not off the plugin's formula -- recomputing them
would only prove the test agrees with the code.
World 4 refused at declare on two counts and at boot on a third the audit
found; the fourth is unchanged by design.
- rad_arch.h: a world above the KV head count replicates the heads in rank
pairs instead of dividing them. Geom gains kv_off; each rank declares
n_head_kv 1 and gqa 6. A world that is not a multiple of the head count
is still refused, by name.
- rad_block_attn_gated_fp8.h: k/v pass the row span LinearFP8 already
takes, gated on world > n_head_kv_all so an even shard is untouched and
TP2 declares byte-identically.
- qwen4exp_fp8.cpp: above two ranks the ranks own whole experts (5 blocks
of 128 do not cut four ways); the parity tables stay two-rank and the
router stays replicated.
- libr4d: attn_{prefill,decode}_h256_gqa6_bs4 rows and their TU -- the
gqa8 body at ratio 6, page 4. No fused form is instantiated at this
geometry; the unfused pair is what resolves.
- libr4d: r4d_ar_gather_Nrank.hip. The vocab-parallel sampler declares an
all_gather at any world > 1 and libr4d shipped only the 2-rank row, so a
TP4 boot was refused by the reference-kernel gate rather than served
wrong. The wide one-shot all-reduce with the reduction removed.
- rad_block_attn_gated.h / rad_block_attn_fp8.h: refuse a world above the
KV head count. They read n_head_kv and declare no span, so they would
have booted and read half a KV head -- fluent wrong text.
- tests/arch_test.cpp: the four-rank declare test, and the fake records
the shard span the real builder stores.
- README, ARCHITECTURES: TP4 in the present tense, with the costs named
and the rate against TP2 left unmeasured.