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
KimiDecoderLayer.forward -
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
-
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.
-
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, at most MAX_TOKENS rows. Every uniform verify step up to MAX_TOKENS rows is one of them, 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
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
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.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/__init__.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 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 | |