Support FP8 primary weight in FSDP training#1630
Merged
ksivaman merged 3 commits intoNVIDIA:mainfrom Apr 7, 2025
Merged
Conversation
422f432 to
bc4b9e9
Compare
Signed-off-by: jianbinc <shjwudp@gmail.com>
bc4b9e9 to
d14c1f0
Compare
Member
|
/te-ci pytorch L0 L1 |
ksivaman
approved these changes
Apr 7, 2025
wdykas
pushed a commit
to wdykas/TransformerEngine
that referenced
this pull request
Apr 14, 2025
Support fp8 primary weight in fsdp training Signed-off-by: jianbinc <shjwudp@gmail.com> Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com> Signed-off-by: Peter Dykas <wdykas@nvidia.com>
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.
Description
This MR modifies the
cast_master_weights_to_fp8function in the FP8 primary weight application, allowing us to use FP8 primary weight in FSDP training.In FSDP training, the model weight may be incomplete, and
model_weight._datamay be DTensor(FSDP2) or resized for parameter sharding. We cannot obtain the actual model weight shard address through the slice reading method likemodel_weight._data.view(-1)[start_offset:end_offset]. This MR extends thecast_master_weights_to_fp8function to accept the direct input of shard model weight, so that the special use of FSDP can be implemented.Type of change
Changes
Please list the changes introduced in this PR:
Checklist: