
dstack is an open-source orchestrator purpose-built for AI as a streamlined alternative to Kubernetes and Slurm. It simplifies the orchestration of AI workloads across both VM and bare metal AMD clusters, so teams can focus on model development, not infrastructure.
This guide demonstrates how to use dstack to orchestrate distributed training on a cluster of Vultr’s Bare Metal instances with AMD GPUs. While dstack allows using any distributed framework, this guide uses verl, an open-source framework for reinforcement learning training. The purpose is to train Qwen2.5-7B-Instruct to solve grade school math word problems using the GSM8K dataset, which features 8.5K problems requiring 2–8 reasoning steps.
To begin, install dstack by following the installation instructions. Once dstack server is up you can initialize your workspace.
Create a mi325x-fleet.dstack.yml file.
Copy and paste the below configuration.
Under hosts, hostnames of the cluster nodes are listed.
Save and close the file.
Apply the fleet configuration.
While creating a fleet, dstack automatically detects AMD GPUs and checks drivers on each node. Once the fleet is created, it's marked as idle and can be used for running dev environments, tasks, and services.
Before training, it’s important to validate multi-GPU and inter-node communication. dstack makes it convenient to launch RCCL tests across your cluster using a task.
Create rccl-tests.dstack.yml file for distributed task configuration.
Copy and paste the below configuration.
Save and close the file.
Run the task using the dstack apply command.
As the task runs, you’ll see the output of RCCL tests showing the bandwidth between the GPU and nodes.
dstack tasks allow you to run any distributed workload directly using torch run, accelerate, or other distributed frameworks. However, because verl requires Ray, we need to launch a Ray cluster as a task before submitting Ray jobs.
Create a ray-cluster.dstack.yml to launch Ray cluster on the fleet.
Copy and paste the below configuration.
You will need to build the verl-rocm Docker image as described in AMD’s ROCm blog.
Save and close the file.
Run the task using the dstack apply command.
When the task exposes ports, the dstack apply command automatically forwards these ports to the current machine. In our case, this makes the Ray's dashboard available locally at localhost:8265.
Install Ray locally.
Submit the traning job.
Monitor GPU metrics.
Monitoring GPU utilization and cluster health is crucial during training. dstack provides real-time metrics through both CLI and dashboard. Additionally, monitoring metrics is possible also via dstack server’s UI dashboard.
Broadcom RoCE drivers require the libbnxt_re userspace library inside the container to be compatible with the host’s Broadcom kernel driver bnxt_re. To ensure this compatibility, we mount libbnxt_re-rdmav34.so from the host and preload it using LD_PRELOAD when running MPI.
All training checkpoints are saved to an instance volume, enabling seamless recovery in case of interruptions or node failures.
Leveraging AMD Instinct™ MI325X GPUs, ROCm, and dstack enables seamless, scalable, and high-performance distributed LLM training across your fleet. With dstack, you can avoid the operational complexity of managing infrastructure with Kubernetes or Slurm.
For more information:
0 Comments
Be the first to comment and share your perspective with the community.