chore(callbacks): deprecate nvitop.callbacks as officially unmaintained (#157)

This commit is contained in:
Xuehai Pan 2025-04-07 03:39:30 +08:00 committed by GitHub
parent 8e1def0349
commit 14b15ea0a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 55 additions and 5 deletions

View file

@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
-
- Deprecate `nvitop.callbacks` as officially unmaintained by [@XuehaiPan](https://github.com/XuehaiPan) in [#157](https://github.com/XuehaiPan/nvitop/pull/157).
### Fixed

View file

@ -41,7 +41,7 @@ An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for G
- [Command Line Options and Environment Variables](#command-line-options-and-environment-variables)
- [Keybindings for Monitor Mode](#keybindings-for-monitor-mode)
- [CUDA Visible Devices Selection Tool](#cuda-visible-devices-selection-tool)
- [Callback Functions for Machine Learning Frameworks](#callback-functions-for-machine-learning-frameworks)
- [Callback Functions for Machine Learning Frameworks (DEPRECATED)](#callback-functions-for-machine-learning-frameworks-deprecated)
- [Callback for TensorFlow (Keras)](#callback-for-tensorflow-keras)
- [Callback for PyTorch Lightning](#callback-for-pytorch-lightning)
- [TensorBoard Integration](#tensorboard-integration)
@ -600,7 +600,7 @@ formatting:
------
### Callback Functions for Machine Learning Frameworks
### Callback Functions for Machine Learning Frameworks (DEPRECATED)
`nvitop` provides two builtin callbacks for [TensorFlow (Keras)](https://www.tensorflow.org) and [PyTorch Lightning](https://pytorchlightning.ai).

View file

@ -1,5 +1,5 @@
nvitop.callbacks package
========================
nvitop.callbacks package (DEPRECATED)
=====================================
Submodules
----------

View file

@ -14,3 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# pylint: disable=missing-module-docstring
import warnings
warnings.warn(
f'The `{__name__}` module is deprecated '
'and will not be supported in the future. '
'Feel free to port and implement your own callback using `nvitop`.',
category=FutureWarning,
stacklevel=2,
)

View file

@ -22,6 +22,7 @@ from __future__ import annotations
import re
import time
import warnings
# pylint: disable-next=import-error,no-name-in-module
from tensorflow.python.keras.callbacks import Callback
@ -102,6 +103,14 @@ class GpuStatsLogger(Callback): # pylint: disable=too-many-instance-attributes
fan_speed: bool = False,
temperature: bool = False,
) -> None:
warnings.warn(
f'`{__name__}.{self.__class__.__name__}` is deprecated '
'and will not be supported in the future. '
'Feel free to port and implement your own callback using `nvitop`.',
category=FutureWarning,
stacklevel=2,
)
super().__init__()
try:

View file

@ -21,6 +21,7 @@
from __future__ import annotations
import time
import warnings
from typing import TYPE_CHECKING, Any
from lightning.pytorch.callbacks import Callback # pylint: disable=import-error
@ -97,6 +98,14 @@ class GpuStatsLogger(Callback): # pylint: disable=too-many-instance-attributes
fan_speed: bool = False,
temperature: bool = False,
) -> None:
warnings.warn(
f'The class `{__name__}.{self.__class__.__name__}` is deprecated '
'and will not be supported in the future. '
'Feel free to port and implement your own callback using `nvitop`.',
category=FutureWarning,
stacklevel=2,
)
super().__init__()
try:

View file

@ -21,6 +21,7 @@
from __future__ import annotations
import time
import warnings
from typing import TYPE_CHECKING, Any
from pytorch_lightning.callbacks import Callback # pylint: disable=import-error
@ -97,6 +98,14 @@ class GpuStatsLogger(Callback): # pylint: disable=too-many-instance-attributes
fan_speed: bool = False,
temperature: bool = False,
) -> None:
warnings.warn(
f'The class `{__name__}.{self.__class__.__name__}` is deprecated '
'and will not be supported in the future. '
'Feel free to port and implement your own callback using `nvitop`.',
category=FutureWarning,
stacklevel=2,
)
super().__init__()
try:

View file

@ -19,6 +19,7 @@
from __future__ import annotations
import warnings
from typing import TYPE_CHECKING
@ -34,6 +35,15 @@ if TYPE_CHECKING:
pass
warnings.warn(
f'The `{__name__}` module is deprecated '
'and will not be supported in the future. '
'Feel free to port and implement your own callback using `nvitop`.',
category=FutureWarning,
stacklevel=2,
)
def add_scalar_dict(
writer: SummaryWriter,
main_tag: str,