Ray on Vertex AI overview

Ray is an open-source framework for scaling AI and Python applications. Ray provides the infrastructure to perform distributed computing and parallel processing for your machine learning (ML) workflow.

Ray and Vertex AI comparison

If you already use Ray, you can use the same open source Ray code to write programs and develop applications on Vertex AI with minimal changes. You can then use Vertex AI's integrations with other Google Cloud services such as Vertex AI predictions and BigQuery as part of your machine learning workflow.

If you already use Vertex AI and need a simpler way to scale compute resources, you can use Ray code to optimize performance of the training, hyperparameter tuning, predictions, and online serving steps.

Workflow for using Ray on Vertex AI

The process for using Ray on Vertex AI is as follows:

Steps Description
1. Set up for Ray on Vertex AI Set up your Google project, install the version of the Vertex AI SDK for Python that includes the functionality of the Ray Client, and set up a VPC peering network.
2. Create a Ray cluster on Vertex AI Create a Ray cluster on Vertex AI.
3. Develop a Ray application on Vertex AI Connect to a Ray cluster on Vertex AI and develop an application.
4. (Optional) Use Ray on Vertex AI with BigQuery Read, write, and transform data with BigQuery.
5. (Optional) Deploy a model on Vertex AI and get predictions Deploy a model to a Vertex AI online endpoint and get predictions.
6. View logs for your Ray cluster on Vertex AI View generated logs in Cloud Logging.
7. Delete a Ray cluster on Vertex AI Delete a Ray cluster on Vertex AI to avoid unnecessary billing.

Architecture

The following diagram shows the architecture and workflow for Ray on Vertex AI after you set up your Google Cloud project and VPC network:

Ray on Vertex AI architecture

  1. Create the Ray cluster on Vertex AI using the following options:

    • Use the Google Cloud console to create the Ray cluster on Vertex AI.

    • Create the Ray cluster on Vertex AI using the Vertex AI SDK for Python.

  2. Connect to the Ray cluster on Vertex AI through a VPC peered network using the following options:

  3. Develop your application and train your model on the Ray cluster on Vertex AI using the following options:

    • Use the Vertex AI SDK for Python in your preferred environment (Colab Enterprise or a Vertex AI Workbench notebook).

    • Write a Python script using your preferred environment. Submit a Ray Job to the Ray cluster on Vertex AI using the Vertex AI SDK for Python, Ray Job CLI, or Ray dashboard.

  4. Deploy the trained model to an online Vertex AI endpoint for predictions.

  5. Use BigQuery to manage your data.

Pricing

Pricing for Ray on Vertex AI is calculated as follows:

  • The compute resources you use are charged based on the machine configuration you select when creating your Ray cluster on Vertex AI. During Preview, Ray on Vertex AI usage is charged at the same rate as Custom-trained models. After General Availability (GA), the price will increase to reflect the Ray on Vertex AI pricing. You'll be notified of the pricing change when Ray on Vertex AI goes to GA.

  • When you perform tasks using the Ray cluster on Vertex AI, logs are automatically generated and charged based on Cloud Logging pricing.

  • If you deploy your model to an endpoint for online predictions, see the "Prediction and explanation" section of the Vertex AI pricing page.

  • If you use BigQuery with Ray on Vertex AI, see BigQuery pricing.

What's next