Skip to content

torchrun ChildFailedError error_file <N/A> Triage

Recover the real Python exception or OOM signal behind torch.distributed.elastic ChildFailedError error_file <N/A> using --redirects 3 and dmesg checks.

Quick answer

ChildFailedError with error_file: <N/A> is only the torchrun supervisor wrapper announcing a worker exited unexpectedly without writing a record file. Check the exitcode first (negative values such as -9 indicate OS SIGKILL / OOM kill outside Python, leaving no file), and launch with --log-dir plus --redirects 3 or @record to capture the real worker traceback.

Symptom
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
train.py FAILED
------------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2026-11-25_06:14:22
  host      : gpu-node-02
  rank      : 2 (local_rank: 2)
  exitcode  : -9 (pid: 48120)
  error_file: <N/A>
  traceback : Signal 9 (SIGKILL) received by PID 48120
Root cause
Worker terminated via external signal (-9/-11) before Python exception handling, or failed without torchelastic error recording/redirected worker logs.
Recommended fix
Inspect exitcode and signal lines inside ChildFailedError: exitcode -9 means OS SIGKILL (check host dmesg -T | grep -i oom and Slurm sacct MaxRSS), while exitcode -11 means native segfault/core dump (inspect native CUDA extensions and fault handler).
How Denpex helps
Denpex investigates torchrun ChildFailedError error_file <N/A> Triage 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.
Distributed Training#torchrun#torchelastic#child-failed-error#sigkill#distributed

What this failure is

A PyTorch Elastic supervisor exception raised when a spawned training worker fails without serializing an error_file payload.

Live diagnosis, no signup

Is this what broke your run? Paste your log.

You're reading about torchrun ChildFailedError error_file <N/A> Triage. 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)

error_file reads <N/A> either because the worker died via a hard OS signal (-9 SIGKILL from Linux OOM killer or container eviction, -11 SIGSEGV from native CUDA/C++ crash) before Python could trap anything, or because the worker function did not use @torch.distributed.elastic.multiprocessing.errors.record and child stdout/stderr were not persisted.

What you'll observe

  • Training dies with a large torchrun ChildFailedError block showing error_file : <N/A> on rank 0 or rank N
  • Cluster log tailing truncates child worker stderr leaving only the supervisor summary

Common symptoms and what they mean

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

SymptomPossible explanation
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ... failed (exitcode: -9) ... error_file : <N/A>Worker terminated via external signal (-9/-11) before Python exception handling, or failed without torchelastic error recording/redirected worker logs.
exitcode: 1 with error_file : <N/A> hiding the Python exceptionWorker terminated via external signal (-9/-11) before Python exception handling, or failed without torchelastic error recording/redirected worker logs.

Which systems are affected

  • PyTorch torchrun and torch.distributed.elastic training jobs
  • Slurm and Kubernetes multi-GPU training pods

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.

  • ✓Reproduce cleanly once and confirm either per-rank log files preserve the exact Python traceback or kernel dmesg confirms external SIGKILL.

Root cause

  • Worker terminated via external signal (-9/-11) before Python exception handling, or failed without torchelastic error recording/redirected worker logs.

The fix and how to prevent it

How to fix it

  • Inspect exitcode and signal lines inside ChildFailedError: exitcode -9 means OS SIGKILL (check host dmesg -T | grep -i oom and Slurm sacct MaxRSS), while exitcode -11 means native segfault/core dump (inspect native CUDA extensions and fault handler).
  • For exitcode 1 without traceback, relaunch torchrun with --log-dir /shared/logs/$SLURM_JOB_ID --redirects 3 --tee 3 so every rank writes separate stdout/stderr files before supervisor teardown.
  • Optionally decorate your training entrypoint with @torch.distributed.elastic.multiprocessing.errors.record for structured Python error_file capture.

Step-by-step remediation

  1. 1Check whether exitcode is negative (OS signal such as -9 SIGKILL or -11 SIGSEGV) or positive Python exit 1.
  2. 2On -9, inspect dmesg or sacct MaxRSS for host RAM cgroup kills rather than Python logs.
  3. 3Re-run with --log-dir and --redirects 3 (and optionally @record) so the full child traceback survives.

How to prevent it

  • Always pass --log-dir and --redirects 3 on multi-node torchrun jobs so no child traceback is lost when rank 0 tears down
  • Correlate negative exitcodes directly with host kernel OOM and Xid telemetry

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

Searchable error signature

search key
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
train.py FAILED
------------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2026-11-25_06:14:22
  host      : gpu-node-02
  rank      : 2 (local_rank: 2)
  exitcode  : -9 (pid: 48120)
  error_file: <N/A>
  traceback : Signal 9 (SIGKILL) received by PID 48120

Use this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.

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.

Why the recommended fix works

Separating negative OS signal codes from exitcode 1 avoids chasing Python bugs on a kernel OOM kill, while --log-dir and --redirects 3 capture exact child rank stderr before torchrun exits.

Code examples

snippet
torchrun --nnodes=2 --nproc_per_node=8 \
  --log-dir /tmp/torchrun_logs \
  --redirects 3 --tee 3 \
  train.py
# When exitcode is -9 (SIGKILL):
dmesg -T | grep -iE 'killed process|oom-killer|out of memory'

This snippet illustrates the entry-specific check. Verify the installed versions, permissions, target and workload context before using it. A command or API example is not proof of recovery.

Best practices by model family

Model / StackRecommendationNotes
exitcode: -9 (SIGKILL)Inspect host dmesg OOM killer and cgroup/Slurm MaxRSSOS terminated the worker before Python could write error_file.
exitcode: 1 + error_file: <N/A>Add --log-dir and --redirects 3 plus @record decoratorRetains per-rank stderr files even when supervisor exits.

With the fix vs without the fix

DimensionWith the fixWithout the fix
Worker log capturePer-rank --log-dir + --redirects 3Supervisor ChildFailedError <N/A> after child stdout scrolled off
Signal -9 handlingHost RAM cgroup & sacct checkDebugging PyTorch code for an OS kernel SIGKILL

Diagnostic note

“Negative exit codes in torchrun (especially -9) cannot produce a Python error_file because SIGKILL bypasses user-space signal handlers completely. Always read the negative code first.”

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

torchrun errors in context

torchrun startup hangs and EADDRINUSE crashes trace back to rendezvous endpoints, world-size mismatches, or earlier rank initialization exits.

Compare related torchrun errors

Frequently asked questions

Questions engineers and on-call staff commonly ask about this failure.

Why does error_file say <N/A> even though PyTorch raised an exception?
Unless the entrypoint uses torchelastic's @record decorator, Python uncaught exceptions print only to that rank's stderr rather than generating an error JSON file, or the process was killed by an OS signal like SIGKILL (-9).
Does rank 0 in Root Cause always mean rank 0 caused the crash?
TorchElastic prints the earliest worker failure it observed first, which may be rank 2 or rank 0; always check the listed rank index and compare logs across all workers.

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.