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

Aligner/nemotron5 #11264

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft

Aligner/nemotron5 #11264

wants to merge 27 commits into from

Conversation

arendu
Copy link
Collaborator

@arendu arendu commented Nov 12, 2024

What does this PR do ?

place to make all changes to support nemotron5 training
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)

JRD971000 and others added 10 commits November 4, 2024 14:41
Signed-off-by: JRD971000 <JRD971000@users.noreply.github.com>
Signed-off-by: JRD971000 <JRD971000@users.noreply.github.com>
Signed-off-by: JRD971000 <JRD971000@users.noreply.github.com>
Signed-off-by: JRD971000 <JRD971000@users.noreply.github.com>
@github-actions github-actions bot added the NLP label Nov 12, 2024
Signed-off-by: adithyare <adithyare@nvidia.com>
arendu and others added 2 commits November 12, 2024 20:23
Signed-off-by: arendu <arendu@users.noreply.github.com>
Signed-off-by: adithyare <adithyare@nvidia.com>
if dist_ckpt_args.spec is not None:
mamba_stack_spec = import_module(dist_ckpt_args.spec)
else:
raise ("You must provide a valid Mamba layer spec!")

Check failure

Code scanning / CodeQL

Illegal raise Error

Illegal class 'str' raised; will result in a TypeError being raised instead.
@@ -165,30 +421,47 @@
nemo_config.model.tokenizer.library = tokenizer_library
nemo_config.model.tokenizer.type = tokenizer_type
nemo_config.model.tokenizer.model = tokenizer_model

nemo_config.model.tokenizer.vocab_file = tokenizer_vocab

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'tokenizer_vocab' may be used before it is initialized.

nemo_config.model.tokenizer.vocab_file = tokenizer_vocab
if args.source_dist_ckpt:
nemo_config.model.kv_channels = dist_ckpt_args.kv_channels

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'dist_ckpt_args' may be used before it is initialized.
nemo_model_from_pyt.save_to(args.output_path)
nemo_model = nemo_model.to(dtype=dtype)
if args.check_fwd_pass:
assert mcore_model is not None

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'mcore_model' may be used before it is initialized.
arendu and others added 3 commits November 12, 2024 12:30
Signed-off-by: adithyare <adithyare@nvidia.com>
Signed-off-by: arendu <arendu@users.noreply.github.com>
)
Utils.inited = True

except:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
)
Utils.inited = True

except:

Check notice

Code scanning / CodeQL

Except block handles 'BaseException' Note

Except block directly handles BaseException.
gshennvm and others added 8 commits November 13, 2024 12:41
Signed-off-by: Gerald Shen <geshen@nvidia.com>
Signed-off-by: adithyare <adithyare@nvidia.com>
Signed-off-by: Ali Taghibakhshi <71892896+JRD971000@users.noreply.github.com>
Signed-off-by: arendu <adithya.r@gmail.com>
Signed-off-by: arendu <arendu@users.noreply.github.com>
Signed-off-by: adithyare <adithyare@nvidia.com>
@@ -13,6 +13,8 @@
# limitations under the License.

import torch
import torch.nn.functional as F
from omegaconf import open_dict

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'open_dict' is not used.
arendu and others added 2 commits November 14, 2024 21:35
Signed-off-by: arendu <adithya.r@gmail.com>
Signed-off-by: arendu <arendu@users.noreply.github.com>
Copy link
Contributor

beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base.


Your code was analyzed with PyLint. The following annotations have been identified:

************* Module nemo.collections.common.tokenizers.tiktoken_tokenizer
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:66:0: C0301: Line too long (270/119) (line-too-long)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:152:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:208:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:212:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:216:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:220:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:224:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:228:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/common/tokenizers/tiktoken_tokenizer.py:232:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.collections.nlp.data.language_modeling.megatron.gpt_sft_chat_dataset
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:116:0: C0301: Line too long (144/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:147:0: C0301: Line too long (132/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:156:0: C0301: Line too long (165/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:177:0: C0301: Line too long (169/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:240:0: C0301: Line too long (124/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:59:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:182:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/data/language_modeling/megatron/gpt_sft_chat_dataset.py:307:0: C0115: Missing class docstring (missing-class-docstring)
************* Module nemo.collections.nlp.models.language_modeling.megatron_base_model
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:103:0: C0301: Line too long (149/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:111:0: C0301: Line too long (134/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:252:0: C0301: Line too long (125/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:270:0: C0301: Line too long (120/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:345:0: C0301: Line too long (133/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:601:0: C0301: Line too long (123/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:656:0: C0301: Line too long (153/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:828:0: C0301: Line too long (122/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:956:0: C0301: Line too long (121/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:975:0: C0301: Line too long (136/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1092:0: C0301: Line too long (195/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1149:0: C0301: Line too long (135/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1197:0: C0301: Line too long (120/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1280:0: C0301: Line too long (128/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:329:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:460:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:465:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:694:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:746:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:917:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1021:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1255:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1286:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1290:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_base_model.py:1294:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.collections.nlp.models.language_modeling.megatron_mamba_model
nemo/collections/nlp/models/language_modeling/megatron_mamba_model.py:44:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron_mamba_model.py:17:0: W0611: Unused open_dict imported from omegaconf (unused-import)
nemo/collections/nlp/models/language_modeling/megatron_mamba_model.py:25:4: W0611: Unused import mamba_ssm (unused-import)
************* Module scripts.checkpoint_converters.convert_mamba2_pyt_to_nemo
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:50:0: C0301: Line too long (133/119) (line-too-long)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:55:0: C0301: Line too long (124/119) (line-too-long)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:63:0: C0301: Line too long (133/119) (line-too-long)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:76:0: C0301: Line too long (218/119) (line-too-long)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:69:0: C0116: Missing function or method docstring (missing-function-docstring)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:116:4: C0115: Missing class docstring (missing-class-docstring)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:124:8: C0116: Missing function or method docstring (missing-function-docstring)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:151:8: C0116: Missing function or method docstring (missing-function-docstring)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:164:8: C0116: Missing function or method docstring (missing-function-docstring)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:172:8: C0116: Missing function or method docstring (missing-function-docstring)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:192:0: C0116: Missing function or method docstring (missing-function-docstring)
scripts/checkpoint_converters/convert_mamba2_pyt_to_nemo.py:302:0: C0116: Missing function or method docstring (missing-function-docstring)

-----------------------------------
Your code has been rated at 9.54/10

Thank you for improving NeMo's documentation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants