[AMD] Optimize MiniMax-M2.5 - use aiter biased_grouped_topk for sigmoid scoring in MoE routing (#23611)

This commit is contained in:
YC Yen-Ching Tseng
2026-04-24 22:18:08 -07:00
committed by GitHub
parent 8471c9ebe6
commit fb272d27db
+18 -7
View File
@@ -538,13 +538,24 @@ def fused_topk(
renormalize,
)
elif scoring_func == "sigmoid":
topk_sigmoid(
topk_weights,
topk_ids,
gating_output,
renormalize,
correction_bias,
)
if _use_aiter and correction_bias is not None:
aiter_biased_grouped_topk(
gating_output,
correction_bias.to(dtype=gating_output.dtype),
topk_weights,
topk_ids,
num_expert_group=1,
topk_group=1,
need_renorm=renormalize,
)
else:
topk_sigmoid(
topk_weights,
topk_ids,
gating_output,
renormalize,
correction_bias,
)
else:
raise ValueError(f"Invalid scoring function: {scoring_func}")