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

Handle exception when importing RetroGPTChunkDatasets #11415

Merged
merged 8 commits into from
Dec 5, 2024

Conversation

guyueh1
Copy link
Contributor

@guyueh1 guyueh1 commented Nov 26, 2024

What does this PR do ?

Handle exception during import of RetroGPTChunkDatasets

Collection: [Note which collection this PR will affect]

Changelog

  • Handle Exception during import to allow a graceful fallback when importing RetroGPTChunkDatasets from megatron.

Currently on arm linux platform, from megatron.core.datasets.retro.config import RetroGPTChunkDatasets fails with an exception which is a known issue with its dependency, faiss. When the exception happens, we want to gracefully fall back to the codepath without megatron retro support.

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)

thomasdhc
thomasdhc previously approved these changes Dec 2, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guyueh1
Copy link
Contributor Author

guyueh1 commented Dec 4, 2024

@JimmyZhang12 could you trigger CICD again, let's get this merged

@guyueh1
Copy link
Contributor Author

guyueh1 commented Dec 4, 2024

wait, need to resolve a confict

guyueh1 and others added 2 commits December 4, 2024 13:33
This reverts commit 21a4734.
Signed-off-by: guyueh1 <[email protected]>
@guyueh1
Copy link
Contributor Author

guyueh1 commented Dec 4, 2024

The bot pushed some changes to .secrets.baseline , not sure if that's normal; please start CICD @JimmyZhang12

@thomasdhc
Copy link
Collaborator

@ko3n1g Any idea what the secret baseline update is about?

@ko3n1g
Copy link
Collaborator

ko3n1g commented Dec 4, 2024

@ko3n1g Any idea what the secret baseline update is about?

I have a bunch what’s going on. I’ll send a fix tmrw

@thomasdhc
Copy link
Collaborator

thomasdhc commented Dec 5, 2024

@guyueh1 @ko3n1g merged in the changes to fix the secret update. Let's merge main and revert the secret change in this PR. Should be able to merge after that. Thanks!

@guyueh1
Copy link
Contributor Author

guyueh1 commented Dec 5, 2024

Reverted the commit that changed .secrets.baseline and merged main, let's see if the "Update baseline" commit comes this time

Copy link
Contributor

github-actions bot commented Dec 5, 2024

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.data.language_modeling.megatron.retro_dataset
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:68:0: C0301: Line too long (218/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:78:0: C0301: Line too long (172/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:83:0: C0301: Line too long (150/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:103:0: C0301: Line too long (140/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:113:0: C0301: Line too long (156/119) (line-too-long)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:58:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:127:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:17:0: W0611: Unused import os (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:18:0: W0611: Unused import time (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:20:0: W0611: Unused numpy imported as np (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:22:0: W0611: Unused DictConfig imported from omegaconf.dictconfig (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:24:0: W0611: Unused get_datasets_weights_and_num_samples imported from nemo.collections.nlp.data.language_modeling.megatron.base_dataset_utils (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:24:0: W0611: Unused get_train_valid_test_split_ imported from nemo.collections.nlp.data.language_modeling.megatron.base_dataset_utils (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:28:0: W0611: Unused BlendableDataset imported from nemo.collections.nlp.data.language_modeling.megatron.blendable_dataset (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:29:0: W0611: Unused deallocate_indexed_dataset_memory imported from nemo.collections.nlp.data.language_modeling.megatron.indexed_dataset (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:30:0: W0611: Unused make_dataset imported from nemo.collections.nlp.data.language_modeling.megatron.indexed_dataset as make_indexed_dataset (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:35:4: W0611: Unused tensor_parallel imported from megatron.core (unused-import)
nemo/collections/nlp/data/language_modeling/megatron/retro_dataset.py:37:4: W0611: Unused RetroGPTChunkDatasets imported from megatron.core.datasets.retro.config (unused-import)

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

Thank you for improving NeMo's documentation!

Copy link
Collaborator

@thomasdhc thomasdhc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@guyueh1
Copy link
Contributor Author

guyueh1 commented Dec 5, 2024

@thomasdhc CICD finished, looks good to merge

@thomasdhc thomasdhc merged commit 63dd8da into NVIDIA:main Dec 5, 2024
169 of 173 checks passed
XuesongYang pushed a commit to paarthneekhara/NeMo that referenced this pull request Jan 18, 2025
* Handle exception when importing RetroGPTChunkDatasets

Signed-off-by: Guyue Huang <[email protected]>

* Update baseline

Signed-off-by: guyueh1 <[email protected]>

* Revert "Update baseline"

This reverts commit 21a4734.

* Update baseline

Signed-off-by: guyueh1 <[email protected]>

* Revert "Update baseline"

This reverts commit 8d35fcc.

---------

Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: guyueh1 <[email protected]>
Co-authored-by: guyueh1 <[email protected]>
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