Move Megatron-FSDP MixedPrecisionPolicy arguments from FSDP adapter t…#3903
Move Megatron-FSDP MixedPrecisionPolicy arguments from FSDP adapter t…#3903cspades wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
173b7c4 to
1d55b0c
Compare
| to minimize the registration time. | ||
| """ | ||
|
|
||
| megatron_fsdp_main_params_dtype: Optional[torch.dtype] = torch.float32 |
There was a problem hiding this comment.
why not just add a MixedPrecisionPolicy field instead of duplicating?
There was a problem hiding this comment.
Good question! MixedPrecisionPolicy also works without Megatron, i.e. the fully_shard API that native Torch users and NeMo Automodel can use without installing anything. PyPI: https://pypi.org/project/megatron-fsdp/
Nesting that dataclass in the DDPConfig as well as using it as a standalone config can be quite confusing. The only reason I'm even including these arguments into DDPConfig is because of Megatron-Bridge conventions, and prefer not to make it more complicated. One complexity is obvious - that users will need to import Megatron-FSDP sub-modules (megatron_fsdp.MixedPrecisionPolicy) just to use the DDPConfig, not needed and possibly circular.
…o DDPConfig. Signed-off-by: Cory Ye <cye@nvidia.com>
213b912 to
baf59f1
Compare
…o DDPConfig.
What does this PR do ?
Bug-Fixes
tritonimports were not guarded and was breaking the CI.Testing
hasattr(args, f.name) == True), unit tests test the same things.Contribution process
Pre-checks
Code review
Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
.github/CODEOWNERS.Final Review might get declined if these requirements are not fulfilled.
Step 2: Final Review
For PRs that change
megatron/core, once all expert reviewers have approved, theFinal Reviewlabel is applied automatically and final reviewers are assigned.For PRs outside
megatron/core, this step is skipped.Step 3: Approved
Once all required reviewers have approved, the
Approvedlabel is applied automatically.Merge
Any member of mcore-engineers will be able to merge your PR.
For MRs into `dev` branch
The proposed review process for `dev` branch is under active discussion.MRs are mergable after one approval by either
eharper@nvidia.comorzijiey@nvidia.com.