You need to enable JavaScript to run this app.
GPU Compute Service

GPU Compute Service

Copy page
Download PDF
Performance testing/tuning
HPC-Single-node/multi-node NCCL test (Easy_NCCL)
Copy page
Download PDF
HPC-Single-node/multi-node NCCL test (Easy_NCCL)
This topic mainly introduces how to easily verify the NCCL performance of HPC-optimized instances. This eliminates complex steps for verification, such as dependency installation, compilation, port configuration, and password-free setup.​
  • NCCL (Nvidia Collective Multi-GPU Communication Library, pronounced "Nickel") is a library that provides inter-GPU communication primitives. It provides topology awareness and can be easily integrated into applications. NCCL is optimized many times to achieve high communication speeds over PCIe, NVLink, and InfiniBand. NCCL supports a large number of GPU cards installed on one node or multiple nodes and can be used for one process or multiple processes (such as MPI) applications.​
  • For information about the configuration of HPC-optimized instances, such as GPU and RDMA, please refer to Instance specifications. Instance type ebmhpcpni3l and type hpcpni3h are in Beta. If you need a trial, please contact your account manager to apply.​
Performance metric​
One of the key metrics for evaluating NCCL performance is bandwidth (the "busbw" in the test output). Bandwidth is further divided into algorithm bandwidth and bus bandwidth. For collective operations (such as allreduce, reduce-scatter), algorithm bandwidth varies with the number of nodes. The bus bandwidth is relatively stable and not affected by the number of nodes. Bus bandwidth refers to the total amount of data that a bus can transmit per unit time, which provides a more stable and consistent reference for hardware capability comparison.​
In this topic, the example of testing NCCL bus bandwidth is used to illustrate the NCCL communication efficiency and hardware utilization in different scenarios. ​This can help targeted adjustments and optimizations in actual applications.​
Configuration environment preparation​
  1. You have at least one HPC-optimized instance created. This topic uses two instances as an example, named node 1 and node 2 respectively. The basic configuration of each instance is as follows:​
  • Both instances are associated with EIPs which enable instance access to the internet.​
  • The HPC-optimized instances in this topic are created based on Ubuntu 20.04. You can also choose other images.​
  1. Refer to Logging in to Linux instances to log in to each node and then complete the following actions.​
  • Make sure that the GPU driver and CUDA toolkit are installed.​
  • Execute the following commands respectively to confirm whether the GPU driver and CUDA toolkit are installed. If you have no GPU driver and CUDA toolkit installed, install the CUDA toolkit and then install GPU driver.​
  • ​
    nvidia-smi​
    /usr/local/cuda/bin/nvcc -V​
    ​
  • If the following information is returned, the GPU driver and CUDA toolkit are installed.​
  • ​alt​​
  • ​alt​​
  • Make sure that the NVIDIA Container Toolkit is installed. For specific operations, refer to Nvidia official guide.​
  • Check whether the resource is being used.​
  • To run the mpirun program, port 22223 is required. Execute the following commands in sequence to check the information of processes occupying this port and then terminate the processes (if any).​
  • ​
    lsof -i:22223 # View the process information occupying the target port​
    kill <PID> # Replace <PID> with the ID of the process occupying the target port​
    ​
Procedure​
Step 1: Start and enter the container​
  1. Execute the following commands on each node to start the container.​
  • Execute following commands on node 1:​
  • ​
    docker run -itd \​
    --gpus all --net=host \​
    --shm-size=100g \​
    --ulimit memlock=-1 \​
    --ulimit stack=67108864 \​
    --privileged --ipc=host \​
    --security-opt seccomp=unconfined \​
    --cap-add=ALL \​
    -v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ \​
    iaas-gpu-cn-beijing.cr.volces.com/iaas_health/easy_nccl:ubuntu2204_cuda121_python310_nccl221_p22223 bash ​
    ​
  • Execute following commands on node 2:​
  • ​
    docker run -itd \​
    --gpus all --net=host \​
    --shm-size=100g \​
    --ulimit memlock=-1 \​
    --ulimit stack=67108864 \​
    --privileged --ipc=host \​
    --security-opt seccomp=unconfined \​
    --cap-add=ALL \​
    -v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ \​
    iaas-gpu-cn-beijing.cr.volces.com/iaas_health/easy_nccl:ubuntu2204_cuda121_python310_nccl221_p22223 bash ​
    ​
  1. Execute the following commands on node 1 and node 2 to enter the container bash environment.​
  • ​
    docker exec -it <container_id> bash ​
    ​
  • To obtain the container_id, execute the docker ps command.​
