🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Cloud ML Platforms: SageMaker, Vertex, and Azure ML

⭐ Premium

Cloud ML Platforms: SageMaker, Vertex, and Azure ML

Managed ML platforms exist because the unglamorous 80% of machine learning — provisioning GPUs, packaging training jobs, wiring CI/CD, serving endpoints, monitoring drift — is identical across companies and rarely differentiates a product. AWS SageMaker, Google Vertex AI, and Azure Machine Learning each offer a full lifecycle stack: data labeling, training, hyperparameter tuning, registries, endpoints, and monitoring. Choosing one is less about which has the best autoencoder demo and more about which fits your cloud footprint, compliance needs, and how much portability you are willing to sacrifice.

This lesson compares the three platforms on the axes that actually matter for delivery — training jobs, model serving, and MLOps glue — then shows a portable training pattern that keeps your core logic vendor-neutral. Treat this as decision support, not a tutorial for any single console.

What You'll Learn

  • 1Map platform capabilities to real ML workload requirements before committing
  • 2Compare training, tuning, serving, and registry features across the three major platforms
  • 3Design a vendor-neutral training core wrapped in thin platform adapters
  • 4Evaluate cost, lock-in, and compliance trade-offs with a concrete scorecard

Prerequisites

  • !Experience training models in Python
  • !Basic familiarity with at least one cloud provider's core services
  • !Understanding of containers and REST APIs from earlier lessons

What a managed ML platform actually provides

Under the marketing, every major platform converges on the same capability layers. Compute orchestration schedules training on CPU/GPU instances, handles spot interrupts, and checkpoints. Experiment tracking and registry store run metadata and model versions with lineage. Serving offers managed endpoints (real-time), batch transform jobs, and increasingly serverless or multi-model endpoints. Feature and data services manage feature stores, data versioning, and labeling. MLOps tooling wires pipelines, triggers, and monitoring into the control plane.

The differentiation is in maturity and coupling. Vertex AI is deeply integrated with BigQuery and Google's TPU/networking stack and leans heavily on AutoML and its foundation models. SageMaker has the broadest instance-type catalog, the longest feature history, and the deepest AWS service integrations (IAM, KMS, Lake Formation). Azure ML integrates tightly with Azure DevOps, Active Directory, and the OpenAI service ecosystem, and is often the choice in Microsoft-centric enterprises.

CapabilitySageMakerVertex AIAzure ML
Managed trainingTraining jobs, spot, distributedCustom jobs, AutoML, TPU podsCompute clusters, distributed
Hyperparameter tuningHPO built-inVizier-backed tuningSweep on jobs
Model registryModel Registry with stagesModel Registry with aliasesModel Registry with stages
Real-time servingEndpoints, serverless inferenceEndpoints, private endpointsManaged endpoints, KServe
Batch scoringBatch transformBatch prediction jobsBatch endpoints
Pipeline orchestrationPipelines (SDK v2)Vertex Pipelines (KFP)Azure ML Pipelines / CLI
MonitoringModel MonitorModel MonitoringData drift monitor
Strongest integrationAWS data/IAM stackGCP data + TPU stackAzure AD/DevOps/OpenAI

Training jobs: the portable core pattern

The fastest way to avoid lock-in is to keep training logic as a plain Python module with a documented entrypoint, then wrap it per platform. Platform SDKs are thin adapters; the model code never imports sagemaker or google.cloud.aiplatform directly.

python
# train_core.py — vendor-neutral training logic
import json
import os
from pathlib import Path

import numpy as np
import pandas as pd
from sklearn.datasets import load_breast_cancer
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
import mlflow


def load_data(data_dir: str):
    """Read whatever the platform mounted; fall back to sklearn sample."""
    path = Path(data_dir) / "training.csv"
    if path.exists():
        df = pd.read_csv(path)
        X = df.drop(columns=["target"]).to_numpy()
        y = df["target"].to_numpy()
    else:
        X, y = load_breast_cancer(return_X_y=True)
    return train_test_split(X, y, test_size=0.2, stratify=y, random_state=42)


