WIPIVERSE All articles

Ray Train

Ray Train is an open-source, scalable machine learning library for distributed training and fine-tuning of models. It is part of the broader Ray ecosystem, a distributed computing framework originally developed at the University of California, Berkeley's RISELab and now maintained by Anyscale. Ray Train allows users to scale model training code from a single machine to a cluster of machines in the cloud while abstracting away the complexities of distributed computing.

Overview

Ray Train provides a framework-agnostic orchestration layer that sits above individual deep learning frameworks rather than replacing them. It supports major deep learning frameworks including PyTorch, TensorFlow, JAX, and integrations with higher-level libraries such as Hugging Face Transformers, PyTorch Lightning, DeepSpeed, Horovod, XGBoost, and LightGBM. The library enables users to scale training from a single GPU to hundreds of GPUs without rewriting their training code.

History

Ray Train's history is tied to the Ray distributed computing framework, which originated as a research project at UC Berkeley's RISELab in 2016. Robert Nishihara and Philipp Moritz, then doctoral students, began developing Ray under the mentorship of Ion Stoica. The foundational paper, "Ray: A Distributed Framework for Emerging AI Applications," was published at the Thirteenth USENIX Symposium on Operating Systems Design and Implementation in October 2018.

In 2019, Nishihara, Moritz, Stoica, and Michael I. Jordan co-founded Anyscale to build commercial products around Ray. Distributed training capabilities were initially provided through RaySGD, a more limited library. Ray Train entered beta in 2021 as a new, more comprehensive distributed training solution.

A major update, Ray Train V2, was released in November 2025, providing improved usability, stronger reliability guarantees, and a cleaner API surface. In 2025, Ray joined the PyTorch Foundation under the Linux Foundation, signaling its transition to a community-governed open-source standard.

Technical Architecture

Ray Train is built on Ray Core, the low-level distributed execution engine that provides task scheduling, actor management, and inter-process communication across a cluster. Key architectural components include:

  • Trainer Abstraction: A high-level interface that encapsulates the configuration and execution of a distributed training job. Framework-specific implementations include TorchTrainer (PyTorch), TensorFlowTrainer (TensorFlow), and XGBoostTrainer.
  • Single-Controller Architecture: A single driver process orchestrates the training job by launching and managing worker processes, distributing configuration, and coordinating checkpointing and error handling.
  • Data Loading: Integration with Ray Data provides scalable, streaming data ingestion with automatic data sharding across workers.
  • Checkpointing: Supports distributed checkpointing where each worker uploads its shard of model state in parallel to remote storage, with asynchronous uploading to minimize impact on training throughput.

Supported Parallelism Strategies

Ray Train supports multiple parallelism strategies for large model training:

  • Data Parallelism: Each worker trains on a different subset of data with identical model copies.
  • Model Parallelism: Includes tensor parallelism and pipeline parallelism, splitting a single model across multiple accelerators.
  • Fully Sharded Data Parallel (FSDP): Combines data and model parallelism by sharding model parameters, gradients, and optimizer states across workers, supported through PyTorch's FSDP implementation.

Hardware Support

Ray Train supports a wide range of accelerators:

  • NVIDIA GPUs: Primary target, with support for multi-GPU and multi-node training via InfiniBand or NVLink.
  • Google TPUs: Supported through the JAX backend, with native TPU support introduced in Ray Train V2.
  • AMD GPUs: Supported through PyTorch's ROCm integration.
  • Intel accelerators: Accessible through OpenVINO and oneDNN backends.
  • Heterogeneous clusters: Supports mixed hardware configurations within a single cluster.

Key Features

  • Fault Tolerance: Automatically restarts failed workers and resumes training from the most recent checkpoint. Supports spot/preemptible instances for cost savings of up to 90%.
  • Hyperparameter Optimization: Seamless integration with Ray Tune for hyperparameter search using algorithms such as population-based training, Bayesian optimization, and random search.
  • Metrics Tracking: Integration with Weights and Biases, MLflow, and TensorBoard for real-time monitoring.
  • Python-Native API: Minimal code changes required to distribute existing training scripts.
  • Ecosystem Integration: Works with Ray Data (data processing), Ray Tune (hyperparameter tuning), and Ray Serve (model deployment) for an end-to-end ML lifecycle platform.

Adoption and Impact

Ray Train has been adopted by major technology organizations. OpenAI used Ray to coordinate the training of ChatGPT. Uber adopted Ray as the common layer in its Michelangelo machine learning platform, reporting performance improvements of up to 40×. Spotify uses Ray for parallel model training and tuning for recommendation systems.

By early 2026, Ray had accumulated over 237 million downloads and more than 41,000 stars on GitHub, powering approximately 1 million clusters per month across the AI industry.

Competitive Landscape

Ray Train competes with and complements several other distributed training solutions:

  • PyTorch Distributed (DDP/FSDP): Tight integration with PyTorch but requires manual management of process launching, cluster setup, and fault tolerance.
  • Horovod: Framework-agnostic but focused primarily on data-parallel training with less ecosystem integration.
  • DeepSpeed (Microsoft): Provides optimizations like ZeRO for memory-efficient training; can be used alongside Ray Train as an orchestration layer.
  • Cloud Managed Services (Amazon SageMaker, Google Vertex AI, Azure ML): Offer integrated infrastructure but may lock users into specific cloud ecosystems.

Ray Train's competitive advantage lies in its combination of framework agnosticism, ecosystem breadth, fault tolerance, and operational simplicity.

Installation

Ray Train can be installed via pip:

pip install -U "ray[train]"
Browse

More topics to explore

    Browse all articles