Registry / observability / nv-one-logger-training-telemetry

nv-one-logger-training-telemetry

JSON →
library2.3.1pypypi✓ verified 79d ago

The `nv-one-logger-training-telemetry` library provides tools for capturing and reporting training job telemetry data, integrating with the `one-logger` ecosystem. It enables standardized logging of metrics, hyperparameters, and system information for AI/ML training runs. The current version is 2.3.1 and it is part of the NVIDIA one-logger project, following its release cadence.

pip install nv-one-logger-training-telemetry
INSTALL
IMPORT
SIG · NV-ONE-LOGGER-TRAI
N
nv-one-logger-training-telemetry
observabilitypythonv2.3.1
Install
3.6s avg
Import
Disk
27MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 29.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.6s · import 0.000s · 29MB
27MB installed
● package 27MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TelemetryClient
import nv_one_logger
from nv_one_logger import TelemetryClient

This quickstart demonstrates how to initialize `TelemetryClient` with a `TelemetryConfig` and log common training data such as hyperparameters, metrics over steps, and artifact paths. It includes example environment variable usage for configurability and handles potential connection errors for backend services.

from nvtelemetry.client import TelemetryClient from nvtelemetry.config import TelemetryConfig from datetime import datetime import os # Example configuration (adjust as needed for actual usage) # In a real environment, project and run_id might be set via environment variables # or a more complex configuration management system. # Using os.environ.get for dynamic values, falling back to defaults for example project_name = os.environ.get("ONE_LOGGER_PROJECT_NAME", "my_ml_project_example") run_id = os.environ.get("ONE_LOGGER_RUN_ID", f"run_{datetime.now().strftime('%Y%m%d%H%M%S')}") config = TelemetryConfig( project=project_name, model="my_model_v1", run_id=run_id, framework="pytorch", framework_version="1.13.1", container_image="nvcr.io/nvidia/pytorch:23.05-py3", tags={ "experiment": "initial_test", "dataset": "cifar10" }, mlflow_tracking_uri=os.environ.get("ONE_LOGGER_MLFLOW_TRACKING_URI", "") # Example for MLflow backend ) try: # Initialize the client. This will connect to the configured backend (if any). with TelemetryClient(config=config) as client: print(f"Telemetry client initialized for project '{config.project}', run: {config.run_id}") # Log hyperparameters client.log_hyperparameters(learning_rate=0.001, batch_size=32, epochs=10) print("Logged hyperparameters.") # Log metrics over steps/epochs for epoch in range(3): train_loss = 0.5 - epoch * 0.05 val_loss = 0.6 - epoch * 0.08 accuracy = 0.7 + epoch * 0.03 client.log_metrics(step=epoch, train_loss=train_loss, val_loss=val_loss, accuracy=accuracy) print(f"Logged metrics for epoch {epoch}: train_loss={train_loss:.3f}, val_loss={val_loss:.3f}, accuracy={accuracy:.3f}") # Log an artifact path (this just records the path, not the artifact itself) client.log_artifact_path("model_checkpoint", "/path/to/my_model_checkpoint.pt") print("Logged artifact path.") # Log a final message client.log_message("Training run completed successfully.") print("Logged completion message.") except Exception as e: print(f"An error occurred during telemetry logging: {e}") print("Note: In a real environment, TelemetryClient might require specific endpoint configuration or environment variables (e.g., ONE_LOGGER_MLFLOW_TRACKING_URI, ONE_LOGGER_NEMO_SERVICE_URL) to connect to a telemetry backend like MLflow or NVIDIA NeMo Service. This example primarily demonstrates the API usage, and may not send data to a remote service without proper setup.")
Debug
Known issues
breakingThe `NVSessionClient` class and all `nvs_` prefixed functions were removed in `one-logger` v2.0.0 (the base project for `nvtelemetry`), replaced by `TelemetryClient`.
fix
Migrate from `NVSessionClient` to `TelemetryClient`. The new API uses `TelemetryClient` for initialization and `client.log_...` methods.
affects: >=2.0.0
breakingThe direct utility functions `nvtelemetry.config.setup_environment_config` and `config.get_environment_config` were removed/deprecated in `one-logger` v2.3.0. Configuration should now be managed directly via `TelemetryConfig` instance.
fix
Manually construct `TelemetryConfig` instances or load configuration from environment variables/files using `TelemetryConfig.from_env()` or similar patterns, rather than relying on the removed setup functions.
affects: >=2.3.0
gotchaThe `nvtelemetry` client requires a compatible telemetry backend (e.g., NVIDIA NeMo Service, ClearML, MLflow) to send data. Without proper configuration, logs might be collected locally but not sent remotely, or fail silently.
fix
Ensure environment variables like `ONE_LOGGER_PROJECT_NAME`, `ONE_LOGGER_MLFLOW_TRACKING_URI`, `ONE_LOGGER_NEMO_SERVICE_URL` are correctly set, or pass appropriate configurations directly to `TelemetryConfig` for your target backend.
affects: All versions
Upgrade
Version history
2.3.1latest on PyPI · released Oct 29, 2025
Audit
Dependencies
one-loggerrequiredCore dependency for logging infrastructure and backend integration.
pydanticrequiredUsed for data validation and settings management, specifically for TelemetryConfig.
nv-context-taggerrequiredUsed for adding context tags to telemetry events.
protobufrequiredUsed for data serialization of telemetry messages.
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
2
Resources
nv-one-logger-training-telemetry — pip install nv-one-logger-training-telemetry · libregistry