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
Explore this link on the map →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
- Being GPU Poor makes you creativedilawar.ai
- Components of an Open Source AI Compute Tech Stackanyscale.com
- How To Scale Your Modeljax-ml.github.io
- ⚡ Migrating from PTL - Composerdocs.mosaicml.com
- Everything about Distributed Training and Efficient Finetuning | Sumanth's Personal Websitesumanthrh.com
- PiTorch: ML on Baremetal Raspberry Pis | projectsmasonjwang.com
- Customize checkpointing behavior (intermediate) - PyTorch Lightning 2.6.1 documentationlightning.ai
- Saving and loading checkpoints (basic) - PyTorch Lightning 2.6.1 documentationlightning.ai