PYTORCH NCCL Backend Environment Variables#
Created On: Oct 25, 2026 | Last Updated On: Oct 25, 2026
These variables configure the nccl, nccl-lazy and nccl-legacy backends. Each entry below states which backends read it: nccl-legacy only, All NCCL backends, or the backends it applies to.
nccl-legacy records into the flight recorder natively and dumps it itself. For nccl, nccl-lazy and other backends without native support, FlightRecorderHook records and dumps the trace. The recorder reads the buffer size, C++ stack and dump file variables; the dump-on-failure variables are read by nccl-legacy or by FlightRecorderHook, as noted per entry. Where both are read, the TORCH_FR_* name takes precedence over its TORCH_NCCL_* alias.
Variable |
Description |
|---|---|
|
All backends. If set to |
|
All NCCL backends. Control how we perform Async Error Handling with NCCL when an exception is observed in watchdog. If set to 0, no handling of asynchronous NCCL errors. If set to 1, aborting NCCL communicator and tearing down process upon error. If set to 2, only abort NCCL communicator and if set to 3, tearing down process without aborting NCCL communicator. By default, it is set to 3; |
|
All NCCL backends. Control whether to use high priority stream for the NCCL communicator. Default: |
|
All NCCL backends. Control whether or not wait() is blocking or non-blocking. Default: |
|
All NCCL backends. If set to |
|
nccl-legacy only. Timeout in seconds for nonblocking NCCL communicator operations (init, abort, finalize). Default: |
|
All NCCL backends. Number of ranks each root covers during scalable NCCL communicator init; groups larger than this use multiple roots. |
|
nccl-legacy only. Whether to broadcast the NCCL unique ID through the store when creating a communicator. Default: |
|
All NCCL backends. Whether to reuse CUDA events through a cache instead of creating and destroying them per collective. Destroying a CUDA event while the CUDA global lock is held can hang. Default: |
|
nccl-legacy only. If set to |
|
nccl-legacy only. Whether to warn that point-to-point operations are serialized when the communicator is eagerly initialized. Default: |
|
nccl-legacy only. Control whether Desync Debug is enabled. This is helpful in figuring out the culprit rank of collective desync. |
|
All NCCL backends. If set to |
|
nccl-legacy only. If set to |
|
nccl-legacy only. Control the watchdog heartbeat timeout period after which the monitoring thread will abort the process. Default: |
|
nccl-legacy only. If set to |
|
nccl-legacy only. Whether the watchdog rethrows CUDA errors. Default: |
|
nccl-legacy only. If set to |
|
nccl-legacy only. Whether to log C++ stack traces on unclean shutdown. Default: |
|
nccl-legacy only. Control the interval inside the monitoring thread to check the coordinated signal from other ranks, e.g. to dump the debugging information. Default value is 1000 ms. |
|
All NCCL backends. Control how much extra time we will wait for dumping the debugging info before we exit and throws timeout exception. |
|
|
|
|
|
All NCCL backends. Control whether dumping debug info on watchdog timeout or exception is detected. |
|
All NCCL backends. The maximum number of events we store in the flight recorder’s ring buffer. One event could be the start or end of a collective, for example. Set to 0 to disable recording. Default: |
|
All NCCL backends. Whether to collect cpp stack traces for flight recorder. Default: |
|
All NCCL backends. Prefix of the file into which the debugging info is dumped; the rank is appended. Default: |
|
All NCCL backends. If set to |
|
All NCCL backends. Whether a flight recorder dump on timeout or failure includes stack traces. If the dump does not finish within the wait timeout, it is retried without them. Default: |
|
All NCCL backends. Whether a flight recorder dump includes only collectives that have not completed. Default: |
|
nccl-legacy only. If set to |
|
nccl-legacy only. The pipe file to trigger debugging dump manually, write anything into the pipe would trigger the dump. |
|
nccl-legacy only. Control whether to enable NAN check for the input, Error would be thrown if NAN is detected. For other backends, including |
|
|