Study guide
15.2 Agent Platform Pipelines with KFP: Components, Templates & Caching
Google Cloud Professional Machine Learning Engineer PMLE
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & the Agent Platform Map
1.1 PMLE Exam Facts, Policies & the June 2026 Blueprint 1.2 From Vertex AI to Gemini Enterprise Agent Platform: The Product Name Map
2 Chapter 2: Low-Code ML with BigQuery ML
2.1 Choosing, Training & Predicting with BigQuery ML Models 2.2 Feature Engineering & Feature Selection in BigQuery ML 2.3 Fine-Tuning & Evaluating Gemini Models from BigQuery
3 Chapter 3: AutoML & Google Cloud AI APIs
3.1 Training Models with Agent Platform AutoML 3.2 Building with Document AI, Vision, Translation & Other AI APIs
4 Chapter 4: Foundation Models in Model Garden
4.1 Evaluating & Selecting Models in Model Garden 4.2 Building & Tuning Solutions with Gemini, Imagen, Veo & MaaS 4.3 Optimizing Gemini Applications for Cost, Latency & Availability
5 Chapter 5: Exploring, Preprocessing & Protecting Data
5.1 Organizing & Exploring Tabular, Text & Image Data 5.2 Choosing a Preprocessing Tool: BigQuery, Dataflow, Spark or Python 5.3 Creating & Consolidating Features in Agent Platform Feature Store 5.4 Protecting PII & Sensitive Data in ML Workflows
6 Chapter 6: Notebooks, Prototyping & Experiment Tracking
6.1 Workbench vs. Colab Enterprise: Secure, Collaborative Notebooks 6.2 Prototyping with PyTorch, scikit-learn, JAX & Model Garden in Notebooks 6.3 Experiment Environments, Tracking & Lineage with Experiments and ML Metadata
7 Chapter 7: Evaluating Predictive & Generative AI Solutions
7.1 Evaluation Metrics for Predictive Models 7.2 Evaluating Gen AI: Computation Metrics, Rubrics & LLM-as-a-Judge
8 Chapter 8: Choosing the Modeling Approach
8.1 Choosing the Model Type: ARIMA, Trees, DNNs & LLMs 8.2 Choosing the Product & Deployment Strategy 8.3 Modeling Techniques for Interpretability Requirements
9 Chapter 9: Training Data & Training SDKs
9.1 Organizing & Ingesting Training Data from Cloud Storage & BigQuery 9.2 Custom Training on Agent Platform: Containers, Jobs & Worker Pools 9.3 Kubeflow on GKE, AutoML & Tabular Workflows as Training Choices
10 Chapter 10: Troubleshooting, Hyperparameter Tuning & Fine-Tuning
10.1 Troubleshooting ML Training Failures 10.2 Hyperparameter Tuning on Agent Platform 10.3 Fine-Tuning Foundation Models & When to Tune
11 Chapter 11: Training Hardware & Distributed Training
11.1 Choosing CPUs, GPUs & TPUs for Training 11.2 Distributed Training: Data & Model Parallelism
12 Chapter 12: Deploying Models for Inference
12.1 Batch vs. Online Inference on Agent Platform 12.2 Serving Beyond Agent Platform Endpoints: Model Garden, Cloud Run & GKE 12.3 Prebuilt & Custom Serving Containers
13 Chapter 13: Model Versions, Rollouts & Inference Logic
13.1 Organizing & Versioning Models in Model Registry 13.2 Rollout Strategies: A/B Tests, Canaries & Traffic Splits 13.3 Inference Preprocessing & Postprocessing
14 Chapter 14: Scaling Online Serving
14.1 Serving Features Online with Feature Store 14.2 Public, Dedicated & Private Endpoints 14.3 Serving Hardware & Autoscaling for Throughput 14.4 Tuning Models for Production Training & Serving
15 Chapter 15: End-to-End ML Pipelines
15.1 Validating Data & Models in Pipelines 15.2 Agent Platform Pipelines with KFP: Components, Templates & Caching 15.3 Ensuring Consistent Preprocessing Between Training & Serving
16 Chapter 16: Orchestration with Managed Airflow & Ray
16.1 Orchestrating ML Workflows with Managed Service for Apache Airflow 16.2 Ray on Agent Platform for Distributed ML Workloads
17 Chapter 17: Automating Retraining & CI/CD/CT
17.1 Choosing a Retraining Policy 17.2 CI/CD/CT for ML with Cloud Build
18 Chapter 18: Securing AI Systems, Responsible AI & Explainability
18.1 Protecting AI Systems from Data & Model Exfiltration 18.2 Defending Gen AI Apps: Safety Filters, Model Armor & Regex Guardrails 18.3 Responsible AI: Detecting & Monitoring Bias 18.4 Model Explainability on Agent Platform
19 Chapter 19: Monitoring AI Solutions
19.1 Configuring Model Monitoring on Agent Platform 19.2 Training-Serving Skew, Data Drift, Concept Drift & Attribution Drift 19.3 Monitoring, Testing & Evaluating Gen AI Solutions in Production
15.2 Agent Platform Pipelines with KFP: Components, Templates & Caching
Key Takeaways Explain This Topic AI
Agent Platform Pipelines runs pipelines defined with the Kubeflow Pipelines SDK v2.0 or later or the TFX SDK v0.30.0 or later, serverlessly.
Execution caching reuses a step's outputs from ML Metadata when its inputs, output definitions, and component specification match a previous run of a pipeline with the same name.
Pipelines default to the slow failure policy, which keeps running other tasks after one fails; the fast policy stops scheduling new tasks.
Pipeline templates can be versioned in an Artifact Registry Kubeflow Pipelines repository and reused across teams.
Pipeline runs can be scheduled with the scheduler API using cron expressions, or triggered by events such as Pub/Sub messages through Cloud Run functions.
Last updated: September 2026
The exam guide lists building and orchestrating pipelines using managed or unmanaged services and from templates or custom solutions (for example, Agent Platform Pipelines, Managed Service for Apache Airflow, and Ray on Gemini Enterprise Agent Platform) . This section covers the managed ML-native option, Agent Platform Pipelines (formerly Vertex AI Pipelines). Chapter 16 covers Managed Airflow and Ray.
What a Pipeline Is
An ML pipeline is a directed acyclic graph (DAG) of containerized tasks connected by input-output dependencies . You define it in Python with the Kubeflow Pipelines (KFP) SDK v2+ or the TFX SDK v0.30+ , compile it to a YAML intermediate representation, and run it serverlessly. Tasks run in parallel by default unless one depends on another's outputs.
- SDK Choose when
- KFP Most workflows: any framework, custom components, Google Cloud Pipeline Components
- TFX TensorFlow workflows processing terabytes of structured or text data with TFX components
- Components
Type How you build it Use when
Lightweight Python component Decorate a function with @dsl.component(base_image=..., packages_to_install=[...]) Small Python steps
Container component Point at your own image with a command and arguments Heavy dependencies, non-Python code, reused training images
Google Cloud Pipeline Components (GCPC) Import prebuilt operators Calling Google Cloud services without writing API code
Useful GCPC operators
Area Operators
Data BigqueryQueryJobOp , DataflowPythonJobOp , DataflowFlexTemplateJobOp , DataprocPySparkBatchOp (Managed Spark), TabularDatasetCreateOp , ImageDatasetCreateOp
Training CustomTrainingJobOp , HyperparameterTuningJobRunOp , AutoMLTabularTrainingJobRunOp , AutoMLImageTrainingJobRunOp , BigqueryCreateModelJobOp
Evaluation ModelBatchPredictOp , ModelEvaluationClassificationOp , ModelEvaluationRegressionOp , ModelEvaluationForecastingOp , BigqueryEvaluateModelJobOp
- Registry and serving ModelUploadOp , EndpointCreateOp , ModelDeployOp , ModelUndeployOp
- Operations VertexNotificationEmailOp , WaitGcpResourcesOp
- A Minimal Training Pipeline from kfp import dsl, compiler
- from google_cloud_pipeline_components.v1.custom_job import CustomTrainingJobOp
- from google_cloud_pipeline_components.v1.model import ModelUploadOp
@dsl.component(base_image="python:3.11", packages_to_install=["google-cloud-bigquery"])
def check_row_count(table: str, min_rows: int) -> bool:
- from google.cloud import bigquery
- n = list(bigquery.Client().query(f"SELECT COUNT(*) n FROM `{table}`").result())[0].n
- return n >= min_rows
@dsl.pipeline(name="churn-training")
def pipeline(project: str, table: str):
ok = check_row_count(table=table, min_rows=100000)
with dsl.If(ok.output == True):
- train = CustomTrainingJobOp(project=project, display_name="churn-train",
- worker_pool_specs=[...])
...
compiler.Compiler().compile(pipeline, "churn_pipeline.yaml")
Control flow includes dsl.If (conditions), dsl.ParallelFor (fan-out), and dsl.ExitHandler (always run a final step, such as a notification).
- Running Pipelines job = aiplatform.PipelineJob(
- display_name="churn-training",
- template_path="churn_pipeline.yaml",
- pipeline_root="gs://ml-pipelines/churn",
- parameter_values={"project": "p", "table": "ds.features"},
- enable_caching=True,
- failure_policy="fast")
- job.submit(experiment="churn-experiments")
pipeline_root is the Cloud Storage location for artifacts.
Run as a service account with least-privilege access to data and services.
Tasks can request machine types and accelerators , use persistent resources , read Secret Manager secrets, and run over Private Service Connect networking.
Adding the run to an experiment makes runs comparable (Chapter 6).
Execution Caching
Before running a step, the service checks ML Metadata for a previous execution with the same cache key :
- The step's inputs (parameter values and input artifact IDs)
- Its output definitions
- The component specification (image, command, arguments, environment variables)
Only pipelines with the same pipeline name share the cache. On a match, the step is skipped and its outputs reused. Cached results have no TTL . They last until the metadata entry is deleted.
Turn caching off for a task with task.set_caching_options(False) , or for the whole run with enable_caching=False .
Components must be deterministic. A step that reads "latest data" through a fixed query string may be wrongly skipped, because its inputs look identical. Pass a date or snapshot parameter, or turn off caching for that step.
Failure Handling
- Setting Behavior
- failure_policy="slow" ( default ) Keep running other tasks after one fails, until all have been executed
- failure_policy="fast" Stop scheduling new tasks after a failure. Running tasks finish
- Task retries Retry transient failures, such as quota or network errors
- dsl.ExitHandler Always send a notification or clean up
- Templates and Reuse
A pipeline template publishes a compiled pipeline for reuse. Upload templates with the KFP registry client to an Artifact Registry Kubeflow Pipelines repository, with versions and tags . Teams then create runs from a template without seeing the source. The Template Gallery also offers Google-authored templates and components, such as AutoML for tabular classification and regression.
Scheduling and Triggers
Trigger Mechanism
Time-based Scheduler API with cron expressions. Schedules can be ACTIVE, PAUSED (resume with optional catch-up of missed runs), or COMPLETED
- New data in BigQuery Eventarc trigger that starts a pipeline when a job inserts into a table
- Pub/Sub message A Cloud Run function triggered by Pub/Sub submits the PipelineJob
- Code change Cloud Build CI/CD (Chapter 17)
- Monitoring alert A drift or performance alert publishes to Pub/Sub, which triggers retraining (Chapter 17)
- Lineage, Logs, and Cost
Every run records ML Metadata lineage automatically: artifacts, executions, and parameters.
Task logs go to Cloud Logging . The console links each step to its underlying job.
Pipeline costs include the orchestration charge per run plus the resources each task uses. Labels help attribute costs.