Diagnose RCCL Performance: AMD GPU Communication Paths and rccl-tests
RCCL (ROCm Communication Collectives Library) is the library that moves and combines data when multiple AMD GPUs take part in the same computation. If communication is slow or initialization stalls, do not rely on a benchmark number alone: first check which GPU and NIC each rank uses, which links carry the data, and whether every rank calls the same collective operation.
Diagnose RCCL Performance: AMD GPU Communication Paths and rccl-tests
RCCL (ROCm Communication Collectives Library) is the library that moves and combines data when multiple AMD GPUs take part in the same computation. If communication is slow or initialization stalls, do not rely on a benchmark number alone: first check which GPU and NIC each rank uses, which links carry the data, and whether every rank calls the same collective operation.
What does RCCL do, and what does it leave to the framework?
RCCL provides communication operations that processes call together. A rank is a process identifier within a communicator; it is not necessarily the same as a GPU index. A framework computes tensors and gradients, while RCCL moves data among ranks and performs the requested operation. For example, data-parallel training can combine gradients from each GPU and deliver the result to all participating GPUs.
| Operation | Result and use |
|---|---|
| AllReduce | Combines values from the ranks and delivers the result to every rank. Used for gradient aggregation, for example. |
| ReduceScatter | Combines the values, splits the result into rank-specific pieces, and sends one piece to each rank. |
| AllGather | Collects the piece held by each rank and delivers the complete result to every rank. |
| Broadcast | Copies data from a chosen root rank to the other ranks. Root means a communicator rank, not a GPU index. |
| Send/Recv | Exchanges data between two ranks. |
Participating ranks must follow compatible collective-call contracts. If one rank calls a different operation, or the data type, element count, or root does not match, the program can stall or fail. A RCCL call can also return after its work is enqueued on a HIP stream, before the GPU has finished it. A returned function call therefore does not prove that communication is complete; check completion through stream synchronization or a later dependent operation. RCCL library specification
Do not mistake an AllReduce sum for an average
Suppose rank 0 holds [1, 3] and rank 1 holds [5, 7], and both call sum AllReduce. Both ranks receive [6, 10]. That is the sum, not the average [3, 5]. If a training framework needs the average gradient, it must divide by the number of ranks after communication or apply an equivalent scale. Check the framework and model implementation to see where averaging happens.
Before investigating slow communication, verify that each call uses the intended communicator, operation, data type, element count, reduction operator, and stream. For multi-node runs, record each process's rank-to-GPU mapping too. The RCCL library specification describes the available collectives and their semantics.
Check the GPU and NIC paths that carry the data
Within one node, GPUs may communicate over PCIe or xGMI, depending on system topology. Between nodes, the path may use a network transport such as InfiniBand Verbs, RoCE, or TCP/IP. RCCL selects communication algorithms for the topology and operation, but measured performance depends on GPU links, NICs and switches, process placement, message size, and concurrent load. Support for a transport does not by itself guarantee that it will be selected or that a target bandwidth will be reached. RCCL overview
For initial diagnosis, separate per-rank logs make it easier to compare path selection across nodes. AMD's documentation gives these environment-variable examples:
export NCCL_DEBUG=INFO
export NCCL_DEBUG_SUBSYS=INIT,NET
export NCCL_DEBUG_FILE='rccl.%h.%p.log'RCCL uses API and environment-variable names compatible with NCCL, so an NCCL_ prefix alone does not mean that the NVIDIA NCCL library is in use. %h and %p are placeholders for the host name and process ID in the log filename. Check the documentation for your installed RCCL version to confirm the variables and log details, and turn off verbose logging when it is no longer needed. Network-interface and device-selection variables also depend on the system: compare their values with the actual configuration instead of forcing a value based only on its name. RCCL environment variables
Choose the first comparison based on the symptom
Do not infer a cause from a single number. First separate the conditions under which the problem can be reproduced. The table below reorganizes the information-collection guidance in AMD's RCCL troubleshooting documentation into symptom-specific starting points.
| Observed symptom | First items to compare | What to check next |
|---|---|---|
| Initialization error or stall at startup | ROCm/RCCL versions, GPUs and drivers, and communicator setup on every rank | Compare per-rank INIT logs and device selection for each process. |
| Single-node run works, but multi-node run times out | NIC count and names per rank, interface selection, and RDMA device state | Compare ibv_devinfo, rdma link, NCCL_SOCKET_IFNAME, and NCCL_IB_HCA settings. |
| Only small messages are slow | Message size, call frequency, and synchronization points | Examine small-message time and call frequency separately from large-message bandwidth. |
rccl-tests is fast, but actual training is slow | Rank/GPU/NIC placement, data sizes, and framework stages in the test and workload | Profile communication/computation overlap, CPU binding, and the input pipeline in the real training run. |
This is a diagnostic order, not a table that identifies causes. For example, a timeout can result from rank-level call mismatches or other resource issues as well as a NIC path. AMD recommends collecting ROCm version, GPU topology, driver and firmware, HIP settings, network information, and logs when investigating RCCL. RCCL troubleshooting
How should you read algbw and busbw in rccl-tests?
rccl-tests is a microbenchmark for examining collective correctness and communication performance separately. Its README says that MPI is needed for multi-process runs and recommends one MPI process per GPU (-g 1) for performance-focused runs. The README includes this example for eight ranks:
mpirun -np 8 --bind-to numa ./build/all_reduce_perf -b 8 -e 128M -f 2 -g 1This command is an example from the repository; it was not run here and its compatibility with any particular machine was not checked. To use it, adapt it to the built executable, MPI installation, rank-to-GPU mapping, CPU binding, and per-node NIC setup in your environment. ROCm rccl-tests README
In the output, time is the time to complete an operation at a given size and is useful when comparing latency for small messages. algbw is effective bandwidth from the algorithm's perspective. busbw is a bus-bandwidth metric adjusted to reflect collective communication volume. For AllReduce with n ranks, the rccl-tests documentation gives busbw = algbw × 2(n−1)/n. This is a benchmark-defined comparison metric, not end-to-end training throughput. Compare runs with the same message size and rank count, then check the actual model profile. rccl-tests performance notes
Narrow down the cause in a reproducible order
The sequence below preserves comparable evidence and avoids changing several settings at once. It assumes a Linux ROCm environment. Check the compatibility matrix for the release and exact GPU/OS/driver combination you plan to use. Do not assume that a value on the latest documentation page matches the version already installed on your system. ROCm compatibility matrix
**Record the run conditions.** Save `rocminfo`, `amd-smi`, and `amd-smi topology` output, ROCm/RCCL versions, node count, GPU and NIC models, and rank placement. For multi-node runs, also check `ibv_devinfo` and `rdma link`. First see whether repeating the run in the same environment reproduces the same error or variation.
**Check the collective calls.** Verify that all participating ranks call the same collectives in the same order, with matching communicator, count, data type, operator, and root. In particular, root is a rank number, and an AllReduce sum is not an average.
**Compare per-rank logs and paths.** Collect `INIT` and `NET` logs per process and check whether available NICs or selected interfaces differ by host. If `NCCL_SOCKET_IFNAME` or `NCCL_IB_HCA` is set, confirm that the intended device actually exists. Logs can contain sensitive host and device details, so review them before sharing.
**Measure communication under controlled conditions.** With a supported `rccl-tests` build, change one condition at a time while comparing message sizes and rank counts. If an error occurs, resolve correctness or initialization problems before interpreting speed. Record the command, version, placement, `time`, `algbw`, and `busbw` with each result.
**Return to the real workload.** Run training or inference with the same placement and inspect a profile. Separate communication time and communication/computation overlap from CPU binding, input processing, and model synchronization. Remove temporary debug settings afterward, and do not keep forced path settings whose benefit was not established.
This order turns “the communication library is slow” into separate questions about rank mapping, call contracts, transport paths, message size, and the actual framework bottleneck. Until the cause is confirmed in a specific environment, do not treat one environment variable or topology change as a universal fix.
References
[AMD ROCm: What is RCCL?](https://rocm.docs.amd.com/projects/rccl/en/latest/what-is-rccl.html)
[AMD ROCm: RCCL Library Specification](https://rocm.docs.amd.com/projects/rccl/en/latest/api-reference/library-specification.html)
[AMD ROCm: Troubleshooting RCCL](https://rocm.docs.amd.com/projects/rccl/en/latest/how-to/troubleshooting-rccl.html)
[AMD ROCm: RCCL Environment Variables](https://rocm.docs.amd.com/projects/rccl/en/latest/api-reference/env-variables.html)
[ROCm `rccl-tests` README](https://github.com/ROCm/rocm-systems/blob/develop/projects/rccl-tests/README.md)
[ROCm `rccl-tests` Performance](https://github.com/ROCm/rocm-systems/blob/develop/projects/rccl-tests/doc/PERFORMANCE.md)
[AMD ROCm Compatibility Matrix](https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html)
[AMD ROCm 10.2.0 Release Notes](https://rocm.docs.amd.com/en/docs-10.2.0/about/release-notes.html)