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

Add attention_bias argument in transformer block and transformer layer modules, addressing change in MCore #11289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yaoyu-33
Copy link
Collaborator

What does this PR do ?

https://gitlab-master.nvidia.com/ADLR/megatron-lm/-/merge_requests/2293
we need to fix all occurances in NeMo where TransformerBlock is using a non-mcore TransformerLayer. Otherwise the forward interface between Block and Layer will not match anymore and so NeMo will break

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)

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@github-actions github-actions bot added the NLP label Nov 14, 2024
Copy link
Contributor

beep boop 🤖: 🚨 The following files must be fixed before merge!


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

************* Module nemo.collections.vlm.mllama.model.vision
nemo/collections/vlm/mllama/model/vision.py:621:0: C0301: Line too long (135/119) (line-too-long)
nemo/collections/vlm/mllama/model/vision.py:61:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:115:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:139:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:167:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:318:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:326:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/mllama/model/vision.py:342:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:398:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/mllama/model/vision.py:417:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:488:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/vlm/mllama/model/vision.py:559:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:570:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/vlm/mllama/model/vision.py:581:4: C0116: Missing function or method docstring (missing-function-docstring)

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

Thank you for improving NeMo's documentation!

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.nlp.models.language_modeling.megatron.bert.bert_model
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:82:0: C0301: Line too long (121/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:70:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:128:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:144:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:177:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:184:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:202:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:296:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:306:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:335:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/models/language_modeling/megatron/bert/bert_model.py:570:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.collections.nlp.models.language_modeling.megatron.falcon.falcon_decoder_layer
nemo/collections/nlp/models/language_modeling/megatron/falcon/falcon_decoder_layer.py:70:0: C0301: Line too long (149/119) (line-too-long)
nemo/collections/nlp/models/language_modeling/megatron/falcon/falcon_decoder_layer.py:102:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/falcon/falcon_decoder_layer.py:18:4: W0611: Unused parallel_state imported from megatron.core (unused-import)
nemo/collections/nlp/models/language_modeling/megatron/falcon/falcon_decoder_layer.py:19:4: W0611: Unused ShardedObject imported from megatron.core.dist_checkpointing.mapping (unused-import)
nemo/collections/nlp/models/language_modeling/megatron/falcon/falcon_decoder_layer.py:19:4: W0611: Unused ShardedTensor imported from megatron.core.dist_checkpointing.mapping (unused-import)
************* Module nemo.collections.nlp.models.language_modeling.megatron.gpt_full_te_layer_autocast_spec
nemo/collections/nlp/models/language_modeling/megatron/gpt_full_te_layer_autocast_spec.py:51:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/models/language_modeling/megatron/gpt_full_te_layer_autocast_spec.py:147:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/gpt_full_te_layer_autocast_spec.py:179:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/models/language_modeling/megatron/gpt_full_te_layer_autocast_spec.py:303:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/models/language_modeling/megatron/gpt_full_te_layer_autocast_spec.py:336:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.collections.nlp.modules.common.megatron.adapters.mcore_mixins
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:141:0: C0301: Line too long (120/119) (line-too-long)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:143:0: C0301: Line too long (147/119) (line-too-long)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:60:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:69:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:76:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:109:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:227:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:327:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:353:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:437:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:444:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:468:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:475:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:493:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/megatron/adapters/mcore_mixins.py:500:4: C0116: Missing function or method docstring (missing-function-docstring)

-----------------------------------
Your code has been rated at 9.42/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.

2 participants