ray-train

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

13.0k|930|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill ray-train-orchestra-research
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ray-train
Source: https://github.com/Orchestra-Research/AI-research-SKILLs/tree/main/08-distributed-training/ray-train
Command: npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill ray-train-orchestra-research

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 multi-node clusters requires complex distributed coordination, fault tolerance, and hyperparameter search infrastructure that is difficult to build and maintain manually. ## Core Features & Use Cases - Multi-Node Distributed Training: Scale PyTorch, TensorFlow, and HuggingFace training from a laptop to thousands of nodes with minimal code changes using TorchTrainer and ScalingConfig. - Hyperparameter Tuning at Scale: Run distributed hyperparameter sweeps with Ray Tune integration, ASHA scheduling, and search spaces across the entire cluster. - Fault Tolerance & Checkpointing: Automatically resume training from checkpoints when workers fail, with elastic scaling to add or remove nodes during training. - Use Case: Train a large language model across 4 nodes with 8 GPUs each by defining a training function, setting num_workers=32, and letting Ray handle device placement, metric aggregation, and failure recovery. ## Quick Start Scale my existing 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 your model, and pass the function to TorchTrainer with a ScalingConfig specifying num_workers and use_gpu=True. Ray handles device placement, coordination, and metric aggregation automatically.

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

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

Does Ray Train support HuggingFace Transformers models?▼

Yes, Ray Train provides TransformersTrainer for HuggingFace integration. Define your training function with standard Transformers Trainer and TrainingArguments, then scale it across nodes using ScalingConfig with the desired number of GPU workers.

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

Define a search space using tune.loguniform or tune.choice, wrap your TorchTrainer in a tune.Tuner, and configure num_samples with a scheduler like ASHAScheduler for early stopping. Ray distributes trials across the cluster and returns the best configuration.

How do I deploy a Ray cluster on Kubernetes for training?▼

Install the KubeRay operator via Helm, then apply a RayCluster manifest defining head and worker GPU groups. Submit training jobs by port-forwarding the Ray client port and setting RAY_ADDRESS to ray://localhost:10001.

Why is my Ray cluster not connecting 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, ensuring firewall rules allow ports 6379 and 8000-9000.