Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion flashinfer/fused_moe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,17 @@ def cutlass_fused_moe(
use_wfp4afp8_humming=use_wfp4afp8_humming,
)

if profile_ids is None:
if (
profile_ids is None
and backend in ("120", "121")
and use_mxfp8_act_scaling
and fc1_expert_weights.dtype == torch.int64
):
# The SM120 profiler cannot safely construct MXFP8 x MXFP4 TMA
# inputs yet. Profiling these tactics can poison the CUDA context,
# so use the runner's fallback tactics for this mode.
gemm_tactic_1, gemm_tactic_2 = -1, -1
elif profile_ids is None:
tuner = AutoTuner.get()
MoERunner.refine_tuning_config(tune_max_num_tokens)

Expand Down
21 changes: 20 additions & 1 deletion tests/moe/test_trtllm_cutlass_fused_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ def test_moe_mxfp8_mxfp4(
alpha,
beta,
limit,
use_autotune,
use_autotune=False,
):
"""
Test MoE with MXFP8 activations and MXFP4 weights.
Expand Down Expand Up @@ -1682,6 +1682,25 @@ def test_moe_mxfp8_mxfp4(
torch.testing.assert_close(ref_output, flash_output, rtol=1e-1, atol=1e-1)


@pytest.mark.skipif(
torch.cuda.get_device_capability() not in [(12, 0), (12, 1)],
reason="Regression test is specific to SM120/SM121 autotuning",
)
def test_moe_mxfp8_mxfp4_autotune_sm120():
test_moe_mxfp8_mxfp4(
batch_size=1,
hidden_size=128,
num_experts=2,
top_k=2,
intermediate_size=128,
otype=torch.bfloat16,
alpha=None,
beta=None,
limit=None,
use_autotune=True,
)


@pytest.mark.parametrize("batch_size", BATCH_SIZES)
@pytest.mark.parametrize("hidden_size", HIDDEN_SIZES)
@pytest.mark.parametrize("num_experts", NUM_EXPERTS)
Expand Down
Loading