Wrappers that facilitate enabling training job telemetry for a set of supported training frameworks.
Low maintenance activity. Last release 13 months ago. Weaker on recent releases and release cadence.
pip install nv-one-logger-pytorch-lightning-integrationPytorch Lightning Integration
one_logger_pytorch_lightning_integration library provides an easy way to add telemetry to applications that use Pytorch Lightning for training.
The integration works by using Lightning's callback mechanism.
Given that the Lightning's callback API doesn't support everything we need, the one_logger_pytorch_lightning_integration library supplements
the Lightning callback mechanism to ensure we support async checkpointing and some app lifecycle events not supported by Lightning callback API.
Minmum Requirements
pythonversion>= 3.9, < 3.14.torchversion>= 2.8.0.pytorch-lightningversion>=2.5.3.
Integrate nv-one-logger to PTL application via hook_trainer_cls
hook_trainer_cls adds telemetry hooks to your Trainer.
Using this method, several of the training events will be automatically captured. However, you still need to explicitly call the one logger API for other events. See explicit vs implicit section for more details.
TrainingTelemetryProvider.instance().with_base_config(config).with_exporter(exporter).configure_provider()
...
HookedTrainer, nv_one_logger_callback = hook_trainer_cls(Trainer, TrainingTelemetryProvider.instance())
# Instantiate using "HookedTrainer" passing it the same parameters you would pass to the regular Lightning Trainer.
HookedTrainer = HookedTrainer(
max_epochs=NUM_EPOCHS,
limit_train_batches=NUM_TRAIN_BATCHES,
limit_val_batches=NUM_VAL_BATCHES,
devices=NUM_DEVICES,
# No need to pass one logger callback. This will be added automatically.
# You can pass other callbacks that you need.
callbacks=[...],
....
)
# You can now use the "trainer" instance the same way you use a regular lightning trainer.
...
# You can also use the returned callback from hook_trainer_clas (or get it via the "nv_one_logger_callback" propery of the trainer)
# to invoke on_xxx methods that are not part of the Lightning Callback interface such as "on_model_init_start", on_model_init_end,
# on_dataloader_init_start, etc.
# Note that nv_one_logger_callback == trainer.nv_one_logger_callback
nv_one_logger_callback.on_app_end()
Explicit vs Implicit Telemetry Collection
As mentioned above, thanks to integration with the built-in , when your code calls , several training-related spans (e.g., training loop, training iterations, validation iterations, etc) are captured and reported to NV one logger training telemetry (without the need for you to write any extra code).