vllm.models.minimax_m3.amd.specialized_decode.mono.a16w4
¶
BF16 x MXFP4 (A16W4) MFMA operands over AITER's post-load layouts.
Weights are shuffle_weight(layout=(16, 16)) fp4x2 [E, N, K / 2]: a
16-row group's 128-wide K step is 1 KiB, and lane l's 16 bytes hold row
l % 16, K 32 (l / 16) .. -- one E8M0 group. Scales are
e8m0_shuffle [E N, K / 32]; lane l's dword at
(r32 C8 + st / 2) 64 + l holds its row's codes of steps st (even, odd)
for both 16-row halves of the 32-row block. A dequantized dword is one
16x16x32 BF16 MFMA A operand; the B operand is the same 8 K values of the
lane's token (column l % 16).
Functions:
-
dequant–One fp4x2 dword (8 values, low nibble first) -> 8 BF16 (as 4 i32).
-
scale_f32–The lane's E8M0 scale of step
st(relative to the first loaded -
scale_loads–Lane's scale dwords for steps
st0 .. st0 + steps(st0, steps even). -
step_mfma–acc+= one step: weight wordswv(scalescale) times the -
weight_loads–Lane's 16-byte weight words of 16-row group
row_group(counted over
dequant(word, scale)
¶
One fp4x2 dword (8 values, low nibble first) -> 8 BF16 (as 4 i32).
Source code in vllm/models/minimax_m3/amd/specialized_decode/mono/a16w4.py
scale_f32(words, row_group, st)
¶
The lane's E8M0 scale of step st (relative to the first loaded
word) as an f32 power of two.
Source code in vllm/models/minimax_m3/amd/specialized_decode/mono/a16w4.py
scale_loads(ws, row_group, k, st0, steps, cm=CM_NT)
¶
Lane's scale dwords for steps st0 .. st0 + steps (st0, steps even).
Source code in vllm/models/minimax_m3/amd/specialized_decode/mono/a16w4.py
step_mfma(acc, wv, scale, xs)
¶
acc += one step: weight words wv (scale scale) times the
lane's four B operands xs (vector<4xi32> each).
Source code in vllm/models/minimax_m3/amd/specialized_decode/mono/a16w4.py
weight_loads(w, row_group, k, st0, steps, cm=CM_NT)
¶
Lane's 16-byte weight words of 16-row group row_group (counted over
the flattened [E N] rows) for steps st0 ..; loads only.