NCCL Test Benchmark Kubernetes
Run NCCL tests on Kubernetes for GPU communication benchmarking. all_reduce_perf, all_gather_perf, multi-node bandwidth, and latency validation.
π‘ Quick Answer: Run
all_reduce_perf -b 8 -e 2G -f 2 -g 1in GPU pods and trackalgbw/busbwover message sizes to validate real cluster throughput. Useall_gather_perfwith the same flags for collective-specific gather bandwidth.
The Problem
All-reduce and all-gather are the key communication primitives for distributed training. Before trusting a cluster with a multi-day training job, you need a fast, repeatable way to confirm the GPU interconnect and network fabric actually deliver the expected bandwidth.
The Solution
Baseline Command
all_reduce_perf -b 8 -e 2G -f 2 -g 1-b 8β start at 8 bytes-e 2Gβ sweep up to 2 GB-f 2β multiply size by 2 each step-g 1β GPUs per process (adjust for multi-GPU-per-rank runs)
For all-gather instead of all-reduce, swap the binary:
all_gather_perf -b 8 -e 2G -f 2 -g 1Recommended Matrix
Run each test across these topologies to isolate where bottlenecks appear:
- Single node, 2 GPUs
- Single node, all local GPUs
- Two nodes, 1 GPU per node
- Two nodes, multiple GPUs per node
What to Capture
algbwandbusbw(algorithm and bus bandwidth) at each message size- GPU model and driver version
- Node pair tested
- CNI/network path used (NVLink, InfiniBand, RoCE, etc.)
Pass Criteria
- Stable bandwidth at medium and large message sizes
- No repeated NCCL transport warnings in the log output
- Inter-node results align with the link capabilities (e.g., near-line-rate on InfiniBand/RoCE)
Common Issues
Bandwidth far below link speed on multi-node runs
Usually a transport fallback β check for NCCL INFO NET/Socket in logs, which means NCCL fell back to TCP instead of using RDMA. Verify GPUDirect RDMA is active (see nvidia-peermem-gpudirect-rdma-k8s).
Results vary run-to-run
Check for noisy neighbors on the same NIC/switch, or CPU governor throttling. Pin NCCL to specific interfaces with NCCL_SOCKET_IFNAME / NCCL_IB_HCA (see nccl-environment-variables-guide).
Best Practices
- Always run the full size sweep (
-b 8 -e 2G) β small-message latency and large-message bandwidth fail independently - Baseline single-node before testing multi-node β isolates NVLink/PCIe issues from network issues
- Re-run after any driver, CNI, or NCCL version upgrade β regressions here are silent until training jobs slow down
- Store results per node-pair so historical comparisons catch fabric degradation early
Key Takeaways
all_reduce_perfandall_gather_perfare the standard NCCL collective benchmarks- Test single-node and multi-node topologies separately to localize bottlenecks
algbw/busbwat large message sizes is the number that matters for real training throughput- NCCL falling back to TCP sockets instead of RDMA is the most common cause of bad multi-node numbers
π Go Further with Kubernetes Recipes
Love this recipe? Thereβs so much more! This is just one of 100+ hands-on recipes in our comprehensive Kubernetes Recipes book.
Inside the book, youβll master:
- β Production-ready deployment strategies
- β Advanced networking and security patterns
- β Observability, monitoring, and troubleshooting
- β Real-world best practices from industry experts
βThe practical, recipe-based approach made complex Kubernetes concepts finally click for me.β
π Get Your Copy Now β Start building production-grade Kubernetes skills today!

Recommended
Kubernetes Recipes β The Complete Book100+ production-ready patterns with detailed explanations, best practices, and copy-paste YAML. Everything in one place.
Get the Book βLearn by Doing
CopyPasteLearn β Hands-on Cloud & DevOps CoursesMaster Kubernetes, Ansible, Terraform, and MLOps with interactive, copy-paste-run lessons. Start free.
Browse Courses βπ Deepen Your Skills β Hands-on Courses
Courses by CopyPasteLearn.com β Learn IT by Doing
