-
Notifications
You must be signed in to change notification settings - Fork 338
Fix Llama4 example #2846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix Llama4 example #2846
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -30,7 +30,7 @@ def __init__( | |||||||||||||
def forward(self, x: Tensor) -> Tensor: | ||||||||||||||
batch_size = x.shape[0] | ||||||||||||||
x = x.view(-1, self.hidden_dim) # x: [T, D] | ||||||||||||||
scores = self.router(x) # [T, E] | ||||||||||||||
scores = self.router(x)[0] # [T, E] | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original router returns There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. router here is a nn.Linear, not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ao/torchao/prototype/moe_quant/llama4_quant.py Lines 48 to 53 in 9d01b43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this module does not run by itself? seems quite confusing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||||||||||
scores = F.softmax(scores, dim=-1) | ||||||||||||||
scores, expert_indices = torch.topk( | ||||||||||||||
scores, self.top_k, dim=-1 | ||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.