Managing InfiniBand Networking
Overview
Crusoe Cloud supports high performance interconnects utilizing NVIDIA Mellanox InfiniBand (IB) networking. The fabric is currently supported for the instance types in the table below:
Instance Type | Number of Infiniband HCAs per Instance | Total InfiniBand Bandwidth (Gbps) |
---|---|---|
a100-80gb-sxm-ib.8x | 8 | 1600 |
h100-80gb-sxm-ib.8x | 8 | 3200 |
The general workflow, which will be discussed in more detail below, emcompasses selecting an IB network for the list of networks available within a location, and then creating an IB parition from within that network. Finally you will launch instances into that partition. This ensures cluster tenancy within a parition to maximize performance with cluster wide isolation.
InfiniBand VM image
Crusoe Cloud provides a default VM image that comes with all the software libraries and tools nessecesary to take advantage InfiniBand through supported ML and HPC frameworks. While you are not required to use this image to use InfiniBand networking, we strongly recommend the ubuntu20.04-nvidia-sxm-docker:latest
or ubuntu22.04-nvidia-sxm-docker:latest
image for the easiest possible setup. Learn more about images.
NCCL_TOPO_FILE
For Crusoe curated images, we provide a NCCL Topology file which provides NCCL a system topology map of the the CPUs, GPUs and IB HCAs relative to PCIe bridges, which ensures optimial performance when running ML workloads. The *-nvidia-sxm-docker
images also come with a service unit file which sets the NCCL_TOPO_FILE
environmental variable.
If you are not using this image, or want to run containers, you will need to provide this config or pass the path of NCCL_TOPO_FILE
in /etc/nccl.conf
or using the NVVL_TOPO_FILE
environment variable on your VM or in your container. Provided below are the NCCL Topology files:
Instance Type | NCCL Topology File |
---|---|
a100-80gb-sxm-ib.8x | a100-80gb-sxm-ib.8x |
h100-80gb-sxm-ib.8x | h100-80gb-sxm-ib.8x |
InfiniBand Networks
InfiniBand Networks are a logical representation of the physical InfiniBand fabric.
InfiniBand Network limitations
You are limited to a maximum of five InfiniBand partitions on the same InfiniBand network.
Listing InfiniBand Networks and Partitions
- CLI
- UI
- Terraform
Use the networking ib-networks list
and networking ib-partitions list
commands to list networks and partitions.
crusoe networking ib-networks list
crusoe networking ib-partitions list
The IDs will be used when attaching a VM to a partition.
In order to view an IB partition via the Crusoe Cloud console:
- Visit the Crusoe Cloud console
- Click the "InfiniBand" tab in the left nav
- View the InfiniBand Networks and Partitions
To list existing IB networks using Terraform, the following code snippet can be used to populate a Terraform data source using the Crusoe Terraform provider.
# list ib networks
data "crusoe_ib_networks" "ib_networks" {}
output "crusoe_ib" {
value = data.crusoe_ib_networks.ib_networks
}
Listing IB partitions is not currently supported in the Crusoe Terraform provider.
Creating InfiniBand Partitions
- CLI
- UI
- Terraform
Use the networking ib-partitions create
command to create a new partition.
crusoe networking ib-partitions create \
--name my-new-partition \
--ib-network-id uuid-of-network
In order to create an IB partition via the Crusoe Cloud console:
- Visit the Crusoe Cloud console
- Click the "InfiniBand" tab in the left nav
- Click the "Add Partition" button
- Input a name for the IB partition
- Select the IB network to create the IB parition in
- Click "Create"
The following is intended to help get you started using Terraform to provision and InfiniBand Partition and attach an InfiniBand partition to a VM in Crusoe Cloud.
Copy and paste the code below in a text-editor of your choice and name the file main.tf
. The example below creates an InfiniBand partition:
// Crusoe Provider
terraform {
required_providers {
crusoe = {
source = "registry.terraform.io/crusoecloud/crusoe"
}
}
}
# list IB networks
data "crusoe_ib_networks" "ib_networks" {}
output "crusoe_ib" {
value = data.crusoe_ib_networks.ib_networks
}
# create an IB partition to deploy VMs in
resource "crusoe_ib_partition" "my_partition" {
name = "my-ib-partition"
# available IB network IDs can be listed by using the output
# above. alternatively, they can be obtain with the CLI by
# crusoe networking ib-networks list
# copy and paste the network ID that has capacity
ib_network_id = data.crusoe_ib_networks.ib_networks.ib_networks[0].id
}
name
and ib_network_id
are required when creating the resource crusoe_ib_partition
name
can only include lowercase ascii characters, numbers and -
.
ib_network_id
is a string which represents the UUID of an existing InfiniBand Network from the output of crusoe networking ib-networks list
Update an existing InfiniBand Partition
- CLI
- UI
- Terraform
Updating Infiniband partitions is currently unsupported in the Crusoe Cloud CLI.
Updating Infiniband partitions is currently unsupported in the Crusoe Cloud Console.
To update an IB network using the Crusoe Terraform provider, you can change the fields of an existing IB network and run terraform apply
. The Crusoe Terraform provider will apply the changes to the IB network.
# Update the existing IB partition with the new network ID
resource "crusoe_ib_partition" "my_partition" {
name = "my-ib-partition" -> "new-ib-partition-name"
ib_network_id = "ib-network-id" -> "new-ib-network-id"
project_id = "project-id" -> "new-project-id"
}
Currently, only the "name", "ib_network_id", or "project_id" can be updated. These fields cannot be updated in-place. As a result, modifying any of these fields will replace the resource rather than an in-place update.
Deleting an InfiniBand Partition
Warning: deleting an InfiniBand partition is a permanant action that will require re-creation of the partition to recover.
- CLI
- UI
- Terraform
Infiniband partitions can be deleted in the CLI using the networking ib-partitions delete <id>
command.
In order to delete an Infiniband partition via the Crusoe Cloud console:
- Visit the Crusoe Cloud console
- Click the "Infiniband" tab in the left nav
- Navigate to the row of the Infiniband partition you wish to delete
- Click the trash can icon on the far right side of the row
- Click the "Confirm" button
An Infiniband partition can be deleted by using the terraform destroy command provided by the Terraform CLI tool.
Launching Instances in an InfiniBand Parition
- CLI
- UI
- Terraform
Use the compute vms create
command to create a new VM, passing in the --ib-partition-id
:
crusoe compute vms create \
--name infiniband-test \
--location us-east1-a \
--type a100-80gb-sxm-ib.8x \
--image ubuntu20.04-nvidia-sxm-docker:latest \
--ib-partition-id uuid-of-partition \
...
In order to connect a VM to an IB partition, you must create the VM and attach it to the appropriate InfiniBand Network and Partition:
- Visit the Crusoe Cloud console
- Click the "Instances" tab in the left nav
- Click "Create instance"
- Select the desired instance type and location, ensuring that the instances and location support InfiniBand
- Select the desired InfiniBand Network
- Select the desired InfiniBand Partition, or create a new InfiniBand Partition
- Continue through the rest of the flow
- Click "Create"
Copy and paste the code below in a text-editor of your choice and name the file main.tf
. The example below creates an Infiniband partition attached to a VM along with a disk attached:
// Crusoe Provider
terraform {
required_providers {
crusoe = {
source = "registry.terraform.io/crusoecloud/crusoe"
}
}
}
locals {
my_ssh_key = file("~/.ssh/id_rsa.pub")
}
# attached storage disk
resource "crusoe_storage_disk" "data_disk" {
name = "data-disk"
size = "1TiB"
location = "us-east1-a"
}
# list IB networks
data "crusoe_ib_networks" "ib_networks" {}
output "crusoe_ib" {
value = data.crusoe_ib_networks.ib_networks
}
# create an IB partition to deploy VMs in
resource "crusoe_ib_partition" "my_partition" {
name = "my-ib-partition"
ib_network_id = data.crusoe_ib_networks.ib_networks.ib_networks[0].id
}
# create multiple VMs, all in the same Infiniband partition
resource "crusoe_compute_instance" "my_vm" {
count = 3
name = "ib-vm-${count.index}"
type = "h100-80gb-sxm-ib.8x" // other option: a100-80gb-sxm-ib.8x
location = "us-east1-a" # IB currently only supported at us-east1-a
image = "ubuntu22.04-nvidia-sxm-docker:latest" # recommended IB image
ssh_key = local.my_ssh_key
host_channel_adapters = [
{
ib_partition_id = crusoe_ib_partition.my_partition.id
}
]
disks = [
// disk attached at startup
{
id = crusoe_storage_disk.data_disk.id
attachment_type = "data"
mode = "read-write" // other option: "read-only"
}
]
}
Updating the IB partition on a VM
- CLI
- UI
Use the compute vms update
on a stopped VM to update the --ib-partition-id
.
crusoe compute vms update \
--ib-partition-id uuid-of-new-partition
In order to switch IB networks or partitions in the UI:
- Visit the Crusoe Cloud console
- Click the "Instances" tab in the left nav
- Select the appropriate instance
- Stop the instance if it is not already stopped
- Pick the appropriate IB network and partition from the dropdowns
- Start the instance and verify it is connected to the chosen IB network and partition