vllm.models.kimi_k3.amd.specialized_decode.runtime.guards
¶
The refusals that need the loaded model (weight_reasons) or the bound KV
caches (cache_reasons), and the fail-stop watch on the kernels' error words.
Each refusal reports every reason, not only the first.
Classes:
-
FailStop–Stops every TP rank at the same step once any of them gave up an in-kernel
Functions:
-
cache_reasons–Every KDA layer's (conv, recurrent) state as K1 reads them; every MLA
-
mla_weight_reasons–Why the loaded MLA layers cannot run M1 (empty: they can). Not a refusal:
-
weight_reasons–model: the loadedKimiLinearModel; every kernel layer's weights as
FailStop
¶
Stops every TP rank at the same step once any of them gave up an in-kernel
wait (its health word FAILED, mono.abi). Each step queues a D2H copy of
this rank's word and keeps the newest copy that has landed, without blocking;
every CHECK_EVERY steps the ranks agree on those over the TP CPU group and all
raise together. A rank that raised alone would leave the others in the next
collective (the drafter's) for ever. A failure is seen within about
CHECK_EVERY steps.
Methods:
-
after_step–Once per step on every TP rank (compute_logits, itself collective).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/guards.py
after_step()
¶
Once per step on every TP rank (compute_logits, itself collective).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/guards.py
_mla_reasons(p, w, need)
¶
An MLA layer as M1a / M1b (and runtime/mla.py) run it: AITER MLA's
metadata, NoPE, gated, DCP1 or DCP8, an fp8 cache, W_UK / W_UV as MXFP4 bmms.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/guards.py
_need(reasons)
¶
need(name, t, shape, dtype): appends to reasons unless t is
a contiguous shape dtype tensor.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/guards.py
cache_reasons(caches)
¶
Every KDA layer's (conv, recurrent) state as K1 reads them; every MLA layer's fp8 cache, rows of 576 bytes (the blocks may be strided).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/guards.py
mla_weight_reasons(model)
¶
Why the loaded MLA layers cannot run M1 (empty: they can). Not a refusal: those layers run vLLM's attention ops instead, then K2.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/guards.py
weight_reasons(model)
¶
model: the loaded KimiLinearModel; every kernel layer's weights as
K1 and K2 read them, and the MoE backend that lays them out. The MLA layers'
attention is mla_weight_reasons'.