πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
ai advanced ⏱ 20 minutes K8s 1.28+

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.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: Run all_reduce_perf -b 8 -e 2G -f 2 -g 1 in GPU pods and track algbw/busbw over message sizes to validate real cluster throughput. Use all_gather_perf with 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 1

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

  • algbw and busbw (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_perf and all_gather_perf are the standard NCCL collective benchmarks
  • Test single-node and multi-node topologies separately to localize bottlenecks
  • algbw/busbw at 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!

#nccl #benchmark #gpu #all-reduce
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens