Study guide

5.4 Ray on Agent Platform for Distributed Python Workloads

Google Cloud Professional Machine Learning Engineer Exam

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

0.1 Exam Overview, Blueprint & Certification Logistics 0.2 Study Strategy, Scenario Mechanics & 8-Week Roadmap

2 Section 1: Architecting Low-Code AI Solutions (~13%)

1.1 BigQuery ML: Model Types, SQL Syntax and In-Database Evaluation 1.2 Feature Engineering and Feature Selection in BigQuery ML 1.3 Generating Predictions with BigQuery ML 1.4 AutoML on Agent Platform: Tabular, Image, Text and Video Training 1.5 Fine-Tuning Gemini Models from BigQuery 1.6 Model Garden: Evaluating and Selecting the Right Model 1.7 Industry-Specific AI APIs: Document AI, Vision, Translate and Speech 1.8 Generative Media and Models as a Service: Gemini, Imagen and Veo 1.9 Optimizing Gemini Applications for Cost, Latency and Availability

3 Section 2: Collaborating Within and Across Teams to Manage Data and Models (~16%)

2.1 Organizing and Exploring Tabular, Text, Image and Video Data 2.2 Choosing the Preprocessing Tool: BigQuery, Dataflow, Spark and In-Memory Python 2.3 Creating and Consolidating Features in Agent Platform Feature Store 2.4 Data Privacy, PII Handling and Sensitive Information 2.5 Notebook Environments: Collaboration and Security Best Practices 2.6 Prototyping in Workbench and Colab Enterprise with PyTorch, scikit-learn and JAX 2.7 Prototyping with Model Garden Foundational and Open Models in Notebooks 2.8 Choosing the Development and Experimentation Environment 2.9 Evaluating Generative Solutions: LLM-as-a-Judge and RAG Evaluation 2.10 Experiment Tracking, Artifact Lineage and Model Registry Governance

4 Section 3: Scaling Prototypes into ML Models (~21%)

3.1 Choosing the Model Type: ARIMA, DNN, LLM and Classical Baselines 3.2 Choosing the Product: AutoML, BigQuery ML, Custom Training and Pipelines 3.3 Choosing the Deployment Strategy at Design Time 3.4 Modeling Techniques for Interpretability Requirements 3.5 Organizing Training Data on Cloud Storage and BigQuery 3.6 Ingesting Structured and Unstructured Data into Training Pipelines 3.7 Training SDKs and Services: Custom Training, Kubeflow on GKE, AutoML and Tabular Workflows 3.8 Troubleshooting ML Model Training Failures 3.9 Hyperparameter Tuning, Bayesian Optimization and Vizier 3.10 Model Evaluation Metrics, Transfer Learning and Fine-Tuning 3.11 Evaluating Compute and Accelerator Options: CPU, GPU and TPU 3.12 Distributed Training Strategies, Hardware Acceleration and Performance Optimization

5 Section 4: Serving and Scaling Models (~20%)

4.1 Batch and Online Inference: Agent Platform, Model Garden, Cloud Run and GKE 4.2 Rollout Strategies: Canary, Traffic Splitting, Shadow and Blue-Green 4.3 Tuning Models for Production: Vector Search and Model Compression 4.4 Deploying Models to Public and Private Endpoints 4.5 Choosing Serving Hardware: CPU, GPU, TPU and Edge 4.6 Scaling the Serving Backend for Throughput

6 Section 5: Automating and Orchestrating ML Pipelines (~18%)

5.1 Validating Data and Models Inside Pipelines 5.2 Agent Platform Pipelines: Kubeflow Pipelines (KFP) and TFX Architecture 5.3 Reusable Pipeline Components, Artifacts and ML Metadata Lineage 5.4 Ray on Agent Platform for Distributed Python Workloads 5.5 MLOps CI/CD Automation, Retraining Triggers and Skew Prevention

7 Section 6: Monitoring AI Solutions (~13%)

6.1 Securing AI Systems: Exfiltration, Malicious Prompting and Model Armor 6.2 Responsible AI, Explainable AI, Fairness Metrics and Model Governance 6.3 Model Monitoring: Feature Skew and Drift Detection 6.4 Operational Troubleshooting, Performance Profiling and Cost Optimization 6.5 Monitoring, Testing and Evaluating Generative AI in Production

5.4 Ray on Agent Platform for Distributed Python Workloads

Key Takeaways Explain This Topic AI

Ray on Agent Platform provides a managed Ray cluster of head and worker nodes for distributed Python and ML workloads, with autoscaling or manual scaling per worker pool.

A Ray cluster persists until explicitly deleted, unlike a custom training job whose resources are released at completion — which makes forgotten clusters an expensive failure mode.

Ray suits workloads that are not naturally a DAG: hyperparameter sweeps, reinforcement learning, distributed Python data processing, and large-scale batch inference.

The Ray on Agent Platform SDK bundles the Ray client, a BigQuery connector, cluster management, and integration with Agent Platform Inference.

Choose Pipelines for ordered, reproducible, scheduled workflows and Ray for interactive or embarrassingly parallel distributed Python.

Last updated: September 2026

5.4 Ray on Agent Platform for Distributed Python Workloads

Blueprint reference: Section 5.1, "Building and orchestrating pipelines using managed or unmanaged services and from templates or custom solutions (e.g., Agent Platform Pipelines, Managed Service for Apache Airflow, and Ray on Gemini Enterprise Agent Platform)."

Ray is the newest of the three named options and the one least covered by pre-2026 study material, which makes it worth knowing precisely.

What a Managed Ray Cluster Is

Ray is an open-source framework for scaling Python and AI applications across a cluster. Ray on Agent Platform is a managed Ray cluster: Google provisions and operates the head node and worker pools, and you connect to it with ordinary Ray code.

Structure:

A head node coordinating the cluster.

One or more worker pools , each with its own machine type and optional accelerators.

Autoscaling or manual scaling per worker pool.

Connectivity from a notebook, a script, or another Google Cloud service through the Ray client.

The headline property, and the one that shows up in exam questions: a Ray cluster remains available until you delete it. A custom training job releases its resources when the job finishes. A Ray cluster does not. That is exactly what makes it good for interactive distributed development — you attach, experiment, detach, and reattach without waiting for provisioning — and exactly what makes a forgotten cluster an expensive incident.

The Ray Libraries That Matter for ML

  • Library Purpose
  • Ray Core Tasks and actors — the general distributed Python primitives
  • Ray Tune Distributed hyperparameter search, including early stopping schedulers
  • Ray Train Distributed training wrappers for PyTorch, TensorFlow, and others
  • Ray Data Distributed data loading and preprocessing across the cluster
  • Ray Serve Model serving, including multi-model composition
  • RLlib Reinforcement learning at scale

Ray Tune and RLlib are the two that most often decide a question. Reinforcement learning in particular is a workload that fits Ray naturally and fits a DAG-based pipeline poorly, because the loop between agent and environment is not a sequence of discrete stages.

Integration Points

The Ray on Agent Platform SDK is the Agent Platform SDK extended with the Ray client, cluster management, a BigQuery connector for reading and writing warehouse data directly from Ray workers, and integration with Agent Platform Inference so a model trained on the cluster can be deployed without leaving the workflow. import ray, vertex_ray

from google.cloud import aiplatform

  • aiplatform.init(project=PROJECT, location=REGION)
  • ray.init(address=vertex_ray.get_ray_cluster(CLUSTER_ID).dashboard_address)
  • # Workers read directly from BigQuery, no export step
  • ds = ray.data.read_bigquery(project_id=PROJECT, dataset="analytics", table="events")
  • Ray Versus Pipelines Versus Airflow

All three appear in the same blueprint bullet, so the distinctions matter.

Agent Platform Pipelines Managed Service for Apache Airflow Ray on Agent Platform

Model Serverless ML DAG execution Managed Airflow for general workflow orchestration Managed distributed Python compute cluster

Unit of work Containerized component Operator task Python task or actor

Best at Reproducible, versioned ML workflows with lineage Cross-system scheduling and dependencies Parallel or interactive distributed Python

  • Resource lifetime Per run; nothing between runs Environment runs continuously Cluster persists until deleted
  • Cost when idle None Environment cost Full cluster cost
  • Weak at Non-DAG workloads ML lineage and artifact typing Reproducible scheduled workflows

Two clean signals:

"Reproducible, scheduled, with lineage and artifact tracking" → Pipelines.

"Distribute this Python workload across many machines" , especially hyperparameter sweeps, RL, or large-scale Python batch inference → Ray.

Airflow is the answer when orchestration spans systems beyond ML — waiting on a warehouse load, triggering a downstream ETL, coordinating with non-ML jobs. Note the naming: Cloud Composer was renamed Managed Service for Apache Airflow in 2026, while the API, gcloud commands, and IAM roles still say composer .

They also compose. A pipeline step can submit work to a Ray cluster, and an Airflow DAG can trigger a pipeline run.

Operating a Ray Cluster Responsibly

Delete clusters when finished. The single most important habit; there is no automatic release at job completion.

Size worker pools to the workload and use autoscaling so idle workers are removed even while the cluster lives.

Keep the head node small. It coordinates; it does not need accelerators.

Use accelerator worker pools only for the stages that need them. A sweep whose trials are CPU-bound should not run on GPU workers.

Checkpoint long runs to Cloud Storage as with any other long training workload.

Exam Traps

Assuming a Ray cluster releases resources like a job. It persists until deleted.

Choosing Ray for a scheduled, reproducible ML workflow. That is Pipelines.

Choosing Pipelines for reinforcement learning. Not a DAG-shaped workload.

Expecting Airflow to provide ML artifact lineage. It schedules; it does not type artifacts.

Forgetting the 2026 Composer rename when reading current documentation.