[ROCm][Quant] mxfp8 moe/linear gfx950 tuning for MiniMax-M3 (#45725)
Signed-off-by: Hongxia Yang <hongxia.yang@amd.com>
This commit is contained in:
@@ -89,7 +89,13 @@ def _mxfp8_dot_scaled_linear(
|
||||
N = w.shape[0]
|
||||
x_q, x_scale = mxfp8_e4m3_quantize(x)
|
||||
out = torch.empty((M, N), dtype=x.dtype, device=x.device)
|
||||
BLOCK_M, BLOCK_N, BLOCK_K = 64, 128, 128
|
||||
# Regime-gated launch tiles for gfx950, tuned at MiniMax-M3 shapes:
|
||||
# for example, 8k/1k, 1k/1k
|
||||
if M >= 1024:
|
||||
BLOCK_M, BLOCK_N, num_warps, num_stages = 128, 256, 8, 2
|
||||
else:
|
||||
BLOCK_M, BLOCK_N, num_warps, num_stages = 64, 64, 4, 2
|
||||
BLOCK_K = 128
|
||||
grid = (triton.cdiv(M, BLOCK_M), triton.cdiv(N, BLOCK_N))
|
||||
_mxfp8_linear_kernel[grid](
|
||||
x_q,
|
||||
@@ -113,7 +119,8 @@ def _mxfp8_dot_scaled_linear(
|
||||
BLOCK_M=BLOCK_M,
|
||||
BLOCK_N=BLOCK_N,
|
||||
BLOCK_K=BLOCK_K,
|
||||
num_warps=8,
|
||||
num_warps=num_warps,
|
||||
num_stages=num_stages,
|
||||
)
|
||||
return out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user