[ROCm][CI] Extended Fused MoE and FP8 MoE test support (#41100)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
This commit is contained in:
Andreas Karatzas
2026-08-19 10:19:42 -05:00
committed by GitHub
parent be06873198
commit 160f7f0840
9 changed files with 331 additions and 31 deletions
@@ -857,6 +857,12 @@ def invoke_fused_moe_triton_kernel(
BLOCK_SIZE_K,
)
use_td = False
# Triton treats 0-D tensor arguments as scalar values, but the kernel
# loads tensor-wise activation scales through a pointer.
if A_scale is not None and A_scale.ndim == 0:
A_scale = A_scale.reshape(1)
fused_moe_kernel[grid](
A,
B,
@@ -313,7 +313,7 @@ def break_fp4_bytes(a, dtype):
signs = (combined & 0x08).to(torch.bool) # Sign bits
abs_vals = (combined & 0x07).to(torch.long)
kE2M1 = kE2M1ToFloat_handle.val
kE2M1 = kE2M1ToFloat_handle.val.to(device=a.device)
# Device-aware lookup and sign application
values = kE2M1[abs_vals] * torch.where(signs, -1.0, 1.0)
# Reshape to final form