↑ ↓ to move, Enter to open, Esc to close

    GCP-PMLEProfessional Machine Learning Engineer

    Switch exam

    Microsoft Azure

    aws Amazon Web Services

    Google Cloud

    ServiceNow

    Databricks

    Cisco

    Salesforce

    All exams and search

    Exams / GCP-PMLE / D1 Scaling prototypes into ML models

    D1.1

    Scaling prototypes into ML models (part 1 of 3)

    • 2 min read
    • 5 sections
    • 31 questions
    • Free preview
    • Exam domain: Scaling prototypes into ML models
    You are reading a free preview. The rest of the GCP-PMLE course unlocks with an Exam pass or All access.See plans

    Choosing how to scale training

    Situation Choice Why
    Several GPUs on one machine, least effort One Vertex AI worker pool, MirroredStrategy No multi-worker cluster configuration
    Several machines with GPUs MultiWorkerMirroredStrategy Synchronous multi-worker training
    Custom TensorFlow ops GPUs, not TPU Cloud TPU supports only a documented list of TensorFlow Python APIs and graph operators
    Debuggable TPU training TPU VM You can connect by SSH directly to the VM physically attached to the TPU
    PyTorch at scale Vertex AI custom training with a prebuilt training container Managed, no cluster to operate
    No speed-up from more GPUs Increase the global batch size Each replica receives a share of the global batch

    Pick the distribution strategy by hardware

    Input-bound training

    If the accelerator idles while CPU transforms and network loads run in sequence, the job is input-bound. Parallelize file reads, parallelize map() and add prefetch(); a faster TPU or GPU only waits more.

    TPU idle: fix the input pipeline

    For very large structured data, convert CSVs to sharded TFRecords in Cloud Storage so reads are parallel.

    Hyperparameter tuning on Vertex AI

    Hyperparameter Scale
    Bounded integer (e.g. embedding size) UNIT_LINEAR_SCALE
    Learning rate across orders of magnitude UNIT_LOG_SCALE

    Bayesian optimization (the default) uses earlier trials to choose later ones, so fewer parallel trials give better results when elapsed time does not matter.

    Data and metrics

    Problem Remedy
    Rare positive class Downsample and upweight the majority class
    Missing numeric values, rows needed Impute (e.g. predict with a regression model)
    Time-sensitive tabular data in AutoML Chronological split on the Time column
    Features on different ranges Normalize
    Missing fraud (false negatives) Lower the classification threshold; add positive examples
    Many uninformative linear features L1 regularization (sparse weights)
    Overfitting Tune L2 / dropout on validation data
    City-specific effects Cross binned latitude x binned longitude x category
    Imbalanced binary classes F1 / precision-recall, not accuracy

    Experiments, tooling and exploration

    • Link a Vertex AI PipelineJob to a Vertex AI Experiment to compare runs and be ready for production.
    • Recommendations: Frequently Bought Together targets basket size; Others You May Like defaults to click-through rate.
    • One-off, flexible EDA: Workbench notebook. Large aggregates: BigQuery. Time plots: Looker Studio.
    • Spark notebooks: Workbench instance with the Dataproc JupyterLab extension.

    Exam traps

    • Custom TensorFlow ops rule out TPU.
    • A faster accelerator does not fix an input-bound trace.
    • ModelValidator (TFX) is now the Evaluator component; AI Platform Training is now Vertex AI custom training.
    • Random splits leak the future on time-sensitive data.
    • A suspiciously perfect metric early on points to leakage, not a great model.
    • Recall protects against false negatives; precision against false positives.

    Docs

    The rest of this chapter is part of the GCP-PMLE premium course

    Unlock every chapter, all 375 questions and spaced review with All access or a 90-day exam pass. Every Fundamentals exam stays free, and the first chapter of every exam is open.

    Chapters