kv tiers: rad_kv_group_replicated -- a group every rank holds whole is kept once a host slot

Under tensor parallelism a host slot held every rank's shard of an entry end to end, so a
group every rank holds whole (an MLA latent cache computed from a replicated projection) was
stored once a rank: on GLM-5.3-Flash at eight ranks 396.75 KiB a 4-token block for 49.59 KiB
of distinct bytes. The plugin now says which paged groups are replicated (additive export,
RAD_ABI_VERSION does not move), and the slot holds those once, in one window at its front
that rank 0 writes and every rank reads back on a restore; the sharded groups follow, one
window a rank, as before. Without the declaration nothing changes.

TierExec::slot_layout is the one place the slot arithmetic lives: bringup takes the windows
from it, and it refuses a group replicated on one rank but zero, unflagged or another width
on another. A follower moves only its own window on a copy out (nothing, when every cached
group is replicated) and both windows on a restore. The startup log names what is held once
and the tokens the tier holds either way.

RADIANCE_DEBUG_TIER_VERIFY now covers the claim: each follower gathers the replicated groups
into a pinned scratch beside the copy and hashes them once landed, and the engine, once every
rank has landed, has the leader compare its window with every follower's sum.

mem_test moves a chain through the real TierExec with a replicated and a sharded group at 1,
2 and 8 ranks, the ranks' copies differing on purpose, and checks every rank gets the leader's
bytes back; beside a zero group; the verify path alike and differing; and the layout's refusal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
NunzeandClaude Fable 5.1 committed 2026-10-22 09:08:44 +00:00
1 parent 17d004d0d0
commit 66a1d5aa15
15 files changed
+490 -87

No files matched your search

+16 -1
View File
@@ -1082,6 +1082,18 @@ moving blocks one at a time would be all dispatch cost. Within a layer blocks ar
packing a set is `gather_rows` and restoring is `scatter_rows` (`docs/OPS.md`): one launch per
(group, layer) for a whole batch.
**Under tensor parallelism** the policy describes conversations, which are not sharded, and the
transfer is per rank. One host slot holds the whole engine's entry: a group every rank holds whole
(`rad_kv_group_replicated`, an MLA latent cache) once, in one window at the slot's front that rank
0 writes and every rank reads back; then each rank's own shard of the sharded groups, one window
per rank, which can differ in width (uneven heads, `rad_kv_group_zero`). `TierExec::slot_layout`
is the one place the arithmetic lives, and bringup refuses a group replicated on one rank but zero,
unflagged or another width on another. The leader plans and reports; a follower moves only its own
window and, under `RADIANCE_DEBUG_TIER_VERIFY`, also gathers the replicated groups so the leader
can compare its window with every follower's hash once the batch has landed everywhere, which is
how the plugin's claim is checked. On GLM-5.3-Flash at eight ranks, whose two cached groups are
both replicated, a slot is 49.59 KiB rather than 396.75 KiB.
**Recurrent state.** On a hybrid model a session is blocks plus recurrent state. The state lives in
a slot of the snapshot store (pinned host memory, `--checkpoint-slots`), copied off the card after
the step that produced it and back before the step that resumes from it, so it never holds VRAM.
@@ -1143,7 +1155,10 @@ shows every collective where the plugin put it.
The residual stream is replicated: every rank holds the whole hidden state between blocks. Weights
that act only on the stream, such as hyper-connection mixing (`arch/common/rad_block_hc.h`), are
replicated too, since sharding them would add a collective at each use.
replicated too, since sharding them would add a collective at each use. A KV group every rank
holds whole, such as an MLA latent cache computed from a replicated projection, is declared
`rad_kv_group_replicated`, and the idle session tiers (§7.3) then keep it once a host slot instead
of once a rank; the core cannot tell from the graph, so the plugin says it.
`lm_head` is vocabulary-sharded like any column-parallel weight, so the sampler (§13) runs a
distributed top-k: each rank reduces its own shard and only the candidate sets are combined. Full