vllm.models.inkling2.nvidia.ops.ll_gemm_sm120
¶
Low-M BF16 tensor-core projections for SM120/SM121: batched x @ w.T with
deterministic split-K for narrow outputs, and a grouped q/k/v projection.
Functions:
-
qkv_bmm–One launch of three linears on consecutive row ranges of
w[N, K]: -
sm12x_bf16_ll_gemm–Low-latency
x @ weight.T(+bias[N]) for at mostMAX_Mrows, -
use_qkv_bmm–Whether
qkv_bmmserves bf16x_q,x_k,x_v[M, K]andw. -
use_sm12x_bf16_ll_gemm–Whether
sm12x_bf16_ll_gemmserves these operands.
_config(nb, n, k)
cached
¶
Split K into about one wave of programs when that gives at least 3 splits, preferring 16-column tiles; otherwise one 32-column tile over all of K.
Source code in vllm/models/inkling2/nvidia/ops/ll_gemm_sm120.py
_counter(stream)
cached
¶
Split-K tile counters for one stream; each launch leaves them zeroed.
_ll_gemm_kernel(X, W, Bias, Y, P, C, M, N, K, SXB, SXM, SWB, SWN, SYB, SYM, BN, BK, K_PER_SPLIT, SPLIT, MP)
¶
Program (n, b, s) computes column tile n of batch b over K range
s. With SPLIT > 1 it writes fp32 partials to P [SPLIT, B, MP, N];
the last of the tile's programs to finish (counted in C, reset to 0
after) sums them in split order, so results are deterministic.
Source code in vllm/models/inkling2/nvidia/ops/ll_gemm_sm120.py
_qkv_bmm_kernel(XQ, XK, XV, W, Y, M, N, K, S1, S2, SXQ, SXK, SXV, SWN, SYM, BN, BK, MP)
¶
Columns [0, S1) of Y are XQ @ W.T, [S1, S2) XK and [S2, N)
XV. A tile spanning a boundary runs both inputs' dots and picks per
column (the second input's loads hit L2).
Source code in vllm/models/inkling2/nvidia/ops/ll_gemm_sm120.py
qkv_bmm(x_q, x_k, x_v, w, k_start, v_start)
¶
One launch of three linears on consecutive row ranges of w [N, K]:
output columns [0, k_start) from x_q, [k_start, v_start) from x_k
and the rest from x_v, each [M, K] with M <= 16. Returns [M, N]
with fp32 accumulation.
Source code in vllm/models/inkling2/nvidia/ops/ll_gemm_sm120.py
sm12x_bf16_ll_gemm(x, weight, bias=None, out_dtype=None, out=None)
¶
Low-latency x @ weight.T (+ bias [N]) for at most MAX_M rows,
with fp32 accumulation, into out if given. weight [N, K] takes x
[..., K] -> [..., N]; weight [B, N, K] takes x [B, M, K] ->
[B, M, N].
Source code in vllm/models/inkling2/nvidia/ops/ll_gemm_sm120.py
use_qkv_bmm(x_q, x_k, x_v, w)
¶
Whether qkv_bmm serves bf16 x_q, x_k, x_v [M, K] and w.
Source code in vllm/models/inkling2/nvidia/ops/ll_gemm_sm120.py
use_sm12x_bf16_ll_gemm(x, weight, bias=None)
¶
Whether sm12x_bf16_ll_gemm serves these operands.