def train(args):
    mlflow.set_tracking_uri(os.environ.get("MLFLOW_TRACKING_URI", "file:./mlruns"))
    mlflow.set_experiment(args.experiment)

    X_tr, X_te, y_tr, y_te = load_data(args.data_dir)

    with mlflow.start_run(run_name=args.run_name):
        mlflow.log_params(vars(args))
        clf = GradientBoostingClassifier(
            n_estimators=args.n_estimators,
            max_depth=args.max_depth,
            learning_rate=args.learning_rate,
            random_state=42,
        )
        clf.fit(X_tr, y_tr)
        auc = roc_auc_score(y_te, clf.predict_proba(X_te)[:, 1])
        mlflow.log_metric("roc_auc", auc)

        out = Path(args.model_dir)
        out.mkdir(parents=True, exist_ok=True)
        import joblib
        joblib.dump(clf, out / "model.joblib")
        (out / "metrics.json").write_text(json.dumps({"roc_auc": auc}))
        mlflow.sklearn.log_model(clf, artifact_path="model")
        print(f"auc={auc:.4f} model_dir={out}")

Each platform then supplies data paths, environment variables, and a launch wrapper. SageMaker runs the module as a training job with /opt/ml/input/data mounts and writes to /opt/ml/model; Vertex runs the same entrypoint as a custom job with Cloud Storage paths; Azure ML maps AML_DATA_DIR and AML_MODEL_DIR. The core stays unit-testable on a laptop — the property that matters most for iteration speed.

Hyperparameter tuning without rewriting the search

All three platforms offer successive-halving or Bayesian sweeps over the same search space definition. Keep the search space in your repo and let each platform's tuner consume it:

python
# search_space.py — single source of truth
SEARCH_SPACE = {
    "n_estimators": {"type": "int", "low": 100, "high": 600},
    "max_depth": {"type": "int", "low": 2, "high": 8},
    "learning_rate": {"type": "loguniform", "low": 0.005, "high": 0.2},
    "subsample": {"type": "uniform", "low": 0.6, "high": 1.0},
}

# Example: SageMaker HPO consumes a nearly identical dict via its SDK;
# Vertex HyperparameterTuningJob and Azure ML sweeps take the same keys
# mapped through thin adapter functions in platform/ adapters/.

Compare trials through MLflow (or platform-native experiment tracking) rather than trusting each console in isolation — a unified trial table is what lets you answer "which platform's tuner found the better region fastest" during a bake-off. Budget the bake-off honestly: tuning quality differences are usually smaller than data-quality differences.

Serving: endpoints, batch, and serverless

Real-time endpoints are the most expensive and most visible serving option. Every platform manages autoscaling replicas of a container you supply (or a prebuilt sklearn/TensorFlow image). Batch transform is the underused alternative for nightly scoring where latency SLAs are hours, not milliseconds.

python
# serve_app.py — same entrypoint, three platforms
import os
from pathlib import Path
import joblib
import pandas as pd
from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()
MODEL = joblib.load(Path(os.environ.get("MODEL_DIR", "./model")) / "model.joblib")

class Features(BaseModel):
    values: list[list[float]]

@app.get("/health")
def health():
    return {"status": "ok"}

@app.post("/score")
def score(payload: Features):
    df = pd.DataFrame(payload.values)
    proba = MODEL.predict_proba(df)[:, 1].tolist()
    return {"scores": proba}

Package that app in the container the platform expects, and the same image can serve behind SageMaker's inference toolkit, Vertex's custom prediction routine, or Azure ML's online endpoint. For very spiky traffic, evaluate serverless options (SageMaker Serverless Inference, Vertex AI Endpoints with scale-to-zero policies, Azure Container Apps) — per-invocation pricing beats paying for idle GPU replicas, at the cost of cold starts.

MLOps glue: pipelines, triggers, and monitoring

The platform differentiator for teams beyond the first model is how cleanly training, evaluation, registration, and deployment wire into an auditable pipeline with human approval gates.

SageMaker Pipelines (SDK v2) and Vertex Pipelines (Kubeflow-based) both express DAGs of steps — preprocess, train, evaluate, register — that run on managed infrastructure and record lineage. Azure ML Pipelines integrate natively with Azure DevOps YAML and GitHub Actions. For registration, all three support approval workflows: a model version moves from staging to production only after a reviewer action, which is what compliance auditors actually ask to see.

Monitoring closes the loop. Model Monitor (SageMaker), Vertex AI Model Monitoring, and Azure's data-drift monitor all sample live predictions, compare feature distributions to a training baseline, and raise drift reports — wire alerts into the same pager as application SLAs, and feed drift events into the retraining trigger from the previous lesson.

Portability, lock-in, and cost realities

Full portability across clouds for ML is a spectrum, not a binary. Maximum portability means containers plus a platform-neutral orchestrator (Kubeflow, Argo, or plain Kubernetes Jobs) running on any cloud — you own more glue but keep optionality. Managed pipelines buy speed and support at the cost of rewriting workflow definitions if you switch providers.

Cost is dominated by GPU hours for training and by idle endpoint capacity for serving — not by the platform's per-hour management fee. Before committing, model three-year cost with realistic utilization: teams routinely over-provision endpoints "just in case" and under-provision data-transfer budgets between regions. Spot/preemptible instances with checkpointing routinely cut training cost 60–80% across all three clouds.

A practical decision framework: start with the cloud your data already lives in (egress and IAM friction dominate), verify the specific services you need exist at the maturity level you require (feature store, TPU access, confidential computing), and only then compare feature checklists. Bake off with one real end-to-end workload — the pattern in this lesson — for two weeks before standardizing.

Common Mistakes

Importing platform SDKs throughout training code, then struggling to port

Fix: Keep train_core.py vendor-neutral; isolate platform calls in thin adapter modules reviewed as integration code.

Choosing a platform for its AutoML demo while your workload is custom deep learning

Fix: Evaluate the services you will actually use — distributed training, custom containers, feature store — with a representative bake-off, not the marketing tour.

Leaving real-time endpoints at fixed replica counts

Fix: Configure autoscaling on CPU or custom metrics and use serverless endpoints for spiky traffic; idle GPUs dominate cost.

Skipping registry approval gates because they slow down demos

Fix: Human approval gates on production promotion are what auditors require; add them before the first regulated model ships, not after an incident.

Best Practices

  • Structure repos as vendor-neutral core + platform adapters so portability is a build-time choice, not a rewrite
  • Track all experiments in MLflow (or a unified layer) even when using platform-native tracking, for cross-cloud comparison
  • Serve batch workloads with batch transform rather than over-provisioning real-time endpoints
  • Model three-year TCO with realistic GPU utilization and spot usage before committing
  • Wire model registry approvals into CI/CD so promotion is audited by default

Interview Questions

Q1: How do you keep ML training code portable across cloud platforms?

Isolate platform-specific code (job submission, data mounts, checkpoint paths) in thin adapters and keep the training logic in a vendor-neutral module with a documented entrypoint and environment contract. Containers plus MLflow tracking complete the portable core.

Q2: When is batch transform preferable to a real-time endpoint?

When scoring latency can be minutes to hours — nightly batch scores, backfills, bulk enrichment. Batch is dramatically cheaper and simpler than maintaining idle autoscaled endpoints for spiky demand.

Q3: What is the most common source of surprise cost on managed ML platforms?

Idle real-time GPU endpoints left at fixed capacity, followed by under-utilized provisioned throughput for inference instances and forgotten notebook instances. Autoscaling and scheduled scale-down are the main levers.

Key Takeaways

  • Managed platforms converge on training, registry, serving, and monitoring; differentiate on integration depth, maturity, and lock-in appetite
  • The portable core pattern (vendor-neutral train_core.py + thin adapters) preserves optionality without sacrificing managed infrastructure benefits
  • Keep the hyperparameter search space and serving entrypoint in your repo; let each platform's tuner and endpoint consume them
  • Cost is driven by GPU utilization and idle endpoints, not management fees — spot training and autoscaled or serverless serving are the levers
  • Bake off one real end-to-end workload for two weeks before standardizing; checklist comparisons miss integration friction
🔒

Premium Content

Cloud ML Platforms: SageMaker, Vertex, and Azure ML

You've previewed the first section. Unlock this full lesson and 900+ advanced tutorials with a Premium plan.

đŸŽ¯End-to-end Projects
đŸ’ŧInterview Prep
📜Certificates
🤝Community Access

Already a member? Log in

CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-13

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Continue Learning

Suggested next tutorials based on this topic

Advertisement