Skip to content

Operator task guide

How to run nccl-tests all_reduce_perf to benchmark InfiniBand and NVLink

NVIDIA nccl-tests (all_reduce_perf, all_gather_perf, alltoall_perf) isolates collective communication performance from PyTorch and dataloader noise. Always evaluate bus bandwidth (busbw) at large message sizes (1 GB to 8 GB) against your theoretical fabric ceiling before launching a multi-node run.

If single-node NVLink busbw is healthy but multi-node busbw drops to Ethernet speeds or hangs, NCCL fell back to Socket instead of NET/IB or hit a degraded InfiniBand/RoCE port. Inspect NCCL_DEBUG=INFO startup lines alongside ibstat and port error counters.

Reviewed . Reference guidance is not a diagnosis of your workload.

Step-by-step method

  1. 1

    Build or run nccl-tests inside your production container image

    Compile NVIDIA/nccl-tests against the exact MPI, CUDA, and NCCL libraries used by your training image, or use an NGC PyTorch container that includes prebuilt nccl-tests.

    git clone https://github.com/NVIDIA/nccl-tests.git
    cd nccl-tests
    make MPI=1 MPI_HOME=/usr/lib/x86_64-linux-gnu/openmpi CUDA_HOME=/usr/local/cuda
  2. 2

    Run single-node NVLink all_reduce_perf baseline

    Verify full intra-node NVLink/PCIe bandwidth on one node first before testing cross-node InfiniBand links.

    ./build/all_reduce_perf -b 8 -e 8G -f 2 -g 8
  3. 3

    Run multi-node InfiniBand all_reduce_perf with NCCL_DEBUG=INFO

    Launch across allocated Slurm or MPI nodes and verify NCCL reports NET/IB GPUDirect RDMA rather than NET/Socket.

    NCCL_DEBUG=INFO srun --nodes=4 --ntasks-per-node=8 --gpus-per-node=8 \
      ./build/all_reduce_perf -b 8 -e 8G -f 2 -g 1
  4. 4

    Compare busbw across pairwise nodes to isolate a degraded cable or HCA

    If 16-node busbw drops below expected InfiniBand throughput, run pairwise 2-node all_reduce_perf sweeps and inspect perfquery / ethtool error counters on the slowest pair.

    ibstat
    perfquery -x | grep -iE 'XmtWait|RcvErrors|LinkDowned|SymbolError'

nccl-tests diagnostic signals

Signals, meanings and actions for how to run nccl-tests all_reduce_perf to benchmark infiniband and nvlink.
SignalWhat it meansNext action
Single-node busbw matches spec, multi-node drops to ~1 to 10 GB/sNCCL fell back to TCP Socket or hit unconfigured RDMA.Check NCCL_DEBUG=INFO for NET/IB vs NET/Socket and verify IB/RoCE HCA bindings.
AllReduce hangs in nccl-tests across specific nodesFabric routing, firewall, or physical port/transceiver issue.Run ib_write_bw pairwise and check switch/port counters.
Out-of-bounds or numerical check error in nccl-tests (# wrong)Silent data corruption or bad link integrity.Drain involved nodes immediately and inspect ECC and NVLink/IB CRC errors.
alltoall_perf degrades much worse than all_reduce_perfIncast congestion or ECN/PFC tuning issue on MoE/EP traffic.Inspect RoCEv2 PFC/ECN or IB adaptive routing configuration.

Evidence checklist

  • Full all_reduce_perf stdout table (algbw, busbw, and # wrong column)
  • NCCL_DEBUG=INFO initialization lines showing NET/IB vs NET/Socket
  • ibstat and perfquery port counters on participating nodes
  • nvidia-smi topo -m GPU-to-NIC affinity map
  • MPI/Slurm launch flags and NCCL environment overrides

Common mistakes

Reading algbw instead of busbw

busbw reflects true hardware link utilization adjusted for the collective algorithm factor (2*(n-1)/n for ring AllReduce).

Benchmarking only tiny 4 MB tensors

Small messages measure latency; saturate 1 GB to 8 GB payloads to test real NVLink and InfiniBand bandwidth.

Ignoring the # wrong verification column

Any non-zero value in # wrong indicates transport corruption that will poison training weights.

Frequently asked questions

What is the difference between algbw and busbw in nccl-tests?

algbw is raw data size divided by time. busbw scales algbw by the collective algorithm communication factor so you can compare measured throughput directly against physical NVLink or InfiniBand hardware bandwidth.

What flags should I pass to all_reduce_perf on 8-GPU nodes?

For one process managing 8 GPUs, pass -g 8. When launching 1 MPI rank or srun task per GPU, pass -g 1 with -b 8 -e 8G -f 2.

How do I test MoE Expert Parallelism traffic with nccl-tests?

Run alltoall_perf across all nodes, because Expert Parallelism relies heavily on AllToAll exchanges that expose congestion and tail-latency hotspots missed by ring AllReduce.

Why does nccl-tests work on CoreWeave or Slurm nodes individually but slow down together?

A single degraded InfiniBand transceiver, miswired rail, or asymmetric NUMA-to-NIC pinning throttles the synchronous collective for the entire job. Pairwise 2-node tests isolate the slow link.

Live diagnosis, no signup

Upload your GPU log. Find what happened first.

Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.

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

Try Denpex for 30 days. FREE.

No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.

Start your free 30-day Team evaluation

Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.

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.

Apply the method to your incident

Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.

Diagnose your incident