Deprecate old preemption callback
State: closed | Pull request: yes
Labels: name: stale

# What does this PR do ?

There are 2 nearly equivalent classes for handling preemption. This PR adds a deprecation warning for the older version
Old: https://github.com/NVIDIA/NeMo/blob/main/nemo/utils/callbacks/preemption.py
New: https://github.com/NVIDIA/NeMo/blob/main/nemo/lightning/pytorch/callbacks/preemption.py

**Collection**: N/A

# Changelog 
Deprecate old preemption callback

# 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)


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

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

---

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

```

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

---

Thank you for improving NeMo's documentation!

This is used in exp_manager in 1.0 codepath. Can we update the import in this PR to ensure 1.0 codepath still works as intended?

<!-- 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.lightning.pytorch.callbacks.preemption
nemo/lightning/pytorch/callbacks/preemption.py:50:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/pytorch/callbacks/preemption.py:55:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/pytorch/callbacks/preemption.py:62:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/pytorch/callbacks/preemption.py:66:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/pytorch/callbacks/preemption.py:103:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/lightning/pytorch/callbacks/preemption.py:112:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.utils.callbacks.preemption
nemo/utils/callbacks/preemption.py:26:0: C0301: Line too long (157/119) (line-too-long)
nemo/utils/callbacks/preemption.py:31:0: C0301: Line too long (160/119) (line-too-long)
nemo/utils/callbacks/preemption.py:34:0: C0301: Line too long (137/119) (line-too-long)
nemo/utils/callbacks/preemption.py:58:0: C0301: Line too long (122/119) (line-too-long)
nemo/utils/callbacks/preemption.py:68:0: C0301: Line too long (122/119) (line-too-long)
nemo/utils/callbacks/preemption.py:46:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/callbacks/preemption.py:85:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/callbacks/preemption.py:89:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/callbacks/preemption.py:103:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.utils.exp_manager
nemo/utils/exp_manager.py:354:0: C0301: Line too long (120/119) (line-too-long)
nemo/utils/exp_manager.py:379:0: C0301: Line too long (124/119) (line-too-long)
nemo/utils/exp_manager.py:383:0: C0301: Line too long (122/119) (line-too-long)
nemo/utils/exp_manager.py:388:0: C0301: Line too long (127/119) (line-too-long)
nemo/utils/exp_manager.py:402:0: C0301: Line too long (120/119) (line-too-long)
nemo/utils/exp_manager.py:409:0: C0301: Line too long (120/119) (line-too-long)
nemo/utils/exp_manager.py:410:0: C0301: Line too long (126/119) (line-too-long)
nemo/utils/exp_manager.py:412:0: C0301: Line too long (136/119) (line-too-long)
nemo/utils/exp_manager.py:414:0: C0301: Line too long (139/119) (line-too-long)
nemo/utils/exp_manager.py:424:0: C0301: Line too long (123/119) (line-too-long)
nemo/utils/exp_manager.py:425:0: C0301: Line too long (128/119) (line-too-long)
nemo/utils/exp_manager.py:426:0: C0301: Line too long (132/119) (line-too-long)
nemo/utils/exp_manager.py:427:0: C0301: Line too long (127/119) (line-too-long)
nemo/utils/exp_manager.py:515:0: C0301: Line too long (122/119) (line-too-long)
nemo/utils/exp_manager.py:603:0: C0301: Line too long (208/119) (line-too-long)
nemo/utils/exp_manager.py:604:0: C0301: Line too long (230/119) (line-too-long)
nemo/utils/exp_manager.py:606:0: C0301: Line too long (178/119) (line-too-long)
nemo/utils/exp_manager.py:643:0: C0301: Line too long (136/119) (line-too-long)
nemo/utils/exp_manager.py:778:0: C0301: Line too long (121/119) (line-too-long)
nemo/utils/exp_manager.py:786:0: C0301: Line too long (156/119) (line-too-long)
nemo/utils/exp_manager.py:833:0: C0301: Line too long (141/119) (line-too-long)
nemo/utils/exp_manager.py:841:0: C0301: Line too long (152/119) (line-too-long)
nemo/utils/exp_manager.py:1111:0: C0301: Line too long (142/119) (line-too-long)
nemo/utils/exp_manager.py:1135:0: C0301: Line too long (154/119) (line-too-long)
nemo/utils/exp_manager.py:1201:0: C0301: Line too long (120/119) (line-too-long)
nemo/utils/exp_manager.py:1220:0: C0301: Line too long (123/119) (line-too-long)
nemo/utils/exp_manager.py:1246:0: C0301: Line too long (121/119) (line-too-long)
nemo/utils/exp_manager.py:92:0: C0115: Missing class docstring (missing-class-docstring)
nemo/utils/exp_manager.py:107:0: C0115: Missing class docstring (missing-class-docstring)
nemo/utils/exp_manager.py:133:0: C0115: Missing class docstring (missing-class-docstring)
nemo/utils/exp_manager.py:142:0: C0115: Missing class docstring (missing-class-docstring)
nemo/utils/exp_manager.py:151:0: C0115: Missing class docstring (missing-class-docstring)
nemo/utils/exp_manager.py:162:0: C0115: Missing class docstring (missing-class-docstring)
nemo/utils/exp_manager.py:275:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:278:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:281:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:284:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:287:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:290:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:293:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:296:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:334:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:337:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:340:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:343:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:1127:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:1228:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:1247:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:1250:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/utils/exp_manager.py:1266:0: C0116: Missing function or method docstring (missing-function-docstring)

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