Commit Graph
15 Commits
Author SHA1 Message Date
hazyumps 2af7fa4022 Add static YaRN to Qwen rotary paths with independent CPU and ROCm vectors 2026-10-07 11:09:27 +02:00
Deadcode 82b5835c02 radiance 1.1.0
- The VRAM split has no ratio: --expert-vs-cache-ratio is gone (now an unknown option). The
  experts keep what the pinned host pool cannot hold, the KV cache takes the rest and lends idle
  blocks to the experts. Flash-Next at tp2: 7.9 GiB of KV a card, up from 4.7. Startup, /stats,
  /metrics and the dashboard report the most the cache can hold.
- Linear-state snapshots live in pinned host memory, not VRAM (--checkpoint-slots sizes the
  store). Prefix-cache misses on agent sessions fixed; a published conversation is no longer
  trimmed away.
- Any world size from the shipped container (baKon): --tp 3 on Flash-Next with no padded
  checkpoint -- the attention world, uneven delta-net heads, the fill op.
- Kernels (keptn42): moe_gemm_q decode loads and one-trip run search, hc_read's prefill form
  (+3.7% prefill at 18K), hc_up row groups up to eight, the fused router launch. Each is the rule
  where it was measured faster; no environment switches.
- Tool calls: a typed argument is always JSON (Python True/None no longer leak into arguments --
  Codeberg #21); nine further reply-parser fixes; the reply path inside a call is ~12x cheaper on
  the host.
- The kernel changes: prefill +2-3% and decode -2% a step on 2x R9700 at tp2, identical text.
2026-10-06 14:04:49 +02:00
baKon 5acdab7eb7 arch: the ranks without attention take the remainders first
Whatever does not divide over the world -- the extra block of an expert's
width, the extra delta-net head -- went to whichever rank the rotation picked,
and the attention-zero rank, which pays nothing for attention and keeps no
attention cache, came away the lightest. rad_arch.h remainder_place puts the
attention-zero ranks first in the order the remainders are handed out, then
the attention ranks in today's rotation; with no such rank the place is the
rotation itself and every cut is byte for byte what it was. Flash-Next at
three ranks: experts 30/30/40 and delta-net heads 5/5/6 instead of 35/35/30
and 6/5/5.
2026-10-06 11:23:06 +02:00
baKon 3e629e7a27 kv: a group a rank keeps no cache for
rad_kv_group_zero(b, group): the group is declared as on every other rank --
the scheduler indexes groups by position and one block table serves every
rank -- and this rank carves nothing for it: its block count is the shared
table's, its costs are zero, its pool base is null, and issue refuses any op
on this rank that names it. For a rank the geometry gives no attention heads,
whose attention is a fill of zeros and never stores or reads a key. qwen4exp
declares its attention group so on such a rank. The arch test's contract
becomes the real one: same KV groups by position; ops are each rank's own.
2026-10-06 11:23:06 +02:00
baKon d72b00bfdb tests and docs for the attention world
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.
2026-10-06 11:23:06 +02:00
Deadcode e466fa07e2 radiance 1.0.10
- 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.
2026-10-05 14:01:30 +02:00
keptn42 2f56e3c477 four-rank ar_gather_hc_write: the MoE gather in front of the exact one-shot write
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.
2026-10-05 12:52:54 +02:00
keptn42 c36e6fa2b3 four-rank ar_hc_write: the exact one-shot with the gated residual's write
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.
2026-10-05 12:52:54 +02:00
keptn42 63d35ff791 four-rank Flash-Next: the routed experts in four classes
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.
2026-10-05 12:52:44 +02:00
keptn42 bfae23e368 four-rank Flash-Next: the shared and plain experts' remainders go to ranks 2 and 3
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.
2026-10-05 12:52:44 +02:00
Deadcode 140987fa7b radiance 1.0.8
- 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.
2026-10-04 21:59:28 +02:00
picoder 8f795c1022 plain bf16 experts: the model's width, and an uneven share of the tiles
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.
2026-10-04 21:47:44 +02:00
picoder b8fab2c871 test: pin the four-rank expert WIDTH split, and that it tiles exactly
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.
2026-10-04 21:47:44 +02:00
picoder 7cf4c005e1 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.
2026-10-04 21:47:44 +02:00
Deadcode ae74a8aebf radiance 1.0.0 2026-10-04 12:02:41 +02:00