Draft: Fabric fixes
State: closed | Pull request: yes
Labels: name: stale

# What does this PR do ?

This PR enables fabric by:
1. fixes pre_training and fine_tuning so they don't depend on a trainer
2. fixes the setup method in the fabric class

**Collection**: [Note which collection this PR will affect]
LLM

# Changelog 
- Add specific line by line info of high level changes in this PR.

# 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**:
- [x] New Feature
- [x] 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)


<!-- 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.llm.gpt.data.fine_tuning
nemo/collections/llm/gpt/data/fine_tuning.py:37:0: C0301: Line too long (123/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:43:0: C0301: Line too long (121/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:47:0: C0301: Line too long (130/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:49:0: C0301: Line too long (127/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:51:0: C0301: Line too long (121/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:52:0: C0301: Line too long (126/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:55:0: C0301: Line too long (123/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:102:0: C0301: Line too long (133/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:103:0: C0301: Line too long (141/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:104:0: C0301: Line too long (157/119) (line-too-long)
nemo/collections/llm/gpt/data/fine_tuning.py:95:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:107:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:120:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:142:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:151:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:160:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:193:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:197:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:209:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:213:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/fine_tuning.py:26:0: W0611: Unused logging imported from nemo.utils (unused-import)
************* Module nemo.collections.llm.gpt.data.pre_training
nemo/collections/llm/gpt/data/pre_training.py:136:0: C0301: Line too long (140/119) (line-too-long)
nemo/collections/llm/gpt/data/pre_training.py:137:0: C0301: Line too long (145/119) (line-too-long)
nemo/collections/llm/gpt/data/pre_training.py:138:0: C0301: Line too long (137/119) (line-too-long)
nemo/collections/llm/gpt/data/pre_training.py:427:0: C0301: Line too long (124/119) (line-too-long)
nemo/collections/llm/gpt/data/pre_training.py:434:0: C0301: Line too long (133/119) (line-too-long)
nemo/collections/llm/gpt/data/pre_training.py:49:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/pre_training.py:60:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/pre_training.py:231:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/pre_training.py:343:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/pre_training.py:346:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/pre_training.py:349:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/llm/gpt/data/pre_training.py:368:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.lightning.fabric.fabric
nemo/lightning/fabric/fabric.py:33:0: C0115: Missing class docstring (missing-class-docstring)
nemo/lightning/fabric/fabric.py:136:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/fabric/fabric.py:149:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/fabric/fabric.py:170:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/fabric/fabric.py:180:0: C0115: Missing class docstring (missing-class-docstring)
nemo/lightning/fabric/fabric.py:17:0: W0611: Unused TYPE_CHECKING imported from typing (unused-import)
nemo/lightning/fabric/fabric.py:17:0: W0611: Unused List imported from typing (unused-import)
nemo/lightning/fabric/fabric.py:17:0: W0611: Unused Sequence imported from typing (unused-import)
nemo/lightning/fabric/fabric.py:24:0: W0611: Unused DataLoader imported from torch.utils.data (unused-import)

-----------------------------------
Your code has been rated at 8.81/10
```

---

Thank you for improving NeMo's documentation!

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

This PR was closed because it has been inactive for 7 days since being marked as stale.