Get Started with Distributed Training using PyTorch Lightning — Ray 2.34.0
This tutorial walks through the process of converting an existing PyTorch Lightning script to use Ray Train. Learn how to: Configure the Lightning Trainer so that it runs distributed with Ray and on the correct CPU or GPU device. Configure training function to report metrics and save checkpoints. Configure scaling and CPU or GPU resource requirements for a training job. Launch a distributed training job with a TorchTrainer. For reference, the final code is as follows: train_func is the Python code that executes on each distributed training worker. ScalingConfig defines the number of distributed training workers and whether to use GPUs. TorchTrainer launches the distributed training job. Compare a PyTorch Lightning training script with and without Ray Train. First, update your training code to support distributed training. Begin by wrapping your code in a training function: Each distributed training worker executes this function. You can also specify the input argument for train_func as
Get Started with Distributed Training using PyTorch Lightning # This tutorial walks through the process of converting an existing PyTorch Lightning script to use Ray Train. Learn how to: Configure the Lightning Trainer so that it runs distributed with Ray and on the correct CPU or GPU device. Configure training function to report metrics and save checkpoints. Configure scaling and CPU or GPU resource requirements for a training job. Launch a distributed training job with a TorchTrainer . Quickstart # For reference, the final code is as follows: from ray.train.torch import TorchTrainer from ray
related reading
- Trainer - PyTorch Lightning 2.6.1 documentationlightning.ai
- LightningModule - PyTorch Lightning 2.6.1 documentationlightning.ai
- Scale Machine Learning & AI Computing | Ray by Anyscaleray.io
- 👨👩👧👦 Distributed Training - Composerdocs.mosaicml.com
- From Single-Node to Multi-GPU Clusters: How Discord Made Distributed Compute Easy for ML Engineersdiscord.com
- PiTorch: ML on Baremetal Raspberry Pis | projectsmasonjwang.com
- Keep the Tokens Flowing: Lessons from 16 Open-Source RL Librarieshuggingface.co
- Being GPU Poor makes you creativedilawar.ai
- Components of an Open Source AI Compute Tech Stackanyscale.com
- ⚡ Migrating from PTL - Composerdocs.mosaicml.com
- Multi-Datacenter Training: OpenAI's Ambitious Plan To Beat Google's Infrastructuresemianalysis.com
- PyTorch in One Hour: From Tensors to Training Neural Networks on Multiple GPUssebastianraschka.com