Troubleshooting

NCCL timeout: causes and fixes in PyTorch

An NCCL timeout means one collective, such as an all-reduce, did not finish on every rank within the process group timeout, which defaults to 10 minutes for NCCL. Usually one rank never reached the collective: it took a different code path, was busy saving a checkpoint, or crashed. Network misconfiguration and faulty GPUs come next. Compare sequence numbers across ranks to find the straggler.

NEURAMESH / COMPUTE FIELD NOTES00 / 10

The exact message and how to read it

PyTorch’s NCCL process group runs a watchdog thread that checks each collective. When one runs too long it logs a line like this: "[Rank 3] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=48211, OpType=ALLREDUCE, NumelIn=26214400, NumelOut=26214400, Timeout(ms)=600000) ran for 600081 milliseconds before timing out." The values are an example; newer builds may add a process group ID to the prefix.

Each field narrows the search. Rank says which process noticed. SeqNum counts collectives issued by that process group, so ranks that are in step share the same number. OpType names the collective. NumelIn and NumelOut give the tensor size. Timeout(ms) is the limit in force, and 600000 is the 10-minute default.

After the timeout, the docs say collectives are aborted asynchronously and the process crashes. That is deliberate: CUDA work is asynchronous, so continuing after a failed NCCL operation could run later kernels on corrupted data.

The exact message and how to read it
FieldMeaningWhat to do with it
RankProcess that hit the timeoutCollect this line from every rank
SeqNumCount of collectives in this groupThe lowest value marks the straggler
OpTypeALLREDUCE, BROADCAST, ALLGATHER and so onFind the matching call in your code
NumelIn / NumelOutElements in the tensorMismatched sizes point at desync
Timeout(ms)Limit in forceDefault 600000 for NCCL

References: PyTorch v2.15.0 source: ProcessGroupNCCL.cpp · PyTorch distributed communication package

Causes of an NCCL timeout, ranked by frequency

The most common cause is desync: ranks issue different collectives. A collective inside an if statement that only some ranks take, uneven data so one rank runs one batch more, or an early exit on one rank all leave the others waiting at an all-reduce that never completes.

Second is a slow rank. Rank 0 saves a large checkpoint, runs evaluation or downloads data while the others sit at the next collective. If that work takes longer than the timeout, the job dies even though nothing is broken.

Third is a dead peer. One rank hits an out-of-memory error or is killed, and the rest wait for it. Fourth is network configuration: NCCL picks the wrong interface, a firewall blocks ports between nodes, or InfiniBand is misconfigured. Fifth is a hardware or driver fault, such as a GPU that falls off the bus or an NVLink error.

References: PyTorch distributed communication package · NVIDIA NCCL environment variables

Find the rank that stalled

Gather the timeout line from every rank and compare SeqNum. Ranks that agree are healthy; the rank with a lower number, or no timeout line at all, is the one to inspect. Check its log for an earlier exception, an out-of-memory error or a long checkpoint save.

Use the Flight Recorder for a precise answer. PyTorch’s tutorial enables it with TORCH_NCCL_TRACE_BUFFER_SIZE set to a positive number such as 2000 and TORCH_NCCL_DUMP_ON_TIMEOUT=true, which writes one dump file per rank; in the PyTorch 2.15 source both already default on. Dumps go to the path prefix in TORCH_FR_DUMP_TEMP_FILE, by default /tmp/nccl_trace_rank_. Then run torchfrtrace on the dump directory. The tutorial’s example output reports that rank 1 did not join an all_reduce, which is the desync case.

For desync during development, set TORCH_CPP_LOG_LEVEL=INFO and TORCH_DISTRIBUTED_DEBUG=DETAIL. The distributed docs say this adds collective synchronization checks that confirm all ranks are synchronized. DETAIL may slow the job, so do not leave it on in production.

References: PyTorch Flight Recorder tutorial · PyTorch v2.15.0 source: ProcessGroupNCCL.hpp · PyTorch distributed communication package

Check the network and the GPUs

Set NCCL_DEBUG=INFO to print NCCL’s setup, including the interfaces and transports it chose. NCCL_DEBUG_SUBSYS filters that output and defaults to INIT,BOOTSTRAP,ENV. NCCL_DEBUG_FILE sends it to a file per process instead of stdout.

If NCCL picked the wrong network, set NCCL_SOCKET_IFNAME to the interface prefix for the data network, which bypasses automatic selection. On InfiniBand, NCCL_IB_HCA selects adapters; NVIDIA warns that mlx5_1 without a leading = also matches mlx5_10 to mlx5_19. NCCL_IB_TIMEOUT defaults to 20, and the timeout is 4.096 µs times 2 to that power.

Test the fabric without your model. NVIDIA’s nccl-tests build an all_reduce_perf binary; running it across the same GPUs shows whether collectives complete and how fast. Run nvidia-smi topo -m to see how GPUs connect, and check dmesg for NVIDIA Xid messages, explained in NVIDIA Xid errors.

Check the network and the GPUs
VariablePurposeNote
NCCL_DEBUG=INFOPrint setup and transport choicesWARN prints only errors
NCCL_DEBUG_SUBSYSFilter INFO output by subsystemDefault INIT,BOOTSTRAP,ENV
NCCL_SOCKET_IFNAMEChoose the network interfaceBypasses automatic selection
NCCL_IB_HCAChoose InfiniBand adaptersPrefix = for exact names
NCCL_P2P_DISABLE=1Turn off direct GPU-to-GPU transportDebugging only
NCCL_IB_DISABLE=1Turn off InfiniBand transportDebugging only

References: NVIDIA NCCL environment variables · NVIDIA nccl-tests · NVIDIA System Management Interface

Fixes that address the root cause

For desync, make every rank issue the same collectives in the same order. Move collectives out of rank-specific branches. Give every rank the same number of batches, for example with DistributedSampler and drop_last=True. If one rank stops early, broadcast the decision so all ranks stop together.

For slow ranks, keep long work off the critical path or make every rank wait in a controlled way. Save checkpoints asynchronously or shard them so each rank writes its part; GPU training checkpoints covers the options. Download and preprocess data before training starts.

Raise the timeout only when a long pause is expected and bounded: init_process_group(backend="nccl", timeout=timedelta(minutes=30)). A longer timeout does not fix desync; it only makes a hung job hold its GPUs for longer. NVIDIA describes NCCL_P2P_DISABLE and NCCL_IB_DISABLE as debugging settings that should not stay in production code, and vLLM’s troubleshooting guide gives the same advice.

References: PyTorch distributed communication package · NVIDIA NCCL environment variables · vLLM troubleshooting guide

NCCL timeout: symptom, check, fix

Use this table as a first pass, then confirm with the Flight Recorder output.

NCCL timeout: symptom, check, fix
SymptomLikely causeCheckFix
One rank has a lower SeqNumDesync or stalled rankFlight Recorder via torchfrtraceSame collectives on every rank
Timeout at end of an epochUneven batches per rankCount batches per rankDistributedSampler, drop_last=True
Timeout during checkpoint saveRank 0 busy past the limitTime the saveAsync or sharded checkpoints
Another rank logged OOM firstDead peerEarliest error across ranksFix the OOM, then rerun
Hangs at first collectiveWrong interface or firewallNCCL_DEBUG=INFO outputNCCL_SOCKET_IFNAME, open ports
Random timeouts on one nodeGPU or link faultdmesg Xid, nccl-testsDrain and replace the node

References: PyTorch Flight Recorder tutorial · NVIDIA NCCL environment variables · PyTorch distributed communication package · NVIDIA nccl-tests

Prevent timeouts in long jobs

Run a short smoke test across all nodes before a long job: init the process group, run a few all-reduces and one checkpoint save. Keep the Flight Recorder on and make sure dump files land on storage you can reach after the job dies. Log the hostname and GPU index with each rank so a bad node is easy to identify.

Fewer, larger hops also help. Jobs that fit on one node with NVLink avoid the inter-node network entirely; NVLink vs PCIe and single GPU vs multi-GPU explain the trade-off.

References: PyTorch Flight Recorder tutorial

When the answer is fewer, bigger GPUs

Every extra rank is another process that can stall. If your model fits on fewer GPUs with more memory, you remove collectives and the network paths they depend on. A job split across two nodes of smaller cards may fit on one node of 80 GB H100 GPUs, or the 141 GB H200 when memory is the limit. Check the fit with the VRAM calculator.

References: NVIDIA H100 specifications · NVIDIA H200 specifications

Checklist and next step

Collect the timeout line from every rank and compare SeqNum. Read the Flight Recorder dumps with torchfrtrace. Check for an earlier error on the straggler. Make collectives identical across ranks. Keep checkpoints and evaluation off the critical path. Verify the interface with NCCL_DEBUG=INFO and the fabric with nccl-tests. Raise the timeout only for bounded pauses.

If you need a multi-GPU node sized to your job, NeuraMesh rents GPUs by the hour. Choose the GPU, count, plan, hours and region on rent GPUs and you receive a confirmed quotation, typically within one business day, before anything is charged.

NeuraMesh prices for these GPUs

NeuraMesh prices per GPU-hour in USD, excluding taxes, as of 2026-11-27. Live prices are on the rental pages.
GPUMemoryData centerValue
RTX 409024 GB$0.46$0.40
L40S48 GB$1.26$0.54
A10080 GB$1.56$0.98
H10080 GB$2.88$2.00

Every order is confirmed in a quotation before you pay. See all GPU prices.

Questions readers ask

How do I increase the NCCL timeout in PyTorch?

Pass a timedelta to init_process_group, for example timeout=timedelta(minutes=30). The default is 10 minutes for NCCL. Raise it only for expected, bounded pauses such as a large checkpoint save; it will not fix ranks that issue different collectives.

What does "Watchdog caught collective operation timeout" mean?

PyTorch’s watchdog thread found a collective that had not completed within the timeout. The line names the operation, its sequence number and the limit. The process then aborts, because continuing after a failed asynchronous NCCL operation is unsafe.

How do I find which rank caused the timeout?

Compare SeqNum across all ranks’ timeout lines; the lowest marks the straggler. For certainty, read the Flight Recorder dumps with torchfrtrace, which reports ranks that did not join a collective.

Should I set NCCL_P2P_DISABLE=1?

Only as a temporary test. NVIDIA lists it under debugging variables that should not stay in production code, and it can slow communication. If it makes a hang disappear, report the driver or hardware issue and fix that instead.

Is NCCL_DEBUG=INFO safe in production?

It prints setup and transport details and is useful when a job hangs at start-up. TRACE is far more verbose. Send output to a file with NCCL_DEBUG_FILE so logs stay readable across many ranks.

Sources and editorial notes

Primary documentation reviewed November 24, 2026. Provider descriptions reflect published documentation. Recommendations are our analysis; worked figures are illustrative unless explicitly stated otherwise. No independent provider benchmark or uptime ranking is claimed.

Read the editorial policy.

Need this GPU? Rent it from NeuraMesh: choose a GPU and plan, get a confirmed quotation, and pay only when you approve. See pricing.