vllm.models.minimax_m3.amd.ops.flydsl_utils
¶
Helpers shared by the MiniMax-M3 FlyDSL kernels (gfx950).
Functions:
-
cvt_fp4x2_f16–The two e2m1 codes of byte
selofwordas two fp16 (exact). -
cvt_fp8x2_f16–E4M3 bytes 0, 1 (
hi: 2, 3) ofwordas two fp16 (exact). -
dequant8–8 e2m1 codes (low nibble the even dim) and the group's e4m3 table ->
-
exp2–v_exp_f32 without denormal range reduction.
-
key_order4–4 dwords of e4m3 (16 dims) -> even dims, then odd dims per 8 (key order).
-
maxf_nn–v_max_f32 with nnan; without it LLVM canonicalizes both inputs first.
-
mfma_16x16x32–v_mfma_f32_16x16x32_{bf16,f16} on 4-dword operands.
-
mfma_fp8_16x16x128–v_mfma_f32_16x16x128_f8f6f4 on e4m3 operands; zero scales select the
-
pack8–Two 4 x i32 halves -> the 8 x i32 operand of the fp8 16x16x128 MFMA.
-
perm–v_perm_b32: byte i of the result is byte sel_i of (hi:lo).
-
permlane_swap–v_permlane{16,32}_swap; fx has no wrapper.
-
pk_bf16–Two fp32 -> one dword of two bf16 (RNE),
alow. -
pk_f16–Two fp32 -> one dword of two fp16 (RNE),
alow. -
run_compiled–Compiles and runs
exeon the first call, then dispatches the cache. -
xlane4–opover lanes L, L^16, L^32, L^48, broadcast to all four.
cvt_fp4x2_f16(word, sel)
¶
The two e2m1 codes of byte sel of word as two fp16 (exact).
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
cvt_fp8x2_f16(word, hi)
¶
E4M3 bytes 0, 1 (hi: 2, 3) of word as two fp16 (exact).
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
dequant8(c, t_lo, t_hi)
¶
8 e2m1 codes (low nibble the even dim) and the group's e4m3 table -> the e4m3 keys of the even dims, then of the odd dims.
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
exp2(x)
¶
key_order4(d)
¶
4 dwords of e4m3 (16 dims) -> even dims, then odd dims per 8 (key order).
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
maxf_nn(a, b)
¶
v_max_f32 with nnan; without it LLVM canonicalizes both inputs first.
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
mfma_16x16x32(a4, b4, acc, fp16)
¶
v_mfma_f32_16x16x32_{bf16,f16} on 4-dword operands.
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
mfma_fp8_16x16x128(a8, b8, acc4)
¶
v_mfma_f32_16x16x128_f8f6f4 on e4m3 operands; zero scales select the unscaled instruction.
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
pack8(h0, h1)
¶
Two 4 x i32 halves -> the 8 x i32 operand of the fp8 16x16x128 MFMA.
perm(hi, lo, sel)
¶
permlane_swap(op, d_a, d_b)
¶
v_permlane{16,32}_swap; fx has no wrapper.
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
pk_bf16(a, b)
¶
Two fp32 -> one dword of two bf16 (RNE), a low.
pk_f16(a, b)
¶
Two fp32 -> one dword of two fp16 (RNE), a low.
run_compiled(exe, *args, waves_per_eu=None)
¶
Compiles and runs exe on the first call, then dispatches the cache.
Source code in vllm/models/minimax_m3/amd/ops/flydsl_utils.py
xlane4(x, op)
¶
op over lanes L, L^16, L^32, L^48, broadcast to all four.