Skip to content

Commit

Permalink
Update ops.py (vllm-project#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkaniecki authored Jun 26, 2024
1 parent 07a200e commit 2728599
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vllm/hpu/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def static_fused_moe(hidden_states, w1, w2, score, topk):
num_experts = w1.shape[0]
routing_weights = F.softmax(score, dim=1, dtype=torch.float32)
routing_weights, selected_experts = torch.topk(routing_weights, topk, dim=-1)
routing_weights /= routing_weights.sum(dim=-1, keepdim=True)
routing_weights = routing_weights.to(hidden_states.dtype)
final_hidden_states = torch.zeros(
(1, B, D), dtype=hidden_states.dtype, device=hidden_states.device
Expand Down

0 comments on commit 2728599

Please sign in to comment.