Archived
A world the KV head count neither divides nor is a multiple of -- three ranks over Flash-Next's two -- was refused by geom_from, and 1.0.12 served it by padding the checkpoint offline (docs/TP3.md): zero heads appended so that 36 / 3 / 18 / 54 divide, a second 115 GiB container per model, 1/3 of the attention and 2 of 18 delta-net heads computing zeros. This serves the shipped container at any world size instead. The attention world. geom_from serves attention on the largest multiple of the KV head count under the world (split, or replicated as 1.0.7 does when that is still above the count) and the ranks past it are attention-zero: they declare the same heads and the same program as their peers -- the scheduler sees one program -- and read nothing for attn_qg, attn_k, attn_v and attn_output (rad_weight_shard_zero). Their attention computes zeros from zeros and their output projection adds exactly nothing to the reduce. Three ranks over two heads: attention on ranks 0 and 1 exactly as the two-rank serve declares it, 12 heads, one KV head, gqa 12, the same kernels; rank 2 zero. Five over two: attention on four, rank 4 zero. Under a smaller attention world the even shard over `world` is the wrong cut for every projection, so rad_block_attn_gated_fp8.h declares spans -- q|gate rows and output columns [attn_rank * n_head, +n_head) heads, k/v at kv_off -- the same call the KV replication already used. When the attention world is the world, every TP2 and TP4 deployment, nothing here is declared and the block declares as it always did. Uneven delta-net heads. The delta net has no KV-head constraint: its kernels are bound on head widths and take any head count. 16 K heads over three ranks are 6, 5 and 5, each rank's V heads the same multiple (48 / 16 = 3: 18, 15, 15), every rank real heads. qwen4exp computes the split and rad_block_gdn_fp8.h declares it as spans of the container's rows: per-part for [q|k|v|z] and the conv channels (the parts are not equal), one span for [a|b], A_log, dt_bias and the output columns. LinearFP8 owns the scale plane's units (1/128 of the weight's rows for block-fp8, the weight's own for int8 and bf16), so a block declares in the weight's rows and the scale plane follows. The even split, when the counts divide, is untouched. The log says what the geometry did: world_size = 3 over n_head_kv = 2: attention on 2 rank(s), rank(s) 2..2 carry zero attention weights and the delta net and experts of a full rank qwen4exp: rank 1 takes delta-net K heads [6, 11) of 16 and V heads [18, 33) of 48