[Bugfix] Fix topk_ids indices_type for CUTLASS w8a8 FP8 MoE (#20166)

Signed-off-by: Ming Yang <yming@meta.com>
This commit is contained in:
Ming Yang
2025-07-08 23:10:57 +00:00
committed by GitHub
parent baba0389f7
commit c438183e99
3 changed files with 17 additions and 11 deletions
@@ -929,9 +929,12 @@ class CompressedTensorsW8A8Fp8MoECutlassMethod(CompressedTensorsMoEMethod):
num_expert_group=num_expert_group,
custom_routing_function=custom_routing_function,
scoring_func=scoring_func,
e_score_correction_bias=e_score_correction_bias,
indices_type=self.topk_indices_dtype,
)
e_score_correction_bias=e_score_correction_bias)
a1_scale = layer.w13_input_scale
a2_scale = layer.w2_input_scale
per_act_token = a1_scale.numel() != 1 if a1_scale is not None else (
a2_scale.numel() != 1 if a2_scale is not None else False)
return self.fused_experts(
x,
@@ -939,13 +942,14 @@ class CompressedTensorsW8A8Fp8MoECutlassMethod(CompressedTensorsMoEMethod):
layer.w2_weight,
topk_weights,
topk_ids,
per_act_token=per_act_token,
activation=activation,
global_num_experts=global_num_experts,
expert_map=None if self.disable_expert_map else expert_map,
w1_scale=layer.w13_weight_scale,
w2_scale=layer.w2_weight_scale,
a1_scale=layer.w13_input_scale,
a2_scale=layer.w2_input_scale,
a1_scale=a1_scale,
a2_scale=a2_scale,
)