All-Reduce Training with MPIJob
Expert · 45 minutes · 5 tasks, checked automatically · 100 points
In this expert-level lab you will run a distributed MPI job on Kubernetes using the Kubeflow MPI Operator — the same launcher/worker machinery that Horovod uses for all-reduce data-parallel training. You will install the MPI Operator (v0.8.2), create a dedicated namespace and RBAC resources, submit an MPIJob, and verify the job completes successfully. To keep the lab laptop-sized and runnable on Apple Silicon, the job runs the MPI Operator's own `mpi-pi` example (a small multi-arch image) instead of a Horovod benchmark: every worker rank computes part of an estimate of pi and the partial results are combined with an MPI collective reduction (`MPI_Reduce`), the same kind of collective that Horovod's all-reduce performs on gradients. Horovod's CPU images are several gigabytes and amd64-only, so the Horovod variant is described but not run. By the end you will understand how Kubernetes orchestrates MPI-style collective communication for data-parallel training.
What you’ll learn
- Install the Kubeflow MPI Operator using Helm and verify all CRDs and controller components are healthy
- Submit a parameterised MPIJob manifest that launches a Horovod all-reduce benchmark with one launcher and two worker replicas
- Confirm the distributed training job runs to completion and inspect collective-communication logs from the launcher pod
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground
Topics: mlops, distributed-training, horovod, mpi, all-reduce, kubeflow, mpi-operator, pytorch, kubernetes
Create a free account to start this lab.
Keep going
- Autoscale LLM Inference from a Queue with KEDA
- Distributed PyTorch Training with the Training Operator (PyTorchJob)
- Distributed TensorFlow with TFJob on Kubernetes
- Hyperparameter Tuning with Katib on Kubernetes
- Fine-Tune a Small Language Model as a Job (LoRA, CPU)
- Share GPUs with Time-Slicing via the NVIDIA GPU Operator