Handle exception when importing RetroGPTChunkDatasets
State: closed | Pull request: yes
Labels: name: NLP

name: Run CICD

# 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](https://github.com/facebookresearch/faiss/issues/3936) 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

```python
# 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](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
- [ ] 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](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md) contains specific people who can review PRs to various areas.

# Additional Information
* Related to # (issue)


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

wait, need to resolve a confict

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

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

> @ko3n1g Any idea what the secret baseline update is about?

I have a bunch what’s going on. I’ll send a fix tmrw 

@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!

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

<!-- pylint-output-strict-mode-false -->

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!

@thomasdhc CICD finished, looks good to merge