NVIDIA / NVIDIA/cuda-checkpoint

cuda-checkpoint --toggle hangs when checkpointing one process of torch.distributed NCCL job

Open
#45 0 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
488
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Hi,

I’m seeing cuda-checkpoint --toggle hang when checkpointing one process from a PyTorch torch.distributed (NCCL) job.

To Reproduce
code:

import os
import torch
import torch.distributed as dist

local_rank = int(os.environ["LOCAL_RANK"])
rank = int(os.environ["RANK"])
world_size = int(os.environ["WORLD_SIZE"])

torch.cuda.set_device(local_rank)

dist.init_process_group(
    backend="nccl",
    init_method="env://",
    rank=rank,
    world_size=world_size,
)

x = torch.tensor([rank], device="cuda")
dist.all_reduce(x)
del x
torch.cuda.empty_cache()

print("finish all")

while True:
    pass

running command:
python -m torch.distributed.run --standalone --nproc_per_node=8 measure_cuda_nccl.py

After all 8 processes print finish all, pick one worker process and run:
./cuda-checkpoint --toggle --pid <PID>

Observed Behavior:

  • cuda-checkpoint --toggle hangs indefinitely
  • No error output
  • Target process keeps running

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided measure_cuda_nccl.py program and the cuda-checkpoint --toggle --pid <PID> command after all eight workers print finish all. Investigate the checkpoint toggle path for a single process in this distributed job; done means the command no longer hangs indefinitely and its behavior is observable rather than silently waiting.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.