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 Sep 13, 2024
1 parent 360ddbd commit 8f44a92
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 8f44a92

Please sign in to comment.