[PyTorch] Refactor parameter splitting in Linear and LayerNormLinear#590
Merged
timmoon10 merged 6 commits intoNVIDIA:mainfrom Jan 8, 2024
Merged
[PyTorch] Refactor parameter splitting in Linear and LayerNormLinear#590timmoon10 merged 6 commits intoNVIDIA:mainfrom
timmoon10 merged 6 commits intoNVIDIA:mainfrom
Conversation
Remove module state from noop_cat. Support arbitrary names in parameter split. Handle tensor parallelism. Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Collaborator
Author
|
/te-ci pytorch |
Fix pylint complaints. Signed-off-by: Tim Moon <tmoon@nvidia.com>
Collaborator
Author
|
/te-ci pytorch |
Signed-off-by: Tim Moon <tmoon@nvidia.com>
cyanguwa
approved these changes
Jan 5, 2024
Collaborator
cyanguwa
left a comment
There was a problem hiding this comment.
Would these changes affect when people try to load existing checkpoints?
Collaborator
Author
|
I don't think so. The resulting param names ( |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#533 reports that
TransformerLayerdoesn't work out-of-the-box with tensor parallelism. The root cause is because the logic for parameter splitting (e.g. for QKV matrices) does not handle tensor parallelism. We've also had another user run into trouble when trying to setparameters_splitinLinearbecause it currently expects the split names to have exactly one underscore at the end (somysplitandmy_split_would both fail).I think this is a good opportunity to refactor this logic:
_weightor_bias, resulting in parameter names likeq_weight, etc.noop_catoperation so it is independent from the TE modules.Closes #533.