Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scattermoe/torch-ext/scattermoe/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ def forward(self, layer_input):
gates=routing_weights
)
layer_output = layer_output.view(bsz, length, emb_size)
return layer_output, router_logits
return layer_output

Comment on lines +51 to 52
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we don't need the router_logits in the kernel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've understood, the new transformers v5 tracks the router_logits via some annotations to the main class: _can_record_outputs and OutputRecorder (huggingface/transformers#40822 (comment)). @ArthurZucker has confirmed those annotations will be added to GraniteMoe, making the output signature same as all the other MoE models, where the router logits are similarly tracked via those annotations.

I'm not sure if the underlying mechanism that tracks the logits for v5 will work with the kernel, but it's hard to test since for GraniteMoeHybrid, we need mamba_ssm to be compatible with v5.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifications @shawntan, I don't get though why it's hard to test ?

Copy link
Contributor Author

@shawntan shawntan Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Mamba's been updated, I've tested it. Sorry about that.

Everything seems good to go!