Step 2: Run NCCL test​
Execute the corresponding commands in the table below based on the instance type for NCCL test.​
tip​
  • The descriptions of NCCL-related arguments in the commands are as follows:​
  • ​
    Environment variable​
    Description​
    NCCL_IB_HCA​
    Specify the RDMA network interfaces used for communication. Please fill in the corresponding values based on the RDMA configuration corresponding to the instance type. For example, mlx5_1:1 ~ mlx5_8:1 for an 8-card package, mlx5_1:1 ~ mlx5_4:1 for a 4-card package, and mlx5_1:1 for a 1-card package. Details of the recommended configuration for each instance type can be found in the following commands.​
    NCCL_IB_DISABLE​
    Specify whether to disable RDMA communication. If this variable is set to 1, TCP communication (not RDMA communication) is enabled. If this variable is set to 0 (recommended), the RDMA communication is enabled.​
    NCCL_SOCKET_IFNAME​
    ​Specify the IP interface used for communication. Set it to the host network interface such as eth0. You can query the host network interface by executing the ip a command.​
    NCCL_IB_GID_INDEX​
    Specify the RDMA communication priority. Execute the show_gids command to verify the gid index (group identifier index) of the corresponding RoCE network interface.​
    NCCL_DEBUG​
    The debug log level output by NCCL​. INFO (information level) is recommended.​
    ​
  • Replace the IP after -H with the private IP address of the primary network interface for each instance. Format: <IP of node 1>:8,<IP of node 2>:8. The positions can be exchanged. To view the private IP address, please refer to Viewing instance information.​
​
ebmhpcpni2l / ebmhpcpni2 / ebmhpchfpni2 / hpcpni2
ebmhpcpni3l / hpcpni3ln
hpcpni3h
​
​
Configuration​
Action on node 1​
Action on node 2​
2 nodes with 16 GPU graphics cards​
​
mpirun​
--mca plm_rsh_no_tree_spawn 1 \​
-mca btl_tcp_if_include eth0 \​
-bind-to socket \​
-mca pml ob1 -mca btl '^uct' \​
-x NCCL_IB_HCA=mlx5_1:1,mlx5_2:1,mlx5_3:1,mlx5_4:1 \​
-x NCCL_IB_DISABLE=0 \​
-x NCCL_SOCKET_IFNAME=eth0 \​
-x NCCL_IB_GID_INDEX=3 \​
-x NCCL_DEBUG=INFO \​
-x LD_LIBRARY_PATH=$LD_LIBRARY_PATH \​
--allow-run-as-root \​
-H <private IP address of node 1>:8,<private IP address of node 2>:8 \​
/root/nccl-tests/build/all_reduce_perf -b 256M -e 8G -f 2 -g 1​
​
​
No action​
1 node with 8 GPU graphics cards​
​
mpirun​
--mca plm_rsh_no_tree_spawn 1 \​
-mca btl_tcp_if_include eth0 \​
-bind-to socket \​
-mca pml ob1 -mca btl '^uct' \​
-x NCCL_IB_HCA=mlx5_1:1,mlx5_2:1,mlx5_3:1,mlx5_4:1 \​
-x NCCL_IB_DISABLE=0 \​
-x NCCL_SOCKET_IFNAME=eth0 \​
-x NCCL_IB_GID_INDEX=3 \​
-x NCCL_DEBUG=INFO \​
-x LD_LIBRARY_PATH=$LD_LIBRARY_PATH \​
--allow-run-as-root \​
-H <private IP address of node 1>:8 \​
/root/nccl-tests/build/all_reduce_perf -b 256M -e 8G -f 2 -g 1​
​
​
​
​
​
The sample result is shown in the picture below.​
​alt​​
Example baseline​
warning​
The example baseline provided in this topic is for reference only. The actual bus bandwidth value may vary with hardware specification, system settings, and application scenarios.​
​
ebmhpcpni2 / ebmhpchfpni2 / hpcpni2
ebmhpcpni2l
ebmhpcpni3l
hpcpni3ln
​
​
Instance quantity​
Action type​
Bus bandwidth (busbw, GB/s)​
2​
allreduce​
97.42​
​
alltoall​
22.77​
​
reduce_scatter​
97.44​
​
all_gather​
96.96​
1​
allreduce​
233.59​
​
alltoall​
219.25​
​
reduce_scatter​
229.07​
​
all_gather​
222.43​
​
sendrecv​
149.83​
​
​
​
​
Last updated: 2026.02.02 10:05:12