ray-train

Orchestrates distributed PyTorch, TensorFlow, and HuggingFace training across multi-node Ray clusters.

2|Updated Aug 15, 2026
One-click install
npx skills add https://github.com/Jensen-Yao/agents-skills --skill ray-train-jensen-yao
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ray-train
Source: https://github.com/Jensen-Yao/agents-skills/tree/main/skills/ray-train
Command: npx skills add https://github.com/Jensen-Yao/agents-skills --skill ray-train-jensen-yao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ray[train], torch, transformers, and includes references (resource) components.

What problem does it solve? Scaling model training from a single GPU to hundreds of machines normally requires rewriting code for distributed coordination, GPU allocation, and failure recovery. This Skill provides the instructions and patterns to scale PyTorch, TensorFlow, and HuggingFace training across Ray clusters with minimal code changes. ## Core Features & Use Cases - Distributed Training Orchestration: Wrap existing training loops in a TorchTrainer or TransformersTrainer and scale from 1 GPU to 1000s of nodes using ScalingConfig. - Hyperparameter Tuning at Scale: Run distributed hyperparameter sweeps with Ray Tune, ASHA early stopping, and search spaces across the cluster. - Fault Tolerance & Checkpointing: Automatically resume training from checkpoints when workers fail, with elastic scaling to add or remove nodes mid-run. - Use Case: A team fine-tuning a large language model can launch a Ray cluster on AWS or Kubernetes, run a 20-trial hyperparameter sweep across 32 GPUs, and let failed workers restart automatically without losing progress. ## Quick Start Scale my PyTorch training script to run distributed across 8 GPUs using Ray Train with checkpointing enabled.

Frequently Asked Questions about ray-train

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scale PyTorch training to multiple GPUs with Ray Train?▼

Wrap your training loop in a function, call train.torch.prepare_model on the model, and pass it to TorchTrainer with a ScalingConfig specifying num_workers and use_gpu. The same code runs on 1 GPU or 1000 GPUs without further changes.

Ray Train vs PyTorch Lightning vs DeepSpeed for distributed training?▼

Ray Train is best for multi-node orchestration, hyperparameter tuning via Ray Tune, and fault tolerance. Use Accelerate for simpler single-node multi-GPU, Lightning for high-level abstractions and callbacks, or DeepSpeed for maximum performance with complex setup.

Does Ray Train support HuggingFace Transformers models?▼

Yes, Ray Train provides TransformersTrainer for HuggingFace integration. You define a training function using the standard transformers Trainer API, and Ray handles distributed execution across workers and nodes automatically.

How do I run distributed hyperparameter tuning with Ray Tune?▼

Define a search space with tune.loguniform or tune.choice, then pass your TorchTrainer to tune.Tuner with a TuneConfig specifying num_samples and a scheduler like ASHAScheduler. Ray runs trials in parallel across the cluster with early stopping.

Why is my Ray cluster not connecting to worker nodes?▼

Check cluster status with ray status to verify nodes and GPUs are registered. If workers are missing, restart the head node with ray start --head --port=6379, then reconnect workers using ray start --address=<head-ip>:6379.

Can Ray Train recover automatically when a worker fails during training?▼

Yes, Ray Train supports fault tolerance through checkpointing and FailureConfig with max_failures to retry on worker failure. Save checkpoints periodically with train.report and resume state via train.get_checkpoint when training restarts.