Skip to content

Ss/neptune scale integration #1

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

Merged
merged 4 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ trainer = Trainer(logger=loggers.MLFlowLogger())
# neptune
trainer = Trainer(logger=loggers.NeptuneLogger())

# neptune scale
trainer = Trainer(logger=loggers.NeptuneScaleLogger())

# ... and dozens more
```

Expand Down
4 changes: 3 additions & 1 deletion docs/source-pytorch/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def _load_py_module(name: str, location: str) -> ModuleType:
# TODO: these are missing objects.inv
# "comet_ml": ("https://www.comet.com/docs/v2/", None),
# "neptune": ("https://docs.neptune.ai/", None),
# "neptune scale": ("https://docs-beta.neptune.ai/", None),
# "wandb": ("https://docs.wandb.ai//", None),
}
nitpicky = True
Expand Down Expand Up @@ -476,6 +477,7 @@ def _load_py_module(name: str, location: str) -> ModuleType:
("py:meth", "move_data_to_device"),
("py:class", "neptune.Run"),
("py:class", "neptune.handler.Handler"),
("py:class", "neptune_scale.Run"),
("py:meth", "on_after_batch_transfer"),
("py:meth", "on_before_batch_transfer"),
("py:meth", "on_save_checkpoint"),
Expand Down Expand Up @@ -620,7 +622,7 @@ def package_list_from_file(file):
from lightning.pytorch.cli import _JSONARGPARSE_SIGNATURES_AVAILABLE as _JSONARGPARSE_AVAILABLE
from lightning.pytorch.utilities.imports import _TORCHVISION_AVAILABLE
from lightning.fabric.loggers.tensorboard import _TENSORBOARD_AVAILABLE, _TENSORBOARDX_AVAILABLE
from lightning.pytorch.loggers.neptune import _NEPTUNE_AVAILABLE
from lightning.pytorch.loggers.neptune import _NEPTUNE_AVAILABLE, _NEPTUNE_SCALE_AVAILABLE
from lightning.pytorch.loggers.comet import _COMET_AVAILABLE
from lightning.pytorch.loggers.mlflow import _MLFLOW_AVAILABLE
from lightning.pytorch.loggers.wandb import _WANDB_AVAILABLE
Expand Down
37 changes: 37 additions & 0 deletions docs/source-pytorch/visualize/supported_exp_managers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,43 @@ Here's the full documentation for the :class:`~lightning.pytorch.loggers.Neptune

----

Neptune Scale
==========
To use `Neptune Scale <https://docs-beta.neptune.ai/>`_ first install the neptune-scale package:

.. code-block:: bash

pip install neptune-scale


Configure the logger and pass it to the :class:`~lightning.pytorch.trainer.trainer.Trainer`:

.. testcode::
:skipif: not _NEPTUNE_SCALE_AVAILABLE

from neptune_scale import Run
from lightning.pytorch.loggers import NeptuneScaleLogger

neptune_scale_logger = NeptuneScaleLogger(
api_key=<YOUR_NEPTUNE_SCALE_API_KEY>, # replace with your own
project="common/pytorch-lightning-integration", # format "<WORKSPACE/PROJECT>"
)
trainer = Trainer(logger=neptune_scale_logger)

Access the Neptune Scale logger from any function (except the LightningModule *init*) to use its API for tracking advanced artifacts
Copy link

Choose a reason for hiding this comment

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

issue: Clarify logger vs. run

The documentation should refer to accessing the Neptune Scale run, not the logger. The logger is passed to the Trainer, while the run is obtained via logger.experiment.


.. code-block:: python

class LitModel(LightningModule):
def any_lightning_module_function_or_hook(self):
neptune_scale_logger = self.logger.experiment
neptune_scale_logger.log_metrics(data={"path/to/metadata": metadata}, step=step)
neptune_scale_logger.log_configs(data={"path/to/config": config})

Here's the full documentation for the :class:`~lightning.pytorch.loggers.NeptuneScaleLogger`.
Copy link

Choose a reason for hiding this comment

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

issue: Missing link to full documentation

The documentation promises a link to the full documentation for the NeptuneScaleLogger but doesn't provide one. Please add the appropriate link.


----

Tensorboard
===========
`TensorBoard <https://pytorch.org/docs/stable/tensorboard.html>`_ can be installed with:
Expand Down
1 change: 1 addition & 0 deletions requirements/pytorch/loggers.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# all supported loggers. this list is here as a reference, but they are not installed in CI

neptune >=1.0.0
neptune-scale
comet-ml >=3.31.0
mlflow >=1.0.0
wandb >=0.12.10
Expand Down
9 changes: 9 additions & 0 deletions src/lightning/pytorch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
-


---

## [unreleased] - 2025-03-31

### Added

- Add support for Neptune Scale logger ([#20686](https://github.com/Lightning-AI/pytorch-lightning/pull/20686))


---

## [2.5.1] - 2025-03-18
Expand Down
13 changes: 11 additions & 2 deletions src/lightning/pytorch/loggers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@
from lightning.pytorch.loggers.csv_logs import CSVLogger
from lightning.pytorch.loggers.logger import Logger
from lightning.pytorch.loggers.mlflow import MLFlowLogger
from lightning.pytorch.loggers.neptune import NeptuneLogger
from lightning.pytorch.loggers.neptune import NeptuneLogger, NeptuneScaleLogger
from lightning.pytorch.loggers.tensorboard import TensorBoardLogger
from lightning.pytorch.loggers.wandb import WandbLogger

__all__ = ["CometLogger", "CSVLogger", "Logger", "MLFlowLogger", "TensorBoardLogger", "WandbLogger", "NeptuneLogger"]
__all__ = [
"CometLogger",
"CSVLogger",
"Logger",
"MLFlowLogger",
"TensorBoardLogger",
"WandbLogger",
"NeptuneLogger",
"NeptuneScaleLogger",
]
Loading