[PyTorch] Refactor parameter splitting in Linear and LayerNormLinear #590
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
TransformerLayer
doesn'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_split
inLinear
because it currently expects the split names to have exactly one underscore at the end (somysplit
andmy_split_
would both fail).I think this is a good opportunity to refactor this logic:
_weight
or_bias
, resulting in parameter names likeq_weight
, etc.noop_cat
operation so it is independent from the TE modules.Closes #533.