Skip to content

Commit

Permalink
[BugFix] fix group_topk (vllm-project#8430)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsikka authored and MengqingCao committed Sep 30, 2024
1 parent ab260a3 commit 20967ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vllm/model_executor/layers/fused_moe/fused_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ def fused_topk(

if renormalize:
topk_weights = topk_weights / topk_weights.sum(dim=-1, keepdim=True)

return topk_weights, topk_ids


Expand Down Expand Up @@ -443,7 +444,8 @@ def grouped_topk(hidden_states: torch.Tensor,

if renormalize:
topk_weights = topk_weights / topk_weights.sum(dim=-1, keepdim=True)
return topk_weights, topk_ids

return topk_weights, topk_ids.to(torch.int32)


def get_config_dtype_str(dtype: torch.dtype,
Expand Down

0 comments on commit 20967ae

Please sign in to comment.