[optimize] fuse renormalize into moe_topk_softmax (#7744)

Co-authored-by: ispobock <ispobaoke@gmail.com>
This commit is contained in:
Yi Zhang
2025-07-03 12:42:44 -07:00
committed by GitHub
co-authored by ispobock
parent 6840a7bbb2
commit 2998c4bdf4
7 changed files with 254 additions and 101 deletions
+2 -2
View File
@@ -30,11 +30,11 @@ def moe_align_block_size(
def topk_softmax(
topk_weights: torch.Tensor,
topk_ids: torch.Tensor,
token_expert_indices: torch.Tensor,
gating_output: float,
renormalize: bool = False,
) -> None:
torch.ops.sgl_kernel.topk_softmax.default(
topk_weights, topk_ids, token_expert_indices, gating_output
topk_weights, topk_ids, gating_output, renormalize
)