Costs
The tutorial includes the following chargeable resources:Prerequisites
-
Set up the interface that you are going to use:
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
Install and configure the Nebius AI Cloud CLI. -
Get the IDs of the default subnet and the
k8s-node-group-sadefault service account:- CLI
- Go SDK
- Python SDK
- JavaScript SDK
- Install kubectl and Helm.
Steps
Set up a Managed Service for Kubernetes cluster with GPUs and InfiniBand
-
Create a GPU cluster:
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
-
Create a Managed Service for Kubernetes cluster with a public endpoint:
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
-
Create a node group in the cluster:
For this tutorial, it is required that:
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
- The node group has the GPU cluster specified.
- The node group includes at least two nodes.
-
The nodes use a VM platform and preset compatible with GPU clusters:
In this example, the nodes use the
gpu-h100-sxmVM platform with the8gpu-128vcpu-1600gbpreset. - The nodes use a boot disk image offered by Managed Kubernetes that contains drivers and other components for GPUs. Without this image, you need to install the drivers and components manually. For more details, see GPU drivers and other components.
-
Generate a kubeconfig file with the cluster details for kubectl. This step uses the CLI regardless of the interface that you used to create the cluster.
If you created the cluster with an SDK, first save the returned cluster ID to the
MK8S_CLUSTER_IDenvironment variable:Then, generate the file:To verify that kubectl is connected to the cluster, you can runkubectl cluster-info.
Run the NCCL tests
-
Install the Kubeflow Training Operator (also known as Kubeflow Trainer).
-
Create a namespace for the tests, named
nccl-testin this tutorial: -
Create
nccl-test.yamlwith anMPIJobfor your tests.This example is for 2 nodes. If you created a node group with a different number of nodes, change accordingly thempiruncommand in.spec.mpiReplicaSpecs.Launcher.template.spec.containers[0].argsand the number of workers in.spec.mpiReplicaSpecs.Worker.replicas.nccl-test.yaml — NVIDIA B200 GPUs
nccl-test.yaml — NVIDIA H200 or H100 GPUs
-
Deploy the
MPIJobinnccl-test: -
Check that the test Pods are running:
Wait until all the Pods are running, like this:
-
Check the test logs:
In the result, check the average bus bandwidth. If its value is higher than 300 GB/sec, the connection is stable. Example:The average bus bandwidth is not equal to the InfiniBand one as some of the NCCL operations it measures use NVLink. Nevertheless, it accurately estimates the connection. To stop streaming logs, press Ctrl + C.
-
Delete the
MPIJob.You should delete theMPIJobeven if you want to run another test. In this case, redeploy theMPIJobas described in steps 2–3.
How to delete the created resources
Some of the created resources are chargeable. If you do not need them, delete these resources, so Nebius AI Cloud does not charge for them:-
Delete the installed operator:
-
Delete the node group with GPUs:
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
-
Delete the entire cluster:
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
InfiniBand and InfiniBand Trade Association are registered trademarks of the InfiniBand Trade Association.