-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 spec for full TE TransformerLayer #8316
Conversation
Signed-off-by: jiemingz <jiemingz@nvidia.com> Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: jiemingz <jiemingz@nvidia.com> Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
for more information, see https://pre-commit.ci Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
This reverts commit 58d6bce. Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
…sformerLayer Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Selvaraj Anandaraj <selvaraja@login-eos01.eos.clusters.nvidia.com> Co-authored-by: Selvaraj Anandaraj <selvaraja@login-eos01.eos.clusters.nvidia.com> Co-authored-by: Layali R <31741533+layalir@users.noreply.github.com> Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
267eccd
to
d56297d
Compare
jenkins |
@@ -1330,7 +1330,7 @@ def get_samples_mapping( | |||
) | |||
torch.distributed.barrier() | |||
counts = torch.cuda.LongTensor([1]) | |||
torch.distributed.all_reduce(counts, group=parallel_state.get_data_parallel_group(with_context_parallel=True)) |
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.
Please separate context_parallel changes from the full TE spec changes to make review easier.
apply_residual_connection_post_layernorm=config.apply_residual_connection_post_layernorm, | ||
autocast_dtype=precision, | ||
#use_emha=False, # Use default 'False' | ||
ub_tp_comm_overlap=config.tp_comm_overlap, # TODO: ub_tp_comm_overlap? |
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.
ub_tp_comm_overlap=config.tp_comm_overlap, # TODO: ub_tp_comm_overlap? | |
ub_tp_comm_overlap=config.tp_comm_overlap, |
@@ -225,6 +227,8 @@ def __init__(self, cfg: DictConfig, trainer: Trainer): | |||
|
|||
self.mcore_gpt = cfg.get('mcore_gpt', False) | |||
self.spec_name = cfg.get('name', '') | |||
if cfg.get('fp8', False): |
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 believe this is an artifact from Jimmy's memory fixes (the first two commits), which are now in main.
So those changes should go away as well.
Signed-off-by: Jan Baczek <jbaczek@nvidia.com>
from nemo.collections.nlp.modules.common.megatron.utils import ( | ||
ApexGuardDefaults, | ||
init_method_normal, | ||
scaled_init_method_normal, | ||
) |
Check notice
Code scanning / CodeQL
Unused import Note
Import of 'scaled_init_method_normal' is not used.
|
||
try: | ||
from megatron.core import parallel_state, tensor_parallel | ||
from megatron.core.dist_checkpointing.utils import apply_prefix_mapping |
Check notice
Code scanning / CodeQL
Unused import Note
"TransformerEngine was not found. Please see the NeMo README for installation instructions: https://github.com/NVIDIA/NeMo#megatron-gpt." | ||
) | ||
|
||
return TransformerBlockSubmodules(layer_specs=ModuleSpec(module=TETransformerLayerAutocast)) |
Check failure
Code scanning / CodeQL
Wrong name for an argument in a class instantiation Error
ApexGuardDefaults.__init__
Closing this one in favour of #8328 |
What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
Collection: [Note which collection this PR will affect]
Changelog
Usage
# Add a code snippet demonstrating how to use this
Jenkins CI
To run Jenkins, a NeMo User with write access must comment
jenkins
on the PR.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