vllm.models.kimi_k3.nvidia.specialized_decode.cutedsl.moe.tail_runtime
¶
Routed MoE tail: one fused kernel finalizes this rank's top-16 rows, multicasts the
latent partial and peer-stores the shared shard (three rotating parities), all-reduces
and RMS-normalizes per K-slice, runs the K-split up projection and multicasts the output
row into the next AttnRes mailbox. At TP8 B5+ and TP16 B9+ the experts publish the
latent partial, WaveMoeTail.push the shared shard and WaveMoeTail does the rest. At
twoshot_batches the latent all-reduce is common.twoshot: the experts push each
partial chunk to its column owner, whose WaveMoeTail CTAs sum and multicast it.
Classes:
-
MoeTailBox–Model-owned MoE tail mailboxes: latent [3, TP, CAP, 3584] (multicast), shared
-
MoeTailWeights–One layer's up-projection shard [7168/TP, 3584], RMS weight and TMA map.
-
PreparedTail–The layer's MoE tail; placement = (model MoeTailBox, MoE ordinal, MoE layer
Functions:
-
compile_tail–front: rows complete at the PDL wait; front_poll: three 0xffff-armed G/W/S parity
-
published–The experts publish the latent and WaveMoeTail runs the tail (else MoeTail
-
resident_clusters–Co-resident 16-CTA clusters at one CTA per SM.
-
shares–WaveMoeTail clusters share reduced latent rows (all 112 CTAs must be
MoeTailBox
¶
Model-owned MoE tail mailboxes: latent [3, TP, CAP, 3584] (multicast), shared
reduce-scatter [3, TP, CAP, 7168/TP] (peer stores), output [1, CAP, 7168], the
local all-reduced latent rows [3, CAP, 3584] that WaveMoeTail clusters share and the
two-shot latent buffers (twoshot_args/twoshot_tail replace args/tail).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/tail_runtime.py
MoeTailWeights
¶
One layer's up-projection shard [7168/TP, 3584], RMS weight and TMA map.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/tail_runtime.py
PreparedTail
¶
The layer's MoE tail; placement = (model MoeTailBox, MoE ordinal, MoE layer
count). At WaveMoeTail batches the experts publish into latent slot publish[b]
(multicast, parity, rank; at twoshots the two-shot push box) and the side
stream pushes the shared-expert output (push).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/tail_runtime.py
compile_tail(tp, batch, device, mode='front', trigger=2, early=False, umma=False)
cached
¶
front: rows complete at the PDL wait; front_poll: three 0xffff-armed G/W/S parity
slots polled per row and re-armed after use; publish (published): WaveMoeTail
over the published mailboxes, reading the weight shard directly, not by TMA;
twoshot: publish over the two-shot receive slots and gather.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/tail_runtime.py
published(tp, batch)
¶
The experts publish the latent and WaveMoeTail runs the tail (else MoeTail front).
resident_clusters(device)
cached
¶
Co-resident 16-CTA clusters at one CTA per SM.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/tail_runtime.py
shares(tp, batch, twoshot=False)
¶
WaveMoeTail clusters share reduced latent rows (all 112 CTAs must be co-resident).