vllm.models.kimi_k3.nvidia.specialized_decode.cutedsl.gemm.warp_splitk
¶
FlashInfer's cp.async-pipelined BF16 GEMM for M <= 32 whose four compute warps hold
split-K partials (warp split-K), kernel unchanged; the autotune heuristics are dropped
for per-shape tactics chosen by decode.py and compiled before capture.
The weight streams through two cp.async loader warps with an L2 evict_first hint (one tile is issued before the PDL wait), the activations through one or two loader warps after it; four mma.sync warps each own a K quarter of every stage and reduce through shared memory. Small output tiles (16 or 32 weight rows) give many CTAs that co-reside on an SM, which is what keeps a decode projection's weight stream at HBM speed.
Classes:
-
PreparedWarpSplitK–out[M, N] = x[M, K] @ weight[N, K]^Tfor M <= 32 with a tactic per M;
Functions:
-
compile_warp_splitk–Code for an [n, k] weight with dynamic M (at most 32 rows), PDL on.
PreparedWarpSplitK
¶
out[M, N] = x[M, K] @ weight[N, K]^T for M <= 32 with a tactic per M;
x and out packed row-major, 32 B aligned.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/gemm/warp_splitk.py
_a_fragment_offset(lane, compute_warp, m_iter, phase, k_tile)
¶
Element offset of one lane's A ldmatrix.x4 address within a stage.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/gemm/warp_splitk.py
_b_pair_offset(lane, compute_warp, n_iter, pair, token_tile, k_tile)
¶
Element offset of one lane's B ldmatrix.x4 address within a stage.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/gemm/warp_splitk.py
_cp_async_16_with_policy(dst, src, policy, *, loc=None, ip=None)
¶
16-byte cp.async.cg global->shared carrying an L2 cache-policy hint.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/gemm/warp_splitk.py
_issue_weight_tile(smem, weight, tidx, output_tile_idx, k_tile, stage, policy, output_tile, k_tile_size, with_policy, *, loc=None, ip=None)
¶
Issue one A-loader thread's cp.async copies for weight K tile k_tile.
Plain Python control flow only: this helper is not preprocessed by the DSL.
with_policy selects the .L2::cache_hint form; the pre-barrier
prologue tile must use the plain form because ptxas 13.0 misencodes the
hinted copy in that position (LDGSTS ... [R+UR], desc[UR<odd>]).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/gemm/warp_splitk.py
_l2_policy_evict_first(*, loc=None, ip=None)
¶
64-bit L2 evict_first policy (fraction 1.0).
Must stay a runtime createpolicy: with the equivalent constant, ptxas
13.0 emits the invalid LDGSTS ... [R+UR], desc[UR1] encoding.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/gemm/warp_splitk.py
_ldmatrix_x4(smem, offset, *, loc=None, ip=None)
¶
ldmatrix.x4 of the 16-bit fragment offset elements into smem.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/gemm/warp_splitk.py
compile_warp_splitk(device_index, n, k, tactic)
cached
¶
Code for an [n, k] weight with dynamic M (at most 32 rows), PDL on.