How Ray solves common production challenges for generative AI infrastructure
Blog
Training 175B Parameter Language Models at 1000 GPU scale with Alpa and Ray
Blog
Faster stable diffusion fine-tuning with Ray Train
Blog
How to fine tune and serve LLMs simply, quickly and cost effectively using Ray + DeepSpeed + HuggingFace
Blog
How OpenAI Uses Ray to Train Tools like ChatGPT
Code example
GPT-J-6B Fine-Tuning with Ray Train and DeepSpeed
Code example
Aviary toolkit serving live traffic for LLMs
Tutorial
Get started with Ray Train from an existing PyTorch codebase
Code example
Distributed training with LightGBM
Tutorial
Distributed training with XGBoost
Code example
How to use Ray Data to do batch prediction with the Hugging Face Transformers GPT-J model
Code example
How to use Ray Serve to do online serving with the Hugging Face Transformers GPT-J model
Code example
How to fine-tune a DreamBooth text-to-image model with your own images.
Code example
Fine-tune dolly-v2-7b with Ray Train, PyTorch Lightning and FSDP
Code example
Torch Object Detection Example with Ray Train
Code example
Image Classification Batch Inference with PyTorch ResNet152
Code example
How to use Ray Data to do batch prediction with the Stable Diffusion text-to-image model
Code example
Object Detection Batch Inference with PyTorch FasterRCNN_ResNet50
Code example
Image Classification Batch Inference with PyTorch ResNet18
Code example
Image Classification Batch Inference with Huggingface Vision Transformer
Code example
Serving ML models with Ray Serve (Tensorflow, PyTorch, Scikit-Learn, others)
Code example
Batching tutorial for Ray Serve
Code example
Serving RLlib Models with Ray Serve
Code example
Scaling your Gradio app with Ray Serve
Code example
Java tutorial for Ray Serve
Code example
Serving a Stable Diffusion Model
Code example
Serving a Distilbert Model
Code example
Serving a Bert Model on AWS NeuronCore
Code example
Serving an Object Detection Model
Blog
Offline Batch Inference: Comparing Ray, Apache Spark, and SageMaker
Blog
Streaming distributed execution across CPUs and GPUs
Blog
Using Ray Data to parallelize LangChain inference
Blog
Batch Prediction using Ray Data
Blog
Training One Million ML Models in Record Time with Ray
Blog
Many Models Batch Training at Scale with Ray Core
Code example
Batch Training with Ray Core
Code example
Batch Training with Ray Data
Tutorial
Tune Basic Parallel Experiments
Code example
Batch Training and Tuning using Ray Tune
Video
Scaling Instacart fulfillment ML on Ray
Code example
Using Aim with Ray Tune For Experiment Management
Code example
Using Comet with Ray Tune For Experiment Management
Code example
Tracking Your Experiment Process Weights & Biases
Code example
Using MLflow Tracking & AutoLogging with Tune
Code example
How To Use Tune With Ax
Code example
How To Use Tune With Dragonfly
Code example
How To Use Tune With HyperOpt
Code example
How To Use Tune With BayesOpt
Code example
How To Use Tune With BlendSearch and CFO
Code example
How To Use Tune With TuneBOHB
Code example
How To Use Tune With Nevergrad
Code example
How To Use Tune With Optuna
Code example
How To Use Tune With SigOpt
Video
Productionizing ML at Scale with Ray Serve
Blog
Simplify your MLOps with Ray & Ray Serve
Tutorial
Getting Started with Ray Serve
Tutorial
Model Composition in Serve
Tutorial
Getting Started with Ray Tune
Blog
How to distribute hyperparameter tuning with Ray Tune
Video
Simple Distributed Hyperparameter Optimization
Blog
Hyperparameter Search with 🤗 Transformers
Code example
How To Use Tune With Keras & TF Models
Code example
How To Use Tune With PyTorch Models
Code example
How To Tune PyTorch Lightning Models
Code example
Model Selection & Serving With Ray Serve
Code example
Tuning RL Experiments With Ray Tune & Ray Serve
Code example
A Guide To Tuning XGBoost Parameters With Tune
Code example
A Guide To Tuning LightGBM Parameters With Tune
Code example
A Guide To Tuning Horovod Parameters With Tune
Code example
A Guide To Tuning Huggingface Transformers With Tune
Code example
More Tune use cases on the Blog
Video
Ray Train, PyTorch, TorchX, and distributed deep learning
Tutorial
Getting Started with Ray Train
Code example
Fine-tune a 🤗 Transformers model on GLUE benchmark
Code example
PyTorch Fashion MNIST Training Example
Code example
TensorFlow MNIST Training Example
Code example
End-to-end Horovod Training Example
Code example
End-to-end PyTorch Lightning Training Example
Code example
Fine-tune a PyTorch Lightning Text Classifier with Ray Data
Code example
End-to-end Example for Tuning a TensorFlow Model
Code example
End-to-end Example for Tuning a PyTorch Model with PBT
Course
Applied Reinforcement Learning with RLlib
Blog
Intro to RLlib: Example Environments
Code example
A collection of tuned hyperparameters by RLlib algorithm
Code example
A collection of reasonably optimized Atari and MuJoCo results for RLlib
Code example
RLlib’s trajectory view API and how it enables implementations of GTrXL (attention net) architectures
Code example
A how-to on connecting RLlib with the Unity3D game engine for running visual- and physics-based RL experiments
Code example
How we ported 12 of RLlib’s algorithms from TensorFlow to PyTorch and what we learnt on the way
Code example
This blog post is a brief tutorial on multi-agent RL and its design in RLlib
Code example
Exploration of a functional paradigm for implementing reinforcement learning (RL) algorithms
Code example
Example of defining and registering a gym env and model for use with RLlib
Code example
Example of how to setup an RLlib algorithm against a locally running Unity3D editor
Code example
Rendering and recording of an environment
Code example
Coin game example with RLlib
Code example
Example for how to use a DMLab environment (Watermaze)
Code example
RecSym environment example (for recommender systems) using the SlateQ algorithm
Code example
Example demonstrating how to use the SUMO simulator in connection with RLlib.
Code example
VizDoom example script using RLlib’s auto-attention wrapper
Code example
Example of how to ensure subprocesses spawned by envs are killed when RLlib exits.
Code example
Attention Net (GTrXL) learning the “repeat-after-me” environment
Code example
Example showing how to use the auto-LSTM wrapper for your default- and custom models in RLlib.
Code example
Example of using a custom Keras- or PyTorch RNN model.
Code example
Example of defining and registering a custom model with a supervised loss.
Code example
Example of adding batch norm layers to a custom model.
Code example
Example of how to leverage TensorFlow eager to simplify debugging and design of custom models and policies.
Code example
Example of a “fast” Model learning only one parameter for tf and torch.
Code example
Shows how to define a custom Model API in RLlib, such that it can be used inside certain algorithms.
Code example
An example on how a model can use the trajectory view API to specify its own input.
Code example
Implementations of MobileNetV2 and torch.hub(mobilenet_v2)-wrapping example models.
Code example
Example of DeepMind’s Differentiable Neural Computer for partially-observable environments.
Code example
Example of how to use Tune’s support for custom training functions to implement custom training workflows.
Code example
Example of how to advance the environment through different phases (tasks) over time.
Code example
How to setup a custom Logger object in RLlib.
Code example
Example of how to output custom training metrics to TensorBoard.
Code example
How to setup a custom TFPolicy.
Code example
How to setup a custom TorchPolicy.
Code example
Example of how to use RLlib’s lower-level building blocks to implement a fully customized training workflow.
Code example
Example of how to use the exec. plan of an Algorithm to trin two different policies in parallel (also using multi-agent API).
Code example
How to run a custom Ray Tune experiment with RLlib with custom training- and evaluation phases.
Code example
Example of how to write a custom evaluation function that is called instead of the default behavior, which is running with the evaluation worker set through n episodes.
Code example
Example showing how the evaluation workers and the “normal” rollout workers can run (to some extend) in parallel to speed up training.
Code example
Example showing how to run an offline RL training job using a historic-data json file.
Code example
Example of using Ray Serve to serve RLlib models with HTTP and JSON interface
Code example
This script offers a simple workflow for 1) training a policy with RLlib first, 2) creating a new policy 3) restoring its weights from the trained one and serving the new policy via Ray Serve.
Code example
Example of how to setup n distributed Unity3D (compiled) games in the cloud that function as data collecting clients against a central RLlib Policy server learning how to play the game.
Code example
Example of online serving of predictions for a simple CartPole policy.
Code example
Example of how to externally generate experience batches in RLlib-compatible format.
Code example
Example of how to find a checkpoint after a Tuner.fit() via some custom defined criteria.
Code example
Setup RLlib to run any algorithm in (independent) multi-agent mode against a multi-agent environment.
Code example
Setup RLlib to run any algorithm in (shared-parameter) multi-agent mode against a multi-agent environment.
Code example
Example of different heuristic and learned policies competing against each other in rock-paper-scissors.
Code example
Example of the two-step game from the QMIX paper.
Code example
Example on how to use RLlib to learn in PettingZoo multi-agent environments.
Code example
Example of customizing PPO to leverage a centralized value function.
Code example
A simpler method of implementing a centralized critic by augmentating agent observations with global information.
Code example
Example of running a custom hand-coded policy alongside trainable policies.
Code example
Example of how to define weight-sharing layers between two different policies.
Code example
Example of alternating training between DQN and PPO.
Code example
Example of hierarchical training using the multi-agent API.
Code example
Example of an iterated prisoner’s dilemma environment solved by RLlib.
Code example
Example of how to setup fractional GPUs for learning (driver) and environment rollouts (remote workers).
Code example
Learning in arbitrarily nested action spaces.
Code example
Example of how to handle variable-length or parametric action spaces
Code example
How to filter raw observations coming from the environment for further processing by the Agent’s model(s).
Code example
How to use RLlib’s Repeated space to handle variable length observations.
Code example
Learning with auto-regressive action dependencies (e.g. 2 action components; distribution for 2nd component depends on the 1st component’s actually sampled value).
Code example
A General Evaluation Platform and Building Toolkit for Single/Multi-Agent Intelligence with RLlib-generated baselines.
Code example
Example of training autonomous vehicles with RLlib and CARLA simulator.
Code example
Using Graph Neural Networks and RLlib to train multiple cooperative and adversarial agents to solve the “cover the area”-problem, thereby learning how to best communicate (or - in the adversarial case - how to disturb communication).
Code example
A dense traffic simulating environment with RLlib-generated baselines.
Code example
Example of setting up a multi-agent version of GFootball with RLlib.
Code example
A multiagent AI research environment inspired by Massively Multiplayer Online (MMO) role playing games
Code example
Example of building packet classification trees using RLlib / multi-agent in a bandit-like setting.
Code example
Example of learning optimal LLVM vectorization compiler pragmas for loops in C and C++ codes using RLlib.
Code example
Example of using the multi-agent API to model several social dilemma games.
Code example
Create a custom environment and train a single agent RL using Ray 2.0 with Tune.
Code example
Example of training in StarCraft2 maps with RLlib / multi-agent.
Code example
Example of optimizing mixed-autonomy traffic simulations with RLlib / multi-agent.
Code example
Working with custom Keras models in RLlib
Tutorial
Getting Started with RLlib
Video
Deep reinforcement learning at Riot Games
Blog
The Magic of Merlin - Shopify’s New ML Platform
Tutorial
Large Scale Deep Learning Training and Tuning with Ray
Blog
Griffin: How Instacart’s ML Platform Tripled in a year
Video
Predibase - A low-code deep learning platform built for scale
Blog
Building a ML Platform with Kubeflow and Ray on GKE
Video
Ray Summit Panel - ML Platform on Ray
Code example
AutoML for Time Series with Ray
Blog
Highly Available and Scalable Online Applications on Ray at Ant Group
Blog
Ray Forward 2022 Conference: Hyper-scale Ray Application Use Cases
Blog
A new world record on the CloudSort benchmark using Ray
Code example
Speed up your web crawler by parallelizing it with Ray
Tutorial
Image Classification Batch Inference with Huggingface Vision Transformer
Tutorial
Image Classification Batch Inference with PyTorch ResNet152
Tutorial
Object Detection Batch Inference with PyTorch FasterRCNN_ResNet50
Tutorial
Many Model Training with Ray Data
Code example
Build Batch Prediction Using Ray
Code example
Build a Simple Parameter Server Using Ray
Code example
Simple Parallel Model Selection
Code example
Fault-Tolerant Fairseq Training
Code example
Learning to Play Pong
Code example
A Gentle Introduction to Ray Core by Example
Code example
Using Ray for Highly Parallelizable Tasks
Code example
Running a Simple MapReduce Example with Ray Core
Code example
Benchmark example for the PyTorch data transfer auto pipeline
Tutorial
How To Use Tune’s Scikit-Learn Adapters?
Code example
Simple example for doing a basic random and grid search.
Code example
Example of using a simple tuning function with AsyncHyperBandScheduler.
Code example
Example of using a Trainable function with HyperBandScheduler. Also uses the AsyncHyperBandScheduler.
Tutorial
Configuring and running (synchronous) PBT and understanding the underlying algorithm behavior with a simple example.
Tutorial
Example of using the function API with a PopulationBasedTraining scheduler.
Code example
Example of using the Population-based Bandits (PB2) scheduler.
Code example
Example of custom loggers and custom trial directory naming.
Code example
Basics of using Tune
Code example
Using Search algorithms and Trial Schedulers to optimize your model.
Code example
Using Population-Based Training (PBT).
Code example
Fine-tuning Huggingface Transformers with PBT.
Code example
Logging Tune Runs to Comet ML.
Tutorial
Using Ray Serve to deploy a chatbot
Code example
Fine-tune vicuna-13b-v1.3 with DeepSpeed, PyTorch Lightning and Ray Train
Code example
Distributed Training with DeepSpeed ZeRO-3 and TorchTrainer
Code example
Distributed Training with Hugging Face Accelelate and TorchTrainer
Code example
RayJob Batch Inference Example on Kubernetes with Ray