Skip to content
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

Mcore dist opt ckpt fix #9156

Merged
merged 12 commits into from
May 22, 2024
Merged

Mcore dist opt ckpt fix #9156

merged 12 commits into from
May 22, 2024

Conversation

akoumpa
Copy link
Member

@akoumpa akoumpa commented May 9, 2024

What does this PR do ?

Enable saving/restoring checkpoint when using mcore dist opt in NeMo.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# 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:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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

  • Related to # (issue)

@github-actions github-actions bot added the NLP label May 9, 2024
@akoumpa akoumpa force-pushed the akoumparouli/mcore_dist_opt_ckpt branch from 28b6376 to be23a09 Compare May 15, 2024 07:14
@github-actions github-actions bot added the core Changes to NeMo Core label May 15, 2024
@akoumpa akoumpa force-pushed the akoumparouli/mcore_dist_opt_ckpt branch from be23a09 to b1df810 Compare May 15, 2024 16:24
akoumpa and others added 3 commits May 16, 2024 09:43
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
@akoumpa akoumpa force-pushed the akoumparouli/mcore_dist_opt_ckpt branch from dcd692e to cb78ce9 Compare May 16, 2024 16:43
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa akoumpa force-pushed the akoumparouli/mcore_dist_opt_ckpt branch from 00f478e to 545fc51 Compare May 16, 2024 16:59
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
@akoumpa akoumpa force-pushed the akoumparouli/mcore_dist_opt_ckpt branch from 4643470 to a2d516c Compare May 17, 2024 09:11
@akoumpa akoumpa marked this pull request as ready for review May 17, 2024 09:11
@akoumpa akoumpa requested a review from mikolajblaz May 17, 2024 09:11
@akoumpa akoumpa marked this pull request as draft May 17, 2024 09:12
… ckpt

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa akoumpa force-pushed the akoumparouli/mcore_dist_opt_ckpt branch from a2d516c to 8fa988d Compare May 17, 2024 22:15
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
@akoumpa akoumpa marked this pull request as ready for review May 17, 2024 22:19
akoumpa and others added 2 commits May 21, 2024 02:23
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
dimapihtar
dimapihtar previously approved these changes May 21, 2024
Copy link
Collaborator

@dimapihtar dimapihtar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>
dimapihtar
dimapihtar previously approved these changes May 22, 2024
Co-authored-by: mikolajblaz <mikolajblaz@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>
@akoumpa akoumpa merged commit 286d387 into main May 22, 2024
17 of 133 checks passed
@akoumpa akoumpa deleted the akoumparouli/mcore_dist_opt_ckpt branch May 22, 2024 18:45
BoxiangW pushed a commit to BoxiangW/NeMo that referenced this pull request Jun 5, 2024
* Mcore dist opt ckpt fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass dp_zero_gather_scatter to starded-state-dict

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* introduce dist_ckpt_parallel_save option

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* determine sharding type from dist_ckpt_parallel_save

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* read model.disk_ckpt_parallel_save from cfg and pass it to mcore dist ckpt

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* Pass is_loading to mcore_optim.py's sharded_state_dict

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* Update nemo/core/optim/mcore_optim.py

Co-authored-by: mikolajblaz <mikolajblaz@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: mikolajblaz <mikolajblaz@users.noreply.github.com>
Signed-off-by: Boxiang Wang <boxiangw@nvidia.com>
janekl pushed a commit that referenced this pull request Jun 12, 2024
* Mcore dist opt ckpt fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass dp_zero_gather_scatter to starded-state-dict

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* introduce dist_ckpt_parallel_save option

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* determine sharding type from dist_ckpt_parallel_save

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* read model.disk_ckpt_parallel_save from cfg and pass it to mcore dist ckpt

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* Pass is_loading to mcore_optim.py's sharded_state_dict

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* Update nemo/core/optim/mcore_optim.py

Co-authored-by: mikolajblaz <mikolajblaz@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: mikolajblaz <mikolajblaz@users.noreply.github.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
* Mcore dist opt ckpt fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass dp_zero_gather_scatter to starded-state-dict

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* introduce dist_ckpt_parallel_save option

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* determine sharding type from dist_ckpt_parallel_save

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* read model.disk_ckpt_parallel_save from cfg and pass it to mcore dist ckpt

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* Pass is_loading to mcore_optim.py's sharded_state_dict

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

* Update nemo/core/optim/mcore_optim.py

Co-authored-by: mikolajblaz <mikolajblaz@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <153118171+akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: mikolajblaz <mikolajblaz@users.noreply.github.com>
@ko3n1g ko3n1g mentioned this pull request Jul 18, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to NeMo Core NLP Run CICD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants