Run Your First Distributed Training
This quick start provides a step-by-step walkthrough for running a PyTorch distributed training workload.
Distributed training is the ability to split the training of a model among multiple processors. Each processor is called a worker. Worker nodes work in parallel to speed up model training. There is also a master which coordinates the workers.
Note
Multi-GPU training and distributed training are two distinct concepts. Multi-GPU training uses multiple GPUs within a single node, whereas distributed training spans multiple nodes and typically requires coordination between them.
Prerequisites
Before you start, make sure:
- You have created a project or have one created for you.
- The project has an assigned quota of at least 1 GPU.
Note
Flexible workload submission is enabled by default. If unavailable, contact your administrator to enable it under General settings → Workloads → Flexible workload submission.
Step 1: Logging In
UI
CLI v2
API
Browse to the provided NVIDIA Run:ai user interface and log in with your credentials.
Step 2: Submitting a Distributed Training Workload
UI - Flexible
UI - Original
CLI v2
API
-
Go to the Workload manager → Workloads
-
Click +NEW WORKLOAD and select Training
-
Select under which cluster to create the workload
-
Select the project in which your workload will run
-
Under Workload architecture, select Distributed
-
Select PyTorch as the distributed framework and the distributed training configuration to Worker & master
-
Select Start from scratch to launch a new workload quickly
-
Enter a name for the training workload (if the name already exists in the project, you will be requested to submit a different name)
-
Click CONTINUE
In the next step:
-
Under Environment, enter the Image URL -
kubeflow/pytorch-dist-mnist:latest -
Under Runtime settings, click +COMMAND & ARGUMENTS, then set the Arguments to
--epochs 100. -
Under Compute resources, click the load icon. A side pane appears, displaying a list of available compute resources. Select the ‘small-fraction’ compute resource for your workload.
- If ‘small-fraction’ is not displayed, follow the below steps to create a one-time compute resource configuration:
- Set GPU devices per pod - 1
- Enable GPU fractioning to set the GPU memory per device:
- Select % (of device) - Fraction of a GPU device’s memory
- Set the memory Request - 10 (the workload will allocate 10% of the GPU memory)
- Optional: set the CPU compute per pod - 0.1 cores (default)
- Optional: set the CPU memory per pod - 100 MB (default)
- If ‘small-fraction’ is not displayed, follow the below steps to create a one-time compute resource configuration:
-
Click CONTINUE
-
Click CREATE TRAINING