-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Fix PP in Gemma4 #40786
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
Merged
Merged
Fix PP in Gemma4 #40786
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8ce859b
Fix PP in Gemma4
SKRohit b9f4980
fix indentation
SKRohit aff6555
Merge branch 'main' into fix-gemma4-pp
SKRohit e82e201
Merge branch 'main' into fix-gemma4-pp
SKRohit c3fa1ef
Merge branch 'main' into fix-gemma4-pp
DarkLight1337 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for loading
per_layer_inputsfromintermediate_tensorsis incorrect. Sinceper_layer_inputsis an argument to theforwardmethod with a default value ofNone, the conditionif per_layer_inputs is not None:will evaluate toFalseon all pipeline ranks greater than 0 (where it is not explicitly passed by the caller). This prevents the model from loading the per-layer embeddings sent from the previous rank, effectively disabling PLE on those ranks.Additionally,
IntermediateTensorsdoes not implement a.get()method (which is likely why the previous code was changed), so you should access the underlying.tensorsdictionary to safely retrieve the optional key.