Scaling Prototypes into ML Models
This domain covers the end-to-end workflow of taking a working prototype and operationalizing it as a production-ready model using Vertex AI custom training. It tests your ability to select the right infrastructure (containers, accelerators, distributed strategies), tune models systematically, handle data quality issues like class imbalance, and manage the training lifecycle through checkpointing and retraining. At 18% of the exam, this is one of the heaviest-weighted domains — expect 8–12 questions that mix conceptual understanding with scenario-based reasoning.
Custom Training Jobs: Containers, Python Packages, GPUs/TPUs
Core Concepts
Vertex AI custom training lets you run ML workloads on managed infrastructure. You define a training application using one of two mechanisms:
| Mechanism | When to Use | Key Requirement |
|---|---|---|
| Pre-built container | Framework matches a Google-supported image (TF, PyTorch, XGBoost, sklearn) | Specify imageUri from us-docker.pkg.dev/vertex-ai/training/ |
| Custom container | Custom dependencies, exotic frameworks, specific library versions | Push image to Artifact Registry (not Container Registry — deprecated) |
| Python package | Simple Python code, pre-built container is acceptable | Package must follow setup.py convention; stored in Cloud Storage |
Custom training job anatomy (via CustomJob or CustomTrainingJob in Vertex AI SDK):
workerPoolSpecs: defines machine type, accelerator, replica count, and container/packagebaseOutputDirectory: Cloud Storage path for model artifactsserviceAccount: controls GCS/BigQuery access during training- Machine types:
n1-standard-*,n1-highmem-*,n1-highcpu-*,a2-highgpu-*(A100),c2-*
GPU/TPU Selection
| Accelerator | Use Case | Notes |
|---|---|---|
| NVIDIA T4 | Cost-efficient inference/training, mid-size models | 16 GB HBM2 |
| NVIDIA V100 | High-throughput training, NLP | 16/32 GB |
| NVIDIA A100 | Large model training, transformers | 40/80 GB; requires a2-highgpu machine |
| TPU v2/v3/v4 | TensorFlow-native large-scale training | Must use TF; attached to cloud-tpu worker pool |
| NVIDIA L4 | Energy-efficient, mid-tier | Good for fine-tuning |
TPU-specific rules:
- TPUs require TensorFlow (or JAX); PyTorch support is limited/experimental on Vertex AI managed TPUs
- TPU workers are specified in a separate worker pool with
tpuTfVersion - TPU VMs use TPU pods for scaling; a TPU v3-8 has 8 cores
Common Traps
- Using Container Registry instead of Artifact Registry — Google deprecated Container Registry; exam expects Artifact Registry
- Thinking Python packages eliminate the need for a container — they still run inside a pre-built container
- Selecting TPUs for a PyTorch workload — TPUs on Vertex AI are TensorFlow/JAX optimized
- Forgetting that
baseOutputDirectorymust be a Cloud Storage URI (gs://), not a local path
Worked Scenario
Requirement: A team has a PyTorch training script with a custom C++ extension that must be compiled at build time. What training mechanism should they use?
Reasoning: Pre-built containers cannot accommodate custom compiled extensions. A Python package won't work because the C++ compilation happens at build time. Custom container pushed to Artifact Registry is the correct answer. The container's Dockerfile handles the compilation, and the container URI is referenced in workerPoolSpecs.
Distributed Training Strategies
Decision tree for choosing distributed training strategy in Vertex AI
TensorFlow Distribution Strategies
| Strategy | Topology | Vertex AI Setup |
|---|---|---|
MirroredStrategy | Single machine, multiple GPUs | 1 worker pool, multiple GPUs |
MultiWorkerMirroredStrategy | Multiple machines, all-reduce | Multiple replicas in worker pool; Vertex sets TF_CONFIG automatically |
ParameterServerStrategy | Parameter server + workers | Two worker pools: chief + workerPool + optional parameter server pool |
TPUStrategy | TPU cores | tpuTfVersion in TPU worker pool |
Key exam fact: Vertex AI automatically injects TF_CONFIG when you use MultiWorkerMirroredStrategy with multiple replicas. You do NOT need to set it manually.
PyTorch Distributed Training
- Use
torch.distributedwithDistributedDataParallel(DDP) - Vertex AI sets
MASTER_ADDR,MASTER_PORT,WORLD_SIZE,RANKenvironment variables automatically - Specify
replicaCount > 1in workerPoolSpec - Use
torchrun(formerlytorch.distributed.launch) as the entry point
Reduction Server
Reduction Server is a Vertex AI feature that accelerates all-reduce operations in multi-node training:
- Acts as a relay to reduce cross-machine gradient communication latency
- Specified as an additional worker pool with machine type
n1-highcpu-* - Beneficial for large-batch, bandwidth-sensitive multi-node GPU training
- Works with both TF
MultiWorkerMirroredStrategyand PyTorch DDP
Common Traps
- Assuming you must manually configure
TF_CONFIG— Vertex AI injects it automatically - Using
MirroredStrategyacross multiple machines — it only works on a single machine - Forgetting that
ParameterServerStrategyrequires separate worker pools for PS and workers - Confusing Reduction Server (gradient communication optimizer) with a parameter server
Worked Scenario
Requirement: A team trains a large TF model on 16 machines, each with 8 GPUs. Training is slow due to gradient synchronization overhead. What should they add?
Reasoning: They're already using MultiWorkerMirroredStrategy. The bottleneck is all-reduce communication. Adding a Reduction Server worker pool reduces cross-node bandwidth bottlenecks. This is distinct from changing the distribution strategy.
Unlock with a paid plan
7 more sections (about 2,079 words) continue below. Every paid plan unlocks all Professional Machine Learning Engineer study guides, the full question bank and mock exams, from $4.97/month.