vllm.models.kimi_k3.amd.specialized_decode.runtime
¶
Kimi-K3 specialized decode on MI355X (layer mode), enabled by
additional_config={"decode_backend": "latency_specialized"}.
specialized_decode_config runs in the model's __init__, before the weights
load. It returns None for the stock decode, and raises with every reason from
unsupported when the specialized decode is requested for a deployment it cannot
serve. Checks that need the loaded weights run when the executor is built
(decode.SpecializedDecode), those that need the KV cache in prepare_kv.
Modules:
-
decode–The Kimi-K3 specialized decode executor (layer mode): one routing decision per
-
guards–The refusals that need the loaded model (
weight_reasons) or the bound KV -
layers–The layer kernels: each takes and returns what
-
mla–An MLA layer's decode between the mono kernels' halves (M1a before, M1b in
-
peer–Peer memory for in-kernel TP collectives: one uncached buffer a rank, every
-
runner–The specialized decode's per-rank state: one scratch buffer every launch shares
Classes:
Functions:
-
decode_backend–The requested decode backend: the one place that reads the switch.
-
layer_kinds–Decoder layer -> kind, for every layer a kernel serves: the MoE layers with
-
m1_reasons–Why the MLA layers cannot run M1 (empty: they can). At DCP8 not a refusal:
-
m1c_serves–M1c runs every step of 1 ..
seqsrequests at qlenq: its KV splits -
piecewise_graphs_only–Decode steps captured as PIECEWISE graphs only: plan() runs them stock.
-
specialized_decode_config–The deployment's specialized decode settings, None for the stock decode.
-
step_reasons–The (max_num_seqs, speculative tokens) pairs served: a full step fits one
-
unsupported–Every reason this deployment cannot run the specialized decode (empty: it
DecodeConfig
dataclass
¶
Attributes:
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
widths
property
¶
The rows a launch serves: whole requests, 1 .. max_num_seqs of them. Every uniform verify step is one of them (vLLM captures no uniform decode graph wider than max_num_seqs x q), so an eager step never pads; a FULL replay pads whole requests the way vLLM's stock decode does.
decode_backend(vllm_config)
¶
The requested decode backend: the one place that reads the switch.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
layer_kinds(config)
¶
Decoder layer -> kind, for every layer a kernel serves: the MoE layers with AttnRes and at least one block before them, minus the MLA block-write layers (none in Kimi-K3).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
m1_reasons(vllm_config)
¶
Why the MLA layers cannot run M1 (empty: they can). At DCP8 not a refusal:
those layers run vLLM's attention ops instead, then K2 (step_reasons).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
m1c_serves(q, seqs)
¶
M1c runs every step of 1 .. seqs requests at qlen q: its KV splits
share out evenly over the requests (layers.m1c_at).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
piecewise_graphs_only(vllm_config)
¶
Decode steps captured as PIECEWISE graphs only: plan() runs them stock.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
specialized_decode_config(vllm_config)
¶
The deployment's specialized decode settings, None for the stock decode. Raises when the specialized decode is requested for an unsupported deployment, listing every reason.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
step_reasons(vllm_config, check_m1c=True)
¶
The (max_num_seqs, speculative tokens) pairs served: a full step fits one
launch, and at DCP1 every step runs M1c (check_m1c: M1c's geometry needs
the kernels' modules, so only on a supported platform).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
unsupported(vllm_config)
¶
Every reason this deployment cannot run the specialized decode (empty: it
can). Config only: the loaded weights are checked when the executor is built.
Default-deny: every feature below is refused, the kernels serve none of them.
What only M1 needs is not refused at DCP8 (m1_reasons).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |