vllm.models.kimi_k3.nvidia.specialized_decode.cutedsl.kda.prepared
¶
Prepared KDA core. One packed projection supplies Q/K/V, the output gate, F_A and beta; per-batch policies select the gate schedule and the projection row pitch.
Classes:
Functions:
-
core–The KDA core for a step shape: KdaWS, KdaStream, KdaWide or KdaSplit by the
-
decode_conv_weight–The [3, width, D] (Q, K, V) decode layout of the [3 * D, 1, width] conv
-
deferred_supported–Whether the KDA metadata of the specialized decode defers a layer's RecoverSSM
-
replays–Whether a deferred RecoverSSM verify step runs KdaFused (else: flush + core).
-
stream_ctas–Persistent CTAs (two per SM) with an equal item count each.
-
stream_layout–(conv dim-first, window) when KdaStream can cp.async this step's operands
PreparedKda
¶
Methods:
-
prepare_caches–Policy keys: a batch, or (requests, tokens) for verify steps.
-
process_weights_after_loading–Refill the derived conv weight and FP32 norm after a weight reload.
-
run–accepted[>= B] (verify steps ofqtokens):slotsis [>= B, q]
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
_operands(caches, projected, slots, out, accepted=None, deferred=())
¶
Kernel tensors in launch order: 13 before the scalars, then F_B (and the verify step's accepted counts and RecoverSSM records; fused: the record rows and pending counts).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
prepare_caches(caches)
¶
Policy keys: a batch, or (requests, tokens) for verify steps.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
process_weights_after_loading(attention)
¶
Refill the derived conv weight and FP32 norm after a weight reload.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
run(projected, out, *, caches, slots, accepted=None, q=1, deferred=None)
¶
accepted [>= B] (verify steps of q tokens): slots is [>= B, q]
contiguous, or [>= B, 1] (the checkpoints) under RecoverSSM. deferred
(the KDA metadata's recoverssm_deferred): the record rows [>= B] and
pending counts of a deferred RecoverSSM step.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
core(specs, heads, gate_mode, has_bias, device, tokens, record, fused=False)
¶
The KDA core for a step shape: KdaWS, KdaStream, KdaWide or KdaSplit by the per-kind (request, head) item thresholds above (DEP's 96-head RecoverSSM verify takes KdaStream below KdaWS: TP1 R1 split / wide / stream 14.3 / 13.0 / 12.2, R2 19.2 / 19.6 / 17.8, R6 47.3 / 37.6 / 33.7 us).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
decode_conv_weight(weight)
¶
The [3, width, D] (Q, K, V) decode layout of the [3 * D, 1, width] conv weight.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
deferred_supported(backend, state, lower_bound)
¶
Whether the KDA metadata of the specialized decode defers a layer's RecoverSSM
commit: the layer's RecoverSSM kernels are Triton (the stock FP32-state path) and
the specialized FP32 commit can fold its checkpoints (FP32 [slot, H, 128, 128] on
SM10x, a bounded gate). recoverssm.context.KDADeferredCommitContext takes
the same decision (its commit backend fp32_deferred).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
replays(heads, requests, fused)
¶
Whether a deferred RecoverSSM verify step runs KdaFused (else: flush + core).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
stream_ctas(items, device)
¶
Persistent CTAs (two per SM) with an equal item count each.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/prepared.py
stream_layout(specs, tokens)
¶
(conv dim-first, window) when KdaStream can cp.async this step's operands (16-byte aligned rows and slots), else None.