/ray-core-tutorial

Introduction to Ray Core Design Patterns and APIs.

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Introduction to Ray Ecosystem for Distributed Applications

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.

Prerequisite knowledge

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.

Instructions to get started

We assume that you have a conda installed.

  1. conda create -n ray-core-tutorial python=3.8
  2. conda activate ray-core-tutorial
  3. git clone https://github.com/stephanie-wang/ray-core-tutorial.git
  4. cd to <cloned_dir>
  5. python3 -m pip install -r requirements.txt
  6. python3 -m ipykernel install
  7. jupyter lab

Let's have fun with Ray @ ODSC East 2022!

Stephanie