Add mcore spec for full TE TransformerLayer#8316
Closed
jbaczek wants to merge 17 commits intoNVIDIA-NeMo:mainfrom
Closed
Add mcore spec for full TE TransformerLayer#8316jbaczek wants to merge 17 commits intoNVIDIA-NeMo:mainfrom
jbaczek wants to merge 17 commits intoNVIDIA-NeMo:mainfrom
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
Collaborator
|
jenkins |
ShriyaRishab
reviewed
Feb 2, 2024
| ) | ||
| torch.distributed.barrier() | ||
| counts = torch.cuda.LongTensor([1]) | ||
| torch.distributed.all_reduce(counts, group=parallel_state.get_data_parallel_group(with_context_parallel=True)) |
Collaborator
There was a problem hiding this comment.
Please separate context_parallel changes from the full TE spec changes to make review easier.
minitu
reviewed
Feb 2, 2024
| 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? |
Collaborator
There was a problem hiding this comment.
Suggested change
| ub_tp_comm_overlap=config.tp_comm_overlap, # TODO: ub_tp_comm_overlap? | |
| ub_tp_comm_overlap=config.tp_comm_overlap, |
minitu
reviewed
Feb 2, 2024
|
|
||
| self.mcore_gpt = cfg.get('mcore_gpt', False) | ||
| self.spec_name = cfg.get('name', '') | ||
| if cfg.get('fp8', False): |
Collaborator
There was a problem hiding this comment.
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>
Comment on lines
+19
to
+23
| from nemo.collections.nlp.modules.common.megatron.utils import ( | ||
| ApexGuardDefaults, | ||
| init_method_normal, | ||
| scaled_init_method_normal, | ||
| ) |
Check notice
Code scanning / CodeQL
Unused import
|
|
||
| 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
| "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
Collaborator
Author
|
Closing this one in favour of #8328 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thisJenkins CI
To run Jenkins, a NeMo User with write access must comment
jenkinson 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