-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Enable MCore v0.14 checkpoint formats #14428
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
base: main
Are you sure you want to change the base?
Enable MCore v0.14 checkpoint formats #14428
Conversation
Signed-off-by: Mikołaj Błaż <[email protected]> # Conflicts: # nemo/lightning/pytorch/strategies/megatron_strategy.py
Signed-off-by: mikolajblaz <[email protected]> Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: mikolajblaz <[email protected]> Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: mikolajblaz <[email protected]> Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
@@ -67,3 +91,24 @@ | |||
checkpoint = {"other": 123} | |||
strategy.load_model_state_dict(checkpoint) | |||
strategy.optimizers[0].reload_model_params.assert_called_once_with(checkpoint) | |||
|
|||
def test_sharded_state_dict_metadata(self): | |||
strategy = MegatronStrategy(ckpt_save_pre_mcore_014=False, ckpt_parallel_save_optim=True) |
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning test
redefined
Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
|
||
def test_init_errors(self): | ||
with pytest.raises(ValueError): | ||
strategy = MegatronStrategy(ddp="pytorch", fsdp="fsdp") |
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning test
redefined
strategy = MegatronStrategy(ddp="pytorch", fsdp="fsdp") | ||
|
||
with pytest.raises(ValueError): | ||
strategy = MegatronStrategy(ddp="test") |
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning test
redefined
strategy = MegatronStrategy(ddp="test") | ||
|
||
with pytest.raises(NotImplementedError): | ||
strategy = MegatronStrategy(fsdp="pytorch") |
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning test
redefined
|
||
ddp = DistributedDataParallelConfig(use_custom_fsdp=True) | ||
strategy = MegatronStrategy(ddp=ddp, fsdp=None) | ||
|
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning test
redefined
|
||
ddp = DistributedDataParallelConfig(use_custom_fsdp=False) | ||
strategy = MegatronStrategy(ddp=ddp, fsdp="megatron") | ||
|
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning test
redefined
|
||
with pytest.raises(ValueError): | ||
strategy = MegatronStrategy(fsdp="test") | ||
|
Check notice
Code scanning / CodeQL
Unused local variable Note test
Important
The
Update branch
button must only be pressed in very rare occassions.An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.
What does this PR do ?
Enable checkpoint formats introduced in MCore v0.14. NeMo counterpart of the "enablement MR" !3743
Collection: [Note which collection this PR will affect]
Changelog
Usage
# Add a code snippet demonstrating how to use this
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information