From 9175ab9f19118d64cf1262640a5081823e8503be Mon Sep 17 00:00:00 2001 From: Seonmyeong Bak Date: Thu, 16 Apr 2026 10:04:05 -0700 Subject: [PATCH 1/7] feat(ckpt): add --async-ckpt-use-cpu-shm argument Wire nvidia-resiliency-ext cpu_shm_mode / use_cpu_shm_for_gpu_tensors into Megatron's async checkpointing stack. When enabled, GPU tensors are copied to per-tensor CPU shared-memory in the training process before handoff to the async worker, avoiding CUDA IPC / NVLink fabric handle exhaustion on MNNVL systems. Backward-compatible: inspect.signature guards each call site so older nvrx installs without the new parameters continue to work unchanged, with a warning if the flag was explicitly requested. Co-Authored-By: Claude Sonnet 4.6 --- .../dist_checkpointing/strategies/torch.py | 18 +++++++++++++ megatron/training/async_utils.py | 21 ++++++++++++++-- megatron/training/checkpointing.py | 25 ++++++++++++++++--- megatron/training/config/training_config.py | 6 +++++ 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/megatron/core/dist_checkpointing/strategies/torch.py b/megatron/core/dist_checkpointing/strategies/torch.py index 58e1e563bc8..08c518cedf9 100644 --- a/megatron/core/dist_checkpointing/strategies/torch.py +++ b/megatron/core/dist_checkpointing/strategies/torch.py @@ -1,6 +1,7 @@ # Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. """ Strategies using PyTorch distributed.checkpoint as an underlying format. """ +import inspect import io import os import pickle @@ -600,6 +601,7 @@ def __init__( thread_count: int = 1, cached_metadata: bool = False, separation_hint: Optional[str] = None, + cpu_shm_mode: bool = False, ): """Adds parameters specific to PyT Distributed format Args: @@ -614,6 +616,10 @@ def __init__( gathering local metadata every checkpointing invocation separation_hint(str, optional): If provided, all tensors whose keys have this prefix will be saved to a separate file. + cpu_shm_mode (bool, optional): Copy GPU tensors to CPU shared-memory in the + training process before handing off to the async worker. Avoids CUDA IPC / + NVLink fabric handles in the worker subprocess. Only applies with nvrx async + strategy. """ self.backend = backend self.version = version @@ -640,6 +646,7 @@ def __init__( self.cached_global_metadata: Optional[Metadata] = None self.separation_hint = separation_hint + self.cpu_shm_mode = cpu_shm_mode self.validated_loaded_metadata_reuse = False @@ -698,6 +705,17 @@ def async_save( self._metadata_cache.set_cached_global_metadata(self.cached_global_metadata) # Define additional arguments async_writer_kwargs["use_cached_data_structure"] = self.use_cached_ckpt_structure + if self.cpu_shm_mode: + if ( + "use_cpu_shm_for_gpu_tensors" + in inspect.signature(async_writer.__init__).parameters + ): + async_writer_kwargs["use_cpu_shm_for_gpu_tensors"] = True + else: + logger.warning( + "Installed nvidia-resiliency-ext does not support " + "use_cpu_shm_for_gpu_tensors. cpu_shm_mode will be ignored." + ) state_dict_saver_kwargs["enable_cache"] = self.use_cached_ckpt_structure state_dict_saver_kwargs["metadata_cache"] = self._metadata_cache else: diff --git a/megatron/training/async_utils.py b/megatron/training/async_utils.py index a085a7caf74..443798ff911 100644 --- a/megatron/training/async_utils.py +++ b/megatron/training/async_utils.py @@ -4,6 +4,7 @@ This module provides a singleton instance of AsyncCallsQueue which manages the async checkpoint save calls. """ +import inspect import logging import time @@ -12,7 +13,7 @@ from megatron.core.dist_checkpointing.strategies.async_utils import AsyncRequest from megatron.core.dist_checkpointing.strategies.torch import get_async_strategy from megatron.training import get_args -from megatron.training.utils import print_rank_0 +from megatron.training.utils import print_rank_0, warn_rank_0 try: from nvidia_resiliency_ext.checkpointing.async_ckpt.core import AsyncRequest as NVRxAsyncRequest @@ -56,12 +57,28 @@ def init_persistent_async_worker(rank: int, mp_mode: str = 'spawn'): time_start = time.time() if rank == 0: print(f"init_persistent_async_worker: {rank}, Starting Async Caller", flush=True) - _async_calls_queue = AsyncCallsQueue(persistent=True) + _async_calls_queue = AsyncCallsQueue( + persistent=True, + **( + {"cpu_shm_mode": args.async_ckpt_use_cpu_shm} + if async_strategy == "nvrx" + and "cpu_shm_mode" in inspect.signature(AsyncCallsQueue.__init__).parameters + else {} + ), + ) # initialize the persistent caller with QoS priorities from args kwargs = {} if async_strategy == "mcore": # Note: nvidia-resiliency-ext uses is_daemon instead of mp_mode (always spawns) kwargs["mp_mode"] = mp_mode + elif async_strategy == "nvrx": + if "cpu_shm_mode" in inspect.signature(AsyncCallsQueue.warmup_persistent_caller).parameters: + kwargs["cpu_shm_mode"] = args.async_ckpt_use_cpu_shm + elif args.async_ckpt_use_cpu_shm: + warn_rank_0( + "Installed nvidia-resiliency-ext does not support cpu_shm_mode. " + "Ignoring --async-ckpt-use-cpu-shm." + ) AsyncCallsQueue.warmup_persistent_caller( rank, cpu_priority=args.async_ckpt_cpu_priority, diff --git a/megatron/training/checkpointing.py b/megatron/training/checkpointing.py index caf32b2a7bc..c6557e0bb45 100644 --- a/megatron/training/checkpointing.py +++ b/megatron/training/checkpointing.py @@ -3,6 +3,7 @@ """Input/output checkpointing.""" import contextlib +import inspect import multiprocessing import os import random @@ -42,7 +43,7 @@ from megatron.core.dist_checkpointing.strategies.async_utils import _disable_gc from .global_vars import get_args from .one_logger_utils import on_save_checkpoint_start, on_save_checkpoint_success -from .utils import append_to_progress_log, is_last_rank, print_rank_0, unwrap_model +from .utils import append_to_progress_log, is_last_rank, print_rank_0, unwrap_model, warn_rank_0 try: from megatron.core.distributed.fsdp.src.megatron_fsdp.uneven_dtensor import preprocess_state_dict_for_uneven_dtensor @@ -631,7 +632,9 @@ def save_checkpoint(iteration, model, optimizer, opt_param_scheduler, num_floati validate_sharding_integrity = not args.ckpt_assume_constant_structure else: validate_sharding_integrity = True - save_strategy = TorchDistSaveShardedStrategy() + save_strategy = TorchDistSaveShardedStrategy( + cpu_shm_mode=getattr(args, 'async_ckpt_use_cpu_shm', False) + ) if args.ckpt_assume_constant_structure and args.ckpt_format == 'torch_dist': save_strategy.use_cached_ckpt_structure = args.ckpt_assume_constant_structure if args.async_save: @@ -681,8 +684,24 @@ def save_checkpoint(iteration, model, optimizer, opt_param_scheduler, num_floati if args.async_save: planner = torch.distributed.checkpoint.DefaultSavePlanner() coordinator_rank = 0 + _cpu_shm = getattr(args, 'async_ckpt_use_cpu_shm', False) + _writer_kwargs = {} + if _cpu_shm: + if ( + "use_cpu_shm_for_gpu_tensors" + in inspect.signature(FileSystemWriterAsync.__init__).parameters + ): + _writer_kwargs["use_cpu_shm_for_gpu_tensors"] = True + else: + warn_rank_0( + "Installed nvidia-resiliency-ext does not support " + "use_cpu_shm_for_gpu_tensors. Ignoring --async-ckpt-use-cpu-shm." + ) fs_storage_writer = FileSystemWriterAsync( - checkpoint_name, thread_count=args.dist_ckpt_workers, use_msc=args.enable_msc + checkpoint_name, + thread_count=args.dist_ckpt_workers, + use_msc=args.enable_msc, + **_writer_kwargs, ) save_state_dict_ret = save_state_dict_async_plan( diff --git a/megatron/training/config/training_config.py b/megatron/training/config/training_config.py index a494391dde3..2d5806bcb57 100644 --- a/megatron/training/config/training_config.py +++ b/megatron/training/config/training_config.py @@ -477,6 +477,12 @@ class CheckpointConfig: async_ckpt_io_priority: Optional[int] = 3 """I/O scheduling class (0-3, 3=idle) for the async checkpoint writer process.""" + async_ckpt_use_cpu_shm: bool = False + """Copy GPU tensors to CPU shared-memory in the training process before handing off to + the async checkpoint worker. Avoids CUDA IPC / NVLink fabric handles in the worker + subprocess. Useful on MNNVL systems where fabric resources are exhausted. + Only applies with the nvrx async strategy.""" + fully_parallel_load: bool = field(default=False, metadata={"argparse_meta": {"arg_names": ["--ckpt-fully-parallel-load"], "dest": "ckpt_fully_parallel_load"}}) """Apply full load parallelization across DP for distributed checkpoints.""" From fd0ff12638ff85e2f0920cf8b99957cf18c06778 Mon Sep 17 00:00:00 2001 From: Seonmyeong Bak Date: Thu, 16 Apr 2026 20:06:52 -0700 Subject: [PATCH 2/7] test(ckpt): enable --async-ckpt-use-cpu-shm in two functional tests Add --async-ckpt-use-cpu-shm to the GPT vp1 dist-optimizer overlap test and the MoE 8-expert multi-dist-optimizer test, covering the new CPU shared memory async checkpoint path under both ckpt-resume and regular test types. Co-Authored-By: Claude Sonnet 4.6 --- .../model_config.yaml | 1 + .../model_config.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml b/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml index 4f2d19ce559..b594276f7b5 100644 --- a/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml +++ b/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml @@ -60,5 +60,6 @@ MODEL_ARGS: --log-memory-to-tensorboard: true --async-save: true --use-persistent-ckpt-worker: true + --async-ckpt-use-cpu-shm: true TEST_TYPE: regular # Usually ckpt-resume, but as a WAR to #513 set to regular LAUNCHER: ft_launcher diff --git a/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml b/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml index 37224a25cd2..cfc31e3381b 100644 --- a/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml +++ b/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml @@ -62,5 +62,6 @@ MODEL_ARGS: --num-distributed-optimizer-instances: 2 --async-save: true --use-persistent-ckpt-worker: true + --async-ckpt-use-cpu-shm: true TEST_TYPE: ckpt-resume LAUNCHER: ft_launcher From 2ff64839c7d73c8a9e0864a6d3b24e80c63312f7 Mon Sep 17 00:00:00 2001 From: Seonmyeong Bak Date: Thu, 16 Apr 2026 20:53:26 -0700 Subject: [PATCH 3/7] Update commit for nvrx --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7733456ecc8..5b09cbd2a66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -205,7 +205,7 @@ flash_mla = [ transformer-engine = { git = "https://github.com/NVIDIA/TransformerEngine.git", rev = "f031cf87bd054c7558b887df7bed93975456667f" } nemo-run = { git = "https://github.com/NVIDIA-NeMo/Run.git", rev = "17ae86b64d7f75653351664f5d8c9e466faede00" } emerging_optimizers = { git = "https://github.com/NVIDIA-NeMo/Emerging-Optimizers.git", rev = "v0.2.0" } -nvidia-resiliency-ext = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git", rev = "15a851565a4ce846c04431ecb0cf09903ab4837e" } +nvidia-resiliency-ext = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git", rev = "b2bb3d728a18795807d9f76c535e005a609a1b01" } [tool.isort] profile = "black" # black-compatible From 88334f71f197c212422863bda998af806833b354 Mon Sep 17 00:00:00 2001 From: Seonmyeong Bak Date: Thu, 16 Apr 2026 21:35:25 -0700 Subject: [PATCH 4/7] Update uv.lock --- uv.lock | 160 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 126 insertions(+), 34 deletions(-) diff --git a/uv.lock b/uv.lock index 78f40208716..821f353b11b 100644 --- a/uv.lock +++ b/uv.lock @@ -77,7 +77,8 @@ dependencies = [ { name = "huggingface-hub" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "psutil" }, { name = "pyyaml" }, { name = "safetensors" }, @@ -544,7 +545,8 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "click" }, { name = "mypy-extensions" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pathspec" }, { name = "platformdirs" }, ] @@ -622,7 +624,8 @@ version = "1.6.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "ninja" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, { name = "torch", marker = "sys_platform == 'never'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/63/15/ec51d77a2df03ee93410f8ee97fceeb7181da213813c51243e9dd6d7e144/causal_conv1d-1.6.1.tar.gz", hash = "sha256:e4a697ec2db3906f012e675125569f8b510b4559bc53e3095143d91369e1221b", size = 29426, upload-time = "2026-03-10T08:56:35.305Z" } @@ -1085,7 +1088,8 @@ dependencies = [ { name = "multiprocess", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "packaging", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "pandas", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-dev') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "pandas", version = "3.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32' and extra == 'extra-13-megatron-core-lts') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "pyarrow", marker = "python_full_version >= '3.14' and sys_platform == 'win32'" }, @@ -1130,7 +1134,8 @@ dependencies = [ { name = "multiprocess", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "packaging", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "pandas", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "pandas", version = "3.0.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-lts') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "pyarrow", marker = "python_full_version < '3.14' or sys_platform != 'win32'" }, @@ -1405,7 +1410,8 @@ dependencies = [ { name = "nvidia-cudnn-frontend" }, { name = "nvidia-cutlass-dsl" }, { name = "nvidia-ml-py" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, { name = "requests" }, { name = "tabulate" }, { name = "torch", marker = "sys_platform == 'never'" }, @@ -1842,7 +1848,8 @@ name = "hatchling" version = "1.29.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pathspec" }, { name = "pluggy" }, { name = "trove-classifiers" }, @@ -1958,7 +1965,8 @@ dependencies = [ { name = "fsspec", version = "2026.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' or sys_platform != 'win32' or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "fsspec", version = "2026.3.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and sys_platform == 'win32') or (python_full_version < '3.14' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts') or (sys_platform != 'win32' and extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "hf-xet", marker = "platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pyyaml" }, { name = "requests" }, { name = "tqdm" }, @@ -2247,20 +2255,21 @@ wheels = [ [[package]] name = "langchain-core" -version = "0.3.76" +version = "0.3.84" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "jsonpatch" }, { name = "langsmith" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" } }, { name = "pydantic" }, { name = "pyyaml" }, { name = "tenacity" }, { name = "typing-extensions" }, + { name = "uuid-utils" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/4f/4d/5e2ea7754ee0a1f524c412801c6ba9ad49318ecb58b0d524903c3d9efe0a/langchain_core-0.3.76.tar.gz", hash = "sha256:71136a122dd1abae2c289c5809d035cf12b5f2bb682d8a4c1078cd94feae7419", size = 573568, upload-time = "2025-09-10T14:49:39.863Z" } +sdist = { url = "https://files.pythonhosted.org/packages/13/3e/1e70598fac522eaeeeb22f03107da06495160533b25ba4388be9cef01d55/langchain_core-0.3.84.tar.gz", hash = "sha256:814b75bfe67a8460a53f5839bae9505bbfffc7af6f1aa0a5155715563f5cc490", size = 599092, upload-time = "2026-04-08T19:14:00.106Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/77/b5/501c0ffcb09c734457ceaa86bc7b1dd37b6a261147bd653add03b838aacb/langchain_core-0.3.76-py3-none-any.whl", hash = "sha256:46e0eb48c7ac532432d51f8ca1ece1804c82afe9ae3dcf027b867edadf82b3ec", size = 447508, upload-time = "2025-09-10T14:49:38.179Z" }, + { url = "https://files.pythonhosted.org/packages/8d/5b/ba75d5b80bd1f60ae799c8cbda5477eb7489fb21d40c967ec509bbd51933/langchain_core-0.3.84-py3-none-any.whl", hash = "sha256:d0b3a7b6473e30a2b3d4588ee09dc6471b8d38c46cd48f3e7c3d1ab6547f63cb", size = 459123, upload-time = "2026-04-08T19:13:57.818Z" }, ] [[package]] @@ -2277,6 +2286,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/de/46/d7529004de384b2abc9e5b76cf4a84a23f3028ec6381bd5f7c00ac39bfab/langchain_nvidia_ai_endpoints-0.3.19-py3-none-any.whl", hash = "sha256:40161a71646fcbe457ac5f2222c5eadcbe31a7d79d618f5a0857c37fffa3a6d5", size = 46229, upload-time = "2025-10-31T00:17:18.306Z" }, ] +[[package]] +name = "langchain-openai" +version = "0.3.35" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "langchain-core" }, + { name = "openai" }, + { name = "tiktoken" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fb/96/06d0d25a37e05a0ff2d918f0a4b0bf0732aed6a43b472b0b68426ce04ef8/langchain_openai-0.3.35.tar.gz", hash = "sha256:fa985fd041c3809da256a040c98e8a43e91c6d165b96dcfeb770d8bd457bf76f", size = 786635, upload-time = "2025-10-06T15:09:28.463Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d8/d5/c90c5478215c20ee71d8feaf676f7ffd78d0568f8c98bd83f81ce7562ed7/langchain_openai-0.3.35-py3-none-any.whl", hash = "sha256:76d5707e6e81fd461d33964ad618bd326cb661a1975cef7c1cb0703576bdada5", size = 75952, upload-time = "2025-10-06T15:09:27.137Z" }, +] + [[package]] name = "langchain-text-splitters" version = "0.3.11" @@ -2296,7 +2319,7 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, { name = "orjson", marker = "platform_python_implementation != 'PyPy'" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" } }, { name = "pydantic" }, { name = "requests" }, { name = "requests-toolbelt" }, @@ -2411,7 +2434,7 @@ wheels = [ [[package]] name = "logsage" -version = "0.1.5" +version = "0.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "drain3" }, @@ -2425,7 +2448,7 @@ dependencies = [ { name = "requests" }, ] wheels = [ - { url = "https://files.pythonhosted.org/packages/e2/eb/d44608c5fc69ac216a41cd164453df5784114d07f28ece6c6ab8a351f636/logsage-0.1.5-py3-none-any.whl", hash = "sha256:4c144ea2b339f370e943929dc2d1f755b04351a75a2d8fd4201bd6d90045ed7a", size = 65098, upload-time = "2026-01-25T10:12:30.042Z" }, + { url = "https://files.pythonhosted.org/packages/00/29/41ca46b94399d55569b1a19d909115cfef47456b88bb302960d58e3fd1f3/logsage-0.1.7-py3-none-any.whl", hash = "sha256:690e9f6dc56bf369b90aad91d7463e4c1689feb589148481955437ec8d33088a", size = 75267, upload-time = "2026-04-13T07:59:47.001Z" }, ] [[package]] @@ -2448,7 +2471,8 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "einops" }, { name = "ninja" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, { name = "setuptools" }, { name = "torch", marker = "sys_platform == 'never'" }, { name = "transformers" }, @@ -2601,7 +2625,8 @@ source = { editable = "." } dependencies = [ { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "torch", marker = "sys_platform == 'never' or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, ] @@ -2676,7 +2701,8 @@ build = [ { name = "cython" }, { name = "hatchling" }, { name = "nvidia-mathdx" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pybind11" }, { name = "setuptools" }, { name = "torch", marker = "sys_platform == 'never' or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, @@ -2753,7 +2779,7 @@ requires-dist = [ { name = "multi-storage-client", marker = "extra == 'lts'", specifier = "~=0.27" }, { name = "numpy" }, { name = "nvidia-modelopt", extras = ["torch"], marker = "sys_platform != 'darwin' and extra == 'dev'" }, - { name = "nvidia-resiliency-ext", marker = "extra == 'dev'", git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git?rev=15a851565a4ce846c04431ecb0cf09903ab4837e" }, + { name = "nvidia-resiliency-ext", marker = "extra == 'dev'", git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git?rev=b2bb3d728a18795807d9f76c535e005a609a1b01" }, { name = "nvtx", marker = "extra == 'dev'", specifier = "~=0.2" }, { name = "nvtx", marker = "extra == 'lts'", specifier = "~=0.2" }, { name = "onnxscript", marker = "extra == 'dev'" }, @@ -3198,7 +3224,8 @@ dependencies = [ { name = "leptonai" }, { name = "networkx" }, { name = "omegaconf" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "rich" }, { name = "toml" }, { name = "torchx" }, @@ -3623,7 +3650,7 @@ dependencies = [ { name = "ninja" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" } }, { name = "nvidia-ml-py" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" } }, { name = "pulp" }, { name = "pydantic" }, { name = "regex" }, @@ -3677,17 +3704,17 @@ wheels = [ [[package]] name = "nvidia-resiliency-ext" -version = "0.6.0.dev33+15a8515" -source = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git?rev=15a851565a4ce846c04431ecb0cf09903ab4837e#15a851565a4ce846c04431ecb0cf09903ab4837e" } +version = "0.6.0.dev69+b2bb3d7" +source = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git?rev=b2bb3d728a18795807d9f76c535e005a609a1b01#b2bb3d728a18795807d9f76c535e005a609a1b01" } dependencies = [ { name = "defusedxml" }, { name = "grpcio" }, { name = "grpcio-tools" }, - { name = "langchain-nvidia-ai-endpoints" }, + { name = "langchain-openai" }, { name = "logsage" }, { name = "mcp" }, { name = "nvidia-ml-py" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" } }, { name = "protobuf" }, { name = "psutil" }, { name = "pyyaml" }, @@ -3928,7 +3955,7 @@ dependencies = [ { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "onnx", version = "1.19.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "onnx-ir", version = "0.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, - { name = "packaging", marker = "python_full_version >= '3.13'" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "typing-extensions", marker = "python_full_version >= '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/f5/2f/0bb2b6ca727e4d5173f640527f402ab4225def4bc8d667269b83047be8c4/onnxscript-0.5.0.tar.gz", hash = "sha256:4aba215e1f80fbcd07ba0d97d6bca96797fc3e9639eacb5434d35317ce1406aa", size = 588762, upload-time = "2025-09-12T16:57:46.484Z" } @@ -3966,7 +3993,8 @@ dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, { name = "onnx", version = "1.21.0", source = { registry = "https://pypi.org/simple" } }, { name = "onnx-ir", version = "0.2.0", source = { registry = "https://pypi.org/simple" } }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.13' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts'" }, { name = "typing-extensions" }, ] sdist = { url = "https://files.pythonhosted.org/packages/e7/2b/538fdeb0e25bed5d7e0f954af5710543e2629499fb74381afc3333f8a8ae/onnxscript-0.6.2.tar.gz", hash = "sha256:abb2e6f464db40c9b8c7fbb3e64cca04cf3f4495e67c4eda5eac17b784191ce3", size = 590865, upload-time = "2026-02-10T22:53:39.638Z" } @@ -4319,10 +4347,68 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c0/d1/facb5b5051fabb0ef9d26c6544d87ef19a939a9a001198655d0d891062dd/orjson-3.11.8-cp314-cp314-win_arm64.whl", hash = "sha256:6ccdea2c213cf9f3d9490cbd5d427693c870753df41e6cb375bd79bcbafc8817", size = 127330, upload-time = "2026-03-31T16:16:25.496Z" }, ] +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'win32'", + "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'win32'", + "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'emscripten'", + "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'emscripten'", + "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32'", + "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'win32'", + "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'win32'", + "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'emscripten'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten'", + "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'emscripten'", + "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'emscripten'", + "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32'", +] +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + [[package]] name = "packaging" version = "26.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and platform_machine != 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and platform_machine == 's390x' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and sys_platform == 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and sys_platform == 'emscripten' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version == '3.13.*' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", + "python_full_version < '3.13' and sys_platform != 'emscripten' and sys_platform != 'win32' and extra != 'extra-13-megatron-core-dev' and extra != 'extra-13-megatron-core-lts'", +] sdist = { url = "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4", size = 143416, upload-time = "2026-01-21T20:50:39.064Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" }, @@ -5144,7 +5230,8 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32' or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "iniconfig" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pluggy" }, ] sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891, upload-time = "2025-03-02T12:54:54.503Z" } @@ -5383,7 +5470,8 @@ dependencies = [ { name = "filelock" }, { name = "jsonschema" }, { name = "msgpack" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "protobuf" }, { name = "pyyaml" }, { name = "requests" }, @@ -6064,7 +6152,8 @@ dependencies = [ { name = "docutils" }, { name = "imagesize" }, { name = "jinja2" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pygments" }, { name = "requests" }, { name = "roman-numerals" }, @@ -6289,7 +6378,8 @@ dependencies = [ { name = "markdown" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pillow" }, { name = "protobuf" }, { name = "setuptools" }, @@ -6615,7 +6705,7 @@ dependencies = [ { name = "onnx", version = "1.21.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.13' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "onnxscript", version = "0.5.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.13' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, { name = "onnxscript", version = "0.6.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.13' and extra == 'extra-13-megatron-core-dev') or (extra == 'extra-13-megatron-core-dev' and extra == 'extra-13-megatron-core-lts')" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" } }, { name = "pydantic" }, { name = "torch", marker = "sys_platform == 'never'" }, ] @@ -6629,7 +6719,8 @@ dependencies = [ { name = "huggingface-hub" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "pyyaml" }, { name = "regex" }, { name = "requests" }, @@ -6792,7 +6883,8 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "click" }, { name = "gitpython" }, - { name = "packaging" }, + { name = "packaging", version = "25.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-dev'" }, + { name = "packaging", version = "26.0", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'extra-13-megatron-core-lts' or extra != 'extra-13-megatron-core-dev'" }, { name = "platformdirs" }, { name = "protobuf" }, { name = "pydantic" }, From 0f7400290116b48fe7fbb3aafa5ff98e15767d8b Mon Sep 17 00:00:00 2001 From: Seonmyeong Bak Date: Fri, 17 Apr 2026 09:22:02 -0700 Subject: [PATCH 5/7] test(ckpt): update --async-ckpt-use-cpu-shm coverage in functional tests Move --async-ckpt-use-cpu-shm to gpt3_mcore_te_tp4_pp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather and gpt3_moe_mcore_te_tp4_ep2_etp2_pp2_resume_torch_dist_dist_optimizer; remove it from the two previous holders. Also add --ckpt-assume-constant-structure to the GPT tp4 test. Co-Authored-By: Claude Sonnet 4.6 --- .../model_config.yaml | 1 - .../model_config.yaml | 2 ++ .../model_config.yaml | 1 - .../model_config.yaml | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml b/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml index b594276f7b5..4f2d19ce559 100644 --- a/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml +++ b/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp1_pp4_vp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml @@ -60,6 +60,5 @@ MODEL_ARGS: --log-memory-to-tensorboard: true --async-save: true --use-persistent-ckpt-worker: true - --async-ckpt-use-cpu-shm: true TEST_TYPE: regular # Usually ckpt-resume, but as a WAR to #513 set to regular LAUNCHER: ft_launcher diff --git a/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp4_pp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml b/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp4_pp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml index 12acfaf8402..31d04e480ba 100644 --- a/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp4_pp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml +++ b/tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp4_pp1_resume_torch_dist_dist_optimizer_overlap_grad_reduce_param_gather/model_config.yaml @@ -50,11 +50,13 @@ MODEL_ARGS: --ckpt-format: torch_dist --dist-ckpt-optim-fully-reshardable: true --dist-ckpt-strictness: log_all # backward compatibility for TE changes + --ckpt-assume-constant-structure: true --data-cache-path: ${DATA_CACHE_PATH} --bf16: true --log-memory-to-tensorboard: true --async-save: true --async-strategy: mcore --use-persistent-ckpt-worker: true + --async-ckpt-use-cpu-shm: true TEST_TYPE: ckpt-resume LAUNCHER: ft_launcher diff --git a/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml b/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml index cfc31e3381b..37224a25cd2 100644 --- a/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml +++ b/tests/functional_tests/test_cases/moe/gpt3_mcore_te_tp2_pp1_resume_torch_dist_te_8experts2parallel_multi_dist_optimizer_instances/model_config.yaml @@ -62,6 +62,5 @@ MODEL_ARGS: --num-distributed-optimizer-instances: 2 --async-save: true --use-persistent-ckpt-worker: true - --async-ckpt-use-cpu-shm: true TEST_TYPE: ckpt-resume LAUNCHER: ft_launcher diff --git a/tests/functional_tests/test_cases/moe/gpt3_moe_mcore_te_tp4_ep2_etp2_pp2_resume_torch_dist_dist_optimizer/model_config.yaml b/tests/functional_tests/test_cases/moe/gpt3_moe_mcore_te_tp4_ep2_etp2_pp2_resume_torch_dist_dist_optimizer/model_config.yaml index ff52550c238..faf717c7821 100644 --- a/tests/functional_tests/test_cases/moe/gpt3_moe_mcore_te_tp4_ep2_etp2_pp2_resume_torch_dist_dist_optimizer/model_config.yaml +++ b/tests/functional_tests/test_cases/moe/gpt3_moe_mcore_te_tp4_ep2_etp2_pp2_resume_torch_dist_dist_optimizer/model_config.yaml @@ -66,5 +66,6 @@ MODEL_ARGS: --log-memory-to-tensorboard: true --async-save: true --use-persistent-ckpt-worker: true + --async-ckpt-use-cpu-shm: true TEST_TYPE: ckpt-resume LAUNCHER: ft_launcher From e1fe22832c94eef51015e93dc02e1c7fc044b713 Mon Sep 17 00:00:00 2001 From: Seonmyeong Bak Date: Fri, 17 Apr 2026 11:50:47 -0700 Subject: [PATCH 6/7] Assert on unsupported nvrx cpu shm mode --- megatron/core/dist_checkpointing/strategies/torch.py | 5 +++-- megatron/training/async_utils.py | 4 ++-- megatron/training/checkpointing.py | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/megatron/core/dist_checkpointing/strategies/torch.py b/megatron/core/dist_checkpointing/strategies/torch.py index 08c518cedf9..3e467c1f9dd 100644 --- a/megatron/core/dist_checkpointing/strategies/torch.py +++ b/megatron/core/dist_checkpointing/strategies/torch.py @@ -712,9 +712,10 @@ def async_save( ): async_writer_kwargs["use_cpu_shm_for_gpu_tensors"] = True else: - logger.warning( + raise AssertionError( "Installed nvidia-resiliency-ext does not support " - "use_cpu_shm_for_gpu_tensors. cpu_shm_mode will be ignored." + "use_cpu_shm_for_gpu_tensors. Update nvidia-resiliency-ext " + "to enable cpu_shm_mode." ) state_dict_saver_kwargs["enable_cache"] = self.use_cached_ckpt_structure state_dict_saver_kwargs["metadata_cache"] = self._metadata_cache diff --git a/megatron/training/async_utils.py b/megatron/training/async_utils.py index 443798ff911..6424db2b48e 100644 --- a/megatron/training/async_utils.py +++ b/megatron/training/async_utils.py @@ -75,9 +75,9 @@ def init_persistent_async_worker(rank: int, mp_mode: str = 'spawn'): if "cpu_shm_mode" in inspect.signature(AsyncCallsQueue.warmup_persistent_caller).parameters: kwargs["cpu_shm_mode"] = args.async_ckpt_use_cpu_shm elif args.async_ckpt_use_cpu_shm: - warn_rank_0( + raise AssertionError( "Installed nvidia-resiliency-ext does not support cpu_shm_mode. " - "Ignoring --async-ckpt-use-cpu-shm." + "Update nvidia-resiliency-ext to use --async-ckpt-use-cpu-shm." ) AsyncCallsQueue.warmup_persistent_caller( rank, diff --git a/megatron/training/checkpointing.py b/megatron/training/checkpointing.py index c6557e0bb45..64b2b645f20 100644 --- a/megatron/training/checkpointing.py +++ b/megatron/training/checkpointing.py @@ -693,9 +693,10 @@ def save_checkpoint(iteration, model, optimizer, opt_param_scheduler, num_floati ): _writer_kwargs["use_cpu_shm_for_gpu_tensors"] = True else: - warn_rank_0( + raise AssertionError( "Installed nvidia-resiliency-ext does not support " - "use_cpu_shm_for_gpu_tensors. Ignoring --async-ckpt-use-cpu-shm." + "use_cpu_shm_for_gpu_tensors. Update nvidia-resiliency-ext " + "to use --async-ckpt-use-cpu-shm." ) fs_storage_writer = FileSystemWriterAsync( checkpoint_name, From b95333a473a6124d0def3c502a4a688b0d9159a3 Mon Sep 17 00:00:00 2001 From: Seonmyeong Bak Date: Fri, 17 Apr 2026 14:04:45 -0700 Subject: [PATCH 7/7] chore(ckpt): clean up async checkpoint imports --- megatron/training/async_utils.py | 11 ++++++---- megatron/training/checkpointing.py | 35 ++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/megatron/training/async_utils.py b/megatron/training/async_utils.py index 6424db2b48e..3d283c056fa 100644 --- a/megatron/training/async_utils.py +++ b/megatron/training/async_utils.py @@ -7,21 +7,24 @@ import inspect import logging import time - from abc import ABC from megatron.core.dist_checkpointing.strategies.async_utils import AsyncRequest from megatron.core.dist_checkpointing.strategies.torch import get_async_strategy from megatron.training import get_args -from megatron.training.utils import print_rank_0, warn_rank_0 +from megatron.training.utils import print_rank_0 try: from nvidia_resiliency_ext.checkpointing.async_ckpt.core import AsyncRequest as NVRxAsyncRequest from nvidia_resiliency_ext.checkpointing.async_ckpt.filesystem_async import _results_queue - from nvidia_resiliency_ext.checkpointing.async_ckpt.state_dict_saver import save_state_dict_async_finalize + from nvidia_resiliency_ext.checkpointing.async_ckpt.state_dict_saver import ( + save_state_dict_async_finalize, + ) except (ImportError, ModuleNotFoundError): from megatron.core.dist_checkpointing.strategies.filesystem_async import _results_queue - from megatron.core.dist_checkpointing.strategies.state_dict_saver import save_state_dict_async_finalize + from megatron.core.dist_checkpointing.strategies.state_dict_saver import ( + save_state_dict_async_finalize, + ) NVRxAsyncRequest = ABC diff --git a/megatron/training/checkpointing.py b/megatron/training/checkpointing.py index 64b2b645f20..1441a71518d 100644 --- a/megatron/training/checkpointing.py +++ b/megatron/training/checkpointing.py @@ -17,41 +17,45 @@ from logging import getLogger from pathlib import Path from time import time +from typing import Any, Dict, List, Optional, Union import numpy as np import torch -from typing import Optional, Union, List, Dict, Any from torch.distributed.checkpoint import FileSystemReader, default_planner from megatron.core import dist_checkpointing, mpu, tensor_parallel from megatron.core.dist_checkpointing.mapping import ShardedObject -from megatron.core.dist_checkpointing.strategies.torch import TorchDistLoadShardedStrategy, TorchDistSaveShardedStrategy +from megatron.core.dist_checkpointing.strategies.async_utils import _disable_gc from megatron.core.dist_checkpointing.strategies.fully_parallel import ( FullyParallelLoadStrategyWrapper, FullyParallelSaveStrategyWrapper, ) +from megatron.core.dist_checkpointing.strategies.torch import ( + TorchDistLoadShardedStrategy, + TorchDistSaveShardedStrategy, +) from megatron.core.msc_utils import MultiStorageClientFeature, open_file from megatron.core.num_microbatches_calculator import update_num_microbatches -from megatron.core.utils import get_pg_rank, get_pg_size from megatron.core.optimizer import DistributedOptimizer from megatron.core.rerun_state_machine import get_rerun_state_machine -from megatron.core.utils import get_torch_version, is_torch_min_version +from megatron.core.utils import get_pg_rank, get_pg_size, get_torch_version, is_torch_min_version from ..core.dist_checkpointing.utils import _clean_metadata_for_serialization from . import ft_integration, wandb_utils from .async_utils import get_save_and_finalize_callbacks, is_empty_async_queue, schedule_async_save -from megatron.core.dist_checkpointing.strategies.async_utils import _disable_gc from .global_vars import get_args from .one_logger_utils import on_save_checkpoint_start, on_save_checkpoint_success -from .utils import append_to_progress_log, is_last_rank, print_rank_0, unwrap_model, warn_rank_0 +from .utils import append_to_progress_log, is_last_rank, print_rank_0, unwrap_model try: - from megatron.core.distributed.fsdp.src.megatron_fsdp.uneven_dtensor import preprocess_state_dict_for_uneven_dtensor + from megatron.core.distributed.fsdp.src.megatron_fsdp.uneven_dtensor import ( + preprocess_state_dict_for_uneven_dtensor, + ) from megatron.core.transformer.fsdp_dtensor_checkpoint import ( - print_diff_in_state_dicts, + handle_experts_in_state_dict, handle_fp8_extra_state_case, handle_swiglu_in_state_dict, - handle_experts_in_state_dict, + print_diff_in_state_dicts, ) HAVE_MEGATRON_FSDP = True except ImportError: @@ -61,6 +65,7 @@ # [ModelOpt]: Import try: from modelopt.torch.opt.plugins import save_modelopt_state, save_sharded_modelopt_state + from megatron.post_training.utils import print_distributed_quant_summary has_nvidia_modelopt = True except Exception: @@ -68,8 +73,12 @@ try: - from nvidia_resiliency_ext.checkpointing.async_ckpt.filesystem_async import FileSystemWriterAsync - from nvidia_resiliency_ext.checkpointing.async_ckpt.state_dict_saver import save_state_dict_async_plan + from nvidia_resiliency_ext.checkpointing.async_ckpt.filesystem_async import ( + FileSystemWriterAsync, + ) + from nvidia_resiliency_ext.checkpointing.async_ckpt.state_dict_saver import ( + save_state_dict_async_plan, + ) HAVE_NVRX = True except (ImportError, ModuleNotFoundError): @@ -727,7 +736,9 @@ def save_checkpoint(iteration, model, optimizer, opt_param_scheduler, num_floati logger.debug(f"rank: {rank}, takes {end_ckpt - start_ckpt} to prepare state dict for ckpt ") if ckpt_type == CheckpointType.LOCAL: try: - from megatron.core.dist_checkpointing.tensor_aware_state_dict import MCoreTensorAwareStateDict + from megatron.core.dist_checkpointing.tensor_aware_state_dict import ( + MCoreTensorAwareStateDict, + ) except ModuleNotFoundError: raise RuntimeError("The 'nvidia_resiliency_ext' module is required for local " "checkpointing but was not found. Please ensure it is installed.")