Registry / ai-ml / nvidia-resiliency-ext

nvidia-resiliency-ext

JSON →
library0.6.0pypypi✓ verified 83d ago

NVIDIA Resiliency Extension (NVRE) is a Python package that provides fault-tolerant features for framework developers and users, aiming to minimize downtime in deep learning training due to failures and interruptions. It supports features like checkpointing (local and cloud), in-job restarts, and health checks. The current version is 0.5.0, with minor releases occurring every few months to introduce new features and bug fixes.

pip install nvidia-resiliency-ext
INSTALL
IMPORT
SIG · NVIDIA-RESILIENCY-
N
nvidia-resiliency-ext
ai-mlpythonv0.6.0
Install
70.7s avg
Import
Disk
4881MB
Pass rate
3/ 10
Env Coverage3 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.0 · 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
glibc
py 3.10
✕ build_error
✓ 77.93s
py 3.11
✕ build_error
✓ 76.5s
py 3.12
✕ build_error
✓ 57.68s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✕ build_error
4881MB installed
● package 4881MB
Code
Verified usage

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

nvidia_resiliency_ext
import nvidia_resiliency_ext
import nvre

This quickstart demonstrates the basic initialization of the resiliency manager, registering a restart callback, and using checkpointing to save and load training state. The example simulates training steps and checkpoint saves, showing how to resume from a previously saved state.

import nvre import os def my_restart_callback(restart_args): print(f"[NVRE] Restart event received: {restart_args}") # 1. Initialize the resiliency manager # This must be called early in your application's lifecycle. # In a real scenario, this might be within a distributed setup like Horovod or PyTorch DDP. # For simple testing, it can run standalone. print("[NVRE] Initializing resiliency manager...") nvre.init_resiliency_manager() # 2. Register a callback for restart events (optional, but good practice) nvre.register_restart_callback(my_restart_callback) # 3. Example: Checkpointing checkpoint_id = "my_training_state" if nvre.has_checkpoint(checkpoint_id): print(f"[NVRE] Loading checkpoint '{checkpoint_id}'...") state = nvre.load_checkpoint(checkpoint_id) current_step = state.get("step", 0) print(f"[NVRE] Resuming from step {current_step}") else: print(f"[NVRE] No checkpoint found for '{checkpoint_id}'. Starting new training.") current_step = 0 # Simulate some training steps for i in range(current_step, current_step + 3): print(f"[NVRE] Training step {i}") # Simulate a checkpoint save every step for demonstration if i % 1 == 0: state_to_save = {"step": i + 1, "model_config": {"lr": 0.001}} print(f"[NVRE] Saving checkpoint '{checkpoint_id}' at step {i}...") nvre.save_checkpoint(checkpoint_id, state_to_save) print("[NVRE] Training finished.") # Cleanup (optional in many cases, but good for explicit shutdown) nvre.shutdown_resiliency_manager()
Debug
Known issues
gotchaThe `nvre.init_resiliency_manager()` function must be called early in your application's execution before using any other NVRE features. Failing to do so will result in `RuntimeError`.
fix
Ensure `nvre.init_resiliency_manager()` is the first NVRE call in your main execution path.
affects: All versions
gotchaFor distributed training or specific resiliency backends (e.g., MPI), additional dependencies like `mpi4py` might be required but are not direct dependencies of the `nvidia-resiliency-ext` package. Using these features without the corresponding packages installed will lead to import errors or runtime failures.
fix
Install necessary optional dependencies for your chosen resiliency backend, e.g., `pip install mpi4py` or `pip install boto3` for cloud checkpointing.
affects: All versions
gotchaCloud checkpointing features (e.g., S3, GCS) introduced in v0.4.0 require installing specific cloud provider SDKs (e.g., `boto3` for AWS S3, `google-cloud-storage` for GCS). Without these, attempts to use cloud storage will fail.
fix
Install the appropriate SDK for your cloud provider: `pip install boto3` for AWS S3, `pip install google-cloud-storage` for GCS.
affects: >=0.4.0
Upgrade
Version history
0.6.0latest on PyPI · released May 14, 2026
Audit
Dependencies
numpyrequiredRequired for core functionalities.
mpi4pyoptionalRequired for MPI-based resiliency features and distributed training contexts.
protobufoptionalOften used for data serialization, especially in distributed contexts.
boto3optionalRequired for S3 cloud checkpointing support.
google-cloud-storageoptionalRequired for Google Cloud Storage checkpointing support.
Agent activity
8 hits · last 30 days
node
8
Resources
nvidia-resiliency-ext — pip install nvidia-resiliency-ext · libregistry