-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add Mcore DistributedDataParallel and distributed optimizer into Nemo #9034
Add Mcore DistributedDataParallel and distributed optimizer into Nemo #9034
Conversation
Signed-off-by: Gao Deng <gdeng@nvidia.com>
for more information, see https://pre-commit.ci
…com/gdengk/NeMo into gao/moe/nemo_mcore_dist_optim_part1
nemo/collections/nlp/models/language_modeling/megatron_base_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py
Outdated
Show resolved
Hide resolved
nemo/collections/nlp/models/language_modeling/megatron_base_model.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've confirmed this gives the same results as mcore (1353) with EP=2 NGPUS=2 GBS=8; so I think it's good to go from my side. Thank you.
|
Signed-off-by: Gao Deng <gdeng@nvidia.com>
from megatron.core.utils import ( | ||
drain_embedding_wgrad_compute, | ||
get_model_config, | ||
init_method_normal, | ||
scaled_init_method_normal, | ||
) |
Check notice
Code scanning / CodeQL
Unused import Note
Import of 'scaled_init_method_normal' is not used.
@ericharper Can you trigger test? |
the tests are triggered, only need to add the "Run CICD" label |
Signed-off-by: Gao Deng <gdeng@nvidia.com>
@ericharper will the tests be re-triggered automatically after I made new changes with the CICD label? It looks like it still needs to be manually re-triggered. |
from megatron.core.optimizer import OptimizerConfig, get_megatron_optimizer | ||
from megatron.core.utils import get_model_config | ||
|
||
HAVE_MEGATRON_CORE = True |
Check notice
Code scanning / CodeQL
Unused global variable Note
|
||
except (ImportError, ModuleNotFoundError): | ||
|
||
HAVE_MEGATRON_CORE = False |
Check notice
Code scanning / CodeQL
Unused global variable Note
Signed-off-by: Gao Deng <gdeng@nvidia.com>
…NVIDIA#9034) * merge mcore dist optim Signed-off-by: Gao Deng <gdeng@nvidia.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clean up Signed-off-by: Gao Deng <gdeng@nvidia.com> * address comments Signed-off-by: Gao Deng <gdeng@nvidia.com> * fix import and CodeQL comments Signed-off-by: Gao Deng <gdeng@nvidia.com> * remove two type check Signed-off-by: Gao Deng <gdeng@nvidia.com> --------- Signed-off-by: Gao Deng <gdeng@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Harper <complex451@gmail.com>
What does this PR do ?
Add Mcore DistributedDataParallel and distributed optimizer into Nemo
examples/nlp/language_modeling/megatron_gpt_pretraining.py
Changelog
mcore_distributed_optim
to turn on mcore distributed optimizer and a few other mcore related flags (details in next section).Usage
Jenkins CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
There's no need to comment
jenkins
on the PR to trigger Jenkins CI.The GitHub Actions CI will run automatically when the PR is opened.
To run CI on an untrusted fork, a NeMo user with write access must 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