ray-train

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

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill ray-train-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ray-train
Source: https://github.com/Clay-HHK/claude-skills/tree/main/ray-train
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill ray-train-clay-hhk

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 normally requires rewriting code for distributed coordination, checkpointing, and failure recovery. This Skill provides working patterns for Ray Train that handle worker orchestration, GPU allocation, fault tolerance, and hyperparameter sweeps with minimal code changes. ## Core Features & Use Cases - Distributed Training: Scale existing PyTorch, TensorFlow, or HuggingFace training loops from one GPU to hundreds of workers using TorchTrainer and ScalingConfig. - Hyperparameter Tuning: Run distributed search with Ray Tune, ASHA scheduling, and loguniform search spaces across the cluster. - Fault Tolerance & Checkpointing: Resume training automatically after worker failures using Checkpoint APIs and FailureConfig retries. - Cluster Deployment: Launch Ray clusters on AWS, GCP, Azure, Kubernetes (KubeRay), or SLURM with autoscaling and placement strategies. - Use Case: Fine-tune a HuggingFace model across 4 nodes with 8 GPUs each by wrapping your existing Trainer code in a TransformersTrainer with num_workers=32. ## Quick Start Ask the AI to convert your existing PyTorch training script into a Ray Train TorchTrainer that runs on 8 GPUs 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 train_func, call train.torch.prepare_model on your model, and pass it to TorchTrainer with a ScalingConfig setting 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, integrated hyperparameter tuning via 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 more complex setup.

Does Ray Train support HuggingFace Transformers models?▼

Yes, Ray Train provides TransformersTrainer for HuggingFace integration. You keep your standard TrainingArguments and Trainer code, and Ray distributes it across workers specified in ScalingConfig, such as 16 workers across multiple nodes.

How do I set up a Ray cluster on AWS or Kubernetes?▼

On AWS, define a cluster.yaml with node types and run ray up to launch it. On Kubernetes, install the KubeRay operator via Helm and apply a RayCluster manifest specifying head and worker GPU resources.

How does Ray Train recover from worker failures during training?▼

Save checkpoints periodically with train.report and Checkpoint.from_directory, then restore state at startup via train.get_checkpoint. Set FailureConfig(max_failures=3) in RunConfig so Ray automatically retries failed workers and resumes from the last checkpoint.

Why is my Ray cluster not connecting or showing workers?▼

Run ray status to verify nodes and GPUs are registered. If not, restart the head node with ray start --head --port=6379, then reconnect workers using ray start --address=<head-ip>:6379, ensuring ports 6379, 8265, and 10001 are open.