TP4 for Qwen3.8-Flash-Next: unfused chain, four refusals answered

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.
This commit is contained in:
picoder authored and StillDeadcode committed 2026-10-04 21:47:44 +02:00
1 parent 966bda899a
commit 7cf4c005e1
14 files changed
+926 -31

No files matched your search

+15
View File
@@ -119,6 +119,18 @@ int r4d_rad_attn_decode_gq_h256_gqa12_bf16(const RadArgs*, RadStream);
int r4d_rad_attn_decode_gq_h256_gqa12_bf16_describe(const RadArgs*, RadStream, RadLaunchDesc*,
int, int*);
int64_t r4d_rad_attn_decode_h256_gqa12_scratch(const RadArgs*);
/* Six queries a KV head, head_dim 256, paged block 4 -- the same QSA layers at four ranks, where
* the KV head is replicated across a rank pair. Same body again; the verify width is 64/6 = 10
* against gqa12's 5, which is the decode rows' constraint value. */
int r4d_rad_attn_prefill_h256_gqa6_fp8 (const RadArgs*, RadStream);
int r4d_rad_attn_prefill_h256_gqa6_bf16(const RadArgs*, RadStream);
int r4d_rad_attn_decode_h256_gqa6_fp8 (const RadArgs*, RadStream);
int r4d_rad_attn_decode_h256_gqa6_fp8_describe(const RadArgs*, RadStream, RadLaunchDesc*,
int, int*);
int r4d_rad_attn_decode_h256_gqa6_bf16 (const RadArgs*, RadStream);
int r4d_rad_attn_decode_h256_gqa6_bf16_describe(const RadArgs*, RadStream, RadLaunchDesc*,
int, int*);
int64_t r4d_rad_attn_decode_h256_gqa6_scratch(const RadArgs*);
/* -- gated delta net (r4d_gdn_*.hip) -- */
int r4d_rad_gdn_chunk_scan (const RadArgs*, RadStream);
@@ -149,6 +161,9 @@ int r4d_rad_ar_init(const RadParam*, int, int rank, int world, void** out);
void r4d_rad_ar_fini(void*);
int r4d_rad_ar_oneshot_2rank_exact(const RadArgs*, RadStream);
int r4d_rad_ar_gather_2rank (const RadArgs*, RadStream);
/* The gather at a wide group's handshake (r4d_ar_gather_Nrank.hip launches it). */
int r4d_rad_ar_gather_4rank (const RadArgs*, RadStream);
int r4d_rad_ar_gather_8rank (const RadArgs*, RadStream);
int r4d_rad_ar_oneshot_2rank_wht6 (const RadArgs*, RadStream);
int r4d_rad_ar_oneshot_4rank_exact(const RadArgs*, RadStream);
int r4d_rad_ar_oneshot_8rank_exact(const RadArgs*, RadStream);