Skip to content

NCCL Hang Detection: Flight Recorder & Watchdog

Detect and diagnose silent NCCL collective hangs early using TORCH_NCCL_TRACE_BUFFER_SIZE flight recorder dumps and per-rank stack traces.

Quick answer

Silent NCCL hangs freeze GPU utilization at 0% until the ProcessGroupNCCL watchdog fires. Enable `TORCH_NCCL_TRACE_BUFFER_SIZE` and `TORCH_NCCL_DUMP_ON_TIMEOUT=1` to capture in-flight collective sequence numbers and pinpoint which rank never entered the barrier.

Root cause
NCCL watchdog timeout is 30 minutes default. Hangs without errors are hard to detect. NCCL_DEBUG=INFO adds overhead.
Recommended fix
TORCH_NCCL_TRACE_BUFFER_SIZE=16384
How Denpex helps
Denpex investigates NCCL Hang Detection: Flight Recorder & Watchdog using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
Communication#nccl#hang#detection#monitoring#distributed#heartbeat

What this failure is

NCCL Hang Detection is a Communication failure seen during ML training runs. NCCL hangs can be hard to detect because they don't produce errors until the watchdog timeout. Proper monitoring helps catch them early. Common tags: Nccl, Hang, Detection, Monitoring.

Live diagnosis, no signup

Is this what broke your run? Paste your log.

You're reading about NCCL Hang Detection: Flight Recorder & Watchdog. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.

Before uploading, review cloud data handling and local options.

training_logs.txt
No log to hand? Try one:

Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.

3 free cloud diagnoses per day

Why it happens (the mechanism)

NCCL watchdog timeout is 30 minutes default. Hangs without errors are hard to detect. NCCL_DEBUG=INFO adds overhead. No native monitoring in NCCL. Taken together, these mechanisms explain why the failure is reproducible, why it tends to surface on specific workloads or scales, and why generic mitigation attempts often fall short without addressing the underlying cause.

What you'll observe

  • Training hangs with no error
  • NCCL operation takes longer than expected
  • No error message before hang

Common symptoms and what they mean

Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.

SymptomPossible explanation
GPU utilization drops to 0% on some ranksNCCL watchdog timeout is 30 minutes default
NCCL operation never completesHangs without errors are hard to detect
No progress for minutes or hoursNCCL_DEBUG=INFO adds overhead

Which systems are affected

  • Multi-node training with NCCL
  • Production distributed training
  • Long-running training jobs

How to confirm this is the problem

Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.

  • ✓Compare per-rank Flight Recorder dumps or `WorkNCCL(SeqNum=...)` counters to find the lowest sequence number or earliest stalled worker.
  • ✓Check host `dmesg` and process exit status on non-reporting nodes before assuming the network fabric stalled.

Root cause

  • NCCL watchdog timeout is 30 minutes default
  • Hangs without errors are hard to detect
  • NCCL_DEBUG=INFO adds overhead
  • No native monitoring in NCCL

The fix and how to prevent it

How to fix it

  • Set `TORCH_NCCL_TRACE_BUFFER_SIZE=16384` and `TORCH_NCCL_ASYNC_ERROR_HANDLING=1` so collective timeouts abort cleanly with trace evidence.
  • Resolve the divergent branch, DataLoader stall, or host Xid fault on the lagging rank rather than raising timeout thresholds blindly.

How to prevent it

  • Implement heartbeat monitoring with periodic heartbeats
  • Use NCCL_HEARTBEAT_TIMEOUT_SEC for faster hang detection
  • Monitor per-rank GPU utilization for stuck ranks
  • Use Denpex to monitor NCCL operations for hangs
  • Set NCCL_TIMEOUT=600 for faster timeout in production

Save this diagnosis and catch the next crash automatically

All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.

Or start a 30-day free Team trial (work email)

Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.

Use your company email, for example alex@yourcompany.com.

Who qualifies?

Company email domains activate the free 30-day Team evaluation (up to 50 diagnoses a day) after an email and domain check, whatever mail provider you use. If we cannot verify your domain automatically, support reviews it: write to support@denpex.com. Free local diagnosis in the editor extension needs no account.

Using a personal email (Gmail, Outlook, Naver, QQ) or solo cluster? Create a free $0 account (no work email required) to save 7-day history and unlock AI fallback, or send a cluster crash log for a live walkthrough.
Already have an account? Sign in

Diagnose your own log automatically

The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.

Sign up free. Analyze your cluster logs

No credit card. Daily allowance follows verified trust tier. Instant access.

Diagnose this failure in VS Code

Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.

Install the free VS Code extension

NCCL errors in context

An NCCL error can follow an earlier worker failure. The hub connects documented collective errors with their interpretation limits, worker evidence and configuration checks.

Compare related nccl errors

Don't just read the fix, diagnose your run

The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.