Finds the best NCCL communication configuration for distributed training with clear separation of intra-node and inter-node bandwidth metrics.
GPU topology — nvidia-smi topo -m to detect NVLink vs PCIe.
RDMA check — ibv_devinfo PORT_ACTIVE state for InfiniBand/RoCE.
NCCL_IB_* env-vars.Intra-node all-reduce — sweeps NCCL_SOCKET_IFNAME × NCCL_NET_GDR_LEVEL ×
NCCL_IB_TIMEOUT, runs all_reduce_perf -g <N>, picks best bus bandwidth.
Intra-node P2P — p2p_bw for GPU↔GPU pair bandwidth (if available).
Inter-node benchmark — if nodes= passed, runs MPI all_reduce_perf across nodes;
otherwise emits a ready-to-run command.
ToolPurposeInstallnvidia-smiGPU info + topologyNVIDIA driveribv_devinfoRDMA detectionapt install ibverbs-utils``all_reduce_perfCollective benchmarkSee belowp2p_bwPeer-to-peer benchmarkSame nccl-tests buildmpirunInter-node benchmarkapt install openmpi-bin
bash
git clone https://github.com/NVIDIA/nccl-tests.git
cd nccl-tests
# For V100 (sm_70), A100 (sm_80), A800 (sm_80), H100 (sm_90):
make -j$(nproc) CUDA_HOME=/usr/local/cuda \
NVCC_GENCODE="-gencode=arch=compute_80,code=sm_80"
export PATH=$PWD/build:$PATH
bash
# Intra-node only
openclaw skill run nccl_optimizer
# Include inter-node benchmark (requires passwordless SSH + MPI)
openclaw skill run nccl_optimizer "nodes=10.0.0.1,10.0.0.2"
MetricWhat it measuresAll-reduce bus BW (intra)Collective throughput across local GPUs — relevant for single-node trainingP2P bandwidthGPU↔GPU direct copy speed (NVLink ≫ PCIe)All-reduce bus BW (inter)Collective throughput across nodes — bottleneck for multi-node training
(N-1)/N × data / time. Compare at same N.