[AMD][Bugfix] Skip invalid fused MoE reduction for direct top-1 output (#36309)

This commit is contained in:
Bingxu Chen
2026-08-26 18:52:15 -07:00
committed by GitHub
parent b658d64d5b
commit 4f59a8dcfa
@@ -908,7 +908,9 @@ def _fused_moe_kernel_sequence(
routed_scaling_factor,
)
elif _is_hip:
if _use_aiter:
if topk == 1 and routed_scaling_factor == 1.0 and not _use_intermediate:
pass # we wrote directly into out_hidden_states
elif _use_aiter:
moe_sum(
intermediate_cache3.view(*intermediate_cache3.shape),
out_hidden_states,