Welcome to the Ray core tutorial at ODSC East 2022!
This is a gentle introduction to basic Ray patterns for distributing computing. In this tutorial, we will cover at least three basic Ray patterns and its respective Ray Core APIs.
- Remote Stateless Ray Tasks
- Remote Stateful Ray Actors
- Remote ObectRefs as Futures
Additionally, a brief introductino to two of the Ray native libraries:
- Introduction to Ray Tune and Ray Serve
By no means all the Ray patterns and APIs are covered here. We recommend that you follow the references for advanced patterns and antipatterns if you want to use Ray to write your own ML-based libraries or want to take existing Python single-process or single-node multi-core applications and covert them into distributed multi-core, multi-node processes on a Ray cluster.
Knowing these Ray patterns and anti-patterns will guide you in writing effective and robust distributed applications using the Ray framework and its recommended usage of Ray APIs.
Additoinaly, we'll briefly examine how to use Tune APIs to train and tune your model, followed by an introduction to Ray Serve for deploying and serving models.
Some prior experience with Python and Jupyter notebooks will be helpful, but we'll explain most details as we go if you haven't used notebooks before. Knowledge of basic machine learning concepts, including hyperparameters, model serving, and principles of distributed computing is helpful, but not required.
All exercises can be done on your laptop, preferably running a Linux or macOS, using all its cores. Because you won’t have access to Ray clusters, we have to run Ray locally and parallelize all your tasks on all your cores.
Python 3.7+ is required on your laptop, and some minimal installation of quick python packages using conda and pip.
We assume that you have a conda
installed.
conda create -n ray-core-tutorial python=3.8
conda activate ray-core-tutorial
git clone https://github.com/stephanie-wang/ray-core-tutorial.git
cd
to <cloned_dir>python3 -m pip install -r requirements.txt
python3 -m ipykernel install
jupyter lab
Let's have fun with Ray @ ODSC East 2022!
Stephanie