Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank31398 committed Aug 9, 2024
1 parent d40db0e commit ef91329
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel_hyperdrive/scattermoe/torch_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def _compute_experts(
router_weights, selected_experts
)

# batch_index -> (num_tokens * top_k)
# batch_gates -> (num_tokens * top_k)
# num_experts_per_token -> (num_experts)

expert_inputs = hidden_states[batch_index]

hidden_states = self.c_fc(expert_inputs, num_experts_per_token)
Expand Down

0 comments on commit ef91329

Please sign in to comment.