[XPU] Support apply_router_weight_on_input for Llama4 for fused_experts (#22654)

merge this one as it is xpu only change.
This commit is contained in:
Rahul Vijayaraghavan
2026-04-29 10:44:48 +08:00
committed by GitHub
parent 1e14bd6f36
commit 1aee04e7df
@@ -584,6 +584,9 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, MultiPlatformOp):
from sgl_kernel import fused_experts
topk_weights, topk_ids, _ = topk_output
if moe_runner_config.apply_router_weight_on_input:
x = x * topk_weights.to(x.dtype)
topk_weights = torch.ones_like(topk_weights)
output = fused_experts(
x,
layer.w13_weight,