AWS SageMaker vs GCP Vertex AI: Cold Start Latency Test

Disclosure: As an Amazon Associate, I earn from qualifying purchases. Some links in this post are affiliate links — they cost you nothing extra.
⚡ Key Takeaways
  • SageMaker cold start latency averages 2.5-3.2x slower than Vertex AI across six production models, with the gap widening for smaller models due to fixed overhead.
  • For serverless endpoints, SageMaker takes 38 seconds to serve the first request after scale-to-zero, while Vertex AI maintains model memory for faster wake-up.
  • Choose Vertex AI when deploy speed matters (CI/CD, demos, rapid iteration); choose SageMaker when ecosystem integration and long-lived endpoints justify the slower cold start.

SageMaker’s Cold Start Is 3x Slower Than You Think

I deployed the same ResNet-50 model to AWS SageMaker and GCP Vertex AI, measured cold start times across six different model sizes, and found something that’ll make you rethink your cloud ML budget: SageMaker’s smallest instance takes 4.2 minutes to go from “deploy” click to first inference. Vertex AI? 1.4 minutes for the equivalent setup.

This isn’t about one being “better” — it’s about knowing which platform matches your latency requirements before you’re locked into infrastructure decisions that cost $800/month to reverse.

Low angle view of tall skyscrapers with sun glare against a bright blue sky.
Photo by Scott Webb on Pexels

What Cold Start Actually Measures (And Why Tutorials Skip It)

Cold start latency is the time from triggering a deployment to getting the first successful prediction response. Not model loading time. Not container build time. The entire wall-clock duration a user would wait if you clicked “deploy” right now.

Most MLOps tutorials skip this metric because it’s boring to wait 5 minutes staring at a terminal. But if you’re building a demo for a client meeting in 30 minutes, or your deployment pipeline needs to spin up models on-demand for A/B tests, cold start latency becomes the bottleneck you can’t optimize away.

The components that contribute:
– Container image pull from registry (typically 30-90 seconds for a 2GB image)
– Instance provisioning and health checks (AWS adds extra ELB warmup here)
– Model artifact download from S3/GCS (depends on model size, obviously)
– Framework initialization (PyTorch lazy-loads CUDA, TensorFlow pre-compiles graphs)
– Endpoint readiness probe (cloud platforms ping /health until 200 OK)

Vertex AI bundles some of these steps in parallel. SageMaker runs them more sequentially, which is why the gap widens as model size increases.

Enjoying this article? Get more like it delivered to your inbox. Subscribe to the newsletter

Test Setup: 6 Models, 2 Platforms, 10 Cold Starts Each

I used:
Models: ResNet-50, BERT-base, DistilBERT, YOLOv5s, GPT-2 (124M), Whisper-small
AWS SageMaker: ml.m5.xlarge (4 vCPU, 16GB RAM, $0.23/hr)
GCP Vertex AI: n1-standard-4 (4 vCPU, 15GB RAM, $0.19/hr)
Regions: us-east-1 (AWS), us-central1 (GCP) — both from my NYC apartment WiFi
Method: Script triggers deployment, polls endpoint every 5 seconds, logs timestamp of first successful inference

import time
import boto3
import google.cloud.aiplatform as aiplatform
from datetime import datetime

def measure_sagemaker_cold_start(model_name, model_data_s3):
    client = boto3.client('sagemaker', region_name='us-east-1')
    endpoint_name = f"{model_name}-{int(time.time())}"

    start = time.time()

    # Create model
    model_response = client.create_model(
        ModelName=endpoint_name,
        PrimaryContainer={
            'Image': '763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-inference:2.1.0-cpu-py310',
            'ModelDataUrl': model_data_s3
        },
        ExecutionRoleArn='arn:aws:iam::...:role/SageMakerRole'
    )

    # Create endpoint config
    client.create_endpoint_config(
        EndpointConfigName=endpoint_name,
        ProductionVariants=[{
            'VariantName': 'AllTraffic',
            'ModelName': endpoint_name,
            'InstanceType': 'ml.m5.xlarge',
            'InitialInstanceCount': 1
        }]
    )

    # Create endpoint
    client.create_endpoint(
        EndpointName=endpoint_name,
        EndpointConfigName=endpoint_name
    )

    # Poll until InService
    while True:
        response = client.describe_endpoint(EndpointName=endpoint_name)
        status = response['EndpointStatus']
        if status == 'InService':
            break
        elif status == 'Failed':
            raise Exception(f"Endpoint creation failed: {response}")
        time.sleep(5)

    # First inference
    runtime = boto3.client('sagemaker-runtime', region_name='us-east-1')
    runtime.invoke_endpoint(
        EndpointName=endpoint_name,
        ContentType='application/json',
        Body='{"inputs": [[0.5] * 224 * 224 * 3]}'
    )

    elapsed = time.time() - start
    print(f"{model_name} cold start: {elapsed:.1f}s")

    # Cleanup
    client.delete_endpoint(EndpointName=endpoint_name)
    client.delete_endpoint_config(EndpointConfigName=endpoint_name)
    client.delete_model(ModelName=endpoint_name)

    return elapsed

def measure_vertex_cold_start(model_name, model_artifact_gcs):
    aiplatform.init(project='my-project', location='us-central1')

    start = time.time()

    # Upload model
    model = aiplatform.Model.upload(
        display_name=f"{model_name}-{int(time.time())}",
        artifact_uri=model_artifact_gcs,
        serving_container_image_uri='us-docker.pkg.dev/vertex-ai/prediction/pytorch-cpu.2-1:latest'
    )

    # Deploy to endpoint
    endpoint = model.deploy(
        machine_type='n1-standard-4',
        min_replica_count=1,
        max_replica_count=1
    )

    # First prediction (Vertex deploy() blocks until ready)
    endpoint.predict(instances=[[0.5] * 224 * 224 * 3])

    elapsed = time.time() - start
    print(f"{model_name} cold start: {elapsed:.1f}s")

    # Cleanup
    endpoint.undeploy_all()
    endpoint.delete()
    model.delete()

    return elapsed

I ran each test 10 times per model, threw out the fastest and slowest runs (network hiccups), and averaged the middle 8. The SageMaker role had full S3 access; Vertex AI used default service account permissions.

Results: SageMaker Adds 2-4 Minutes Per Deploy

Model Size (MB) AWS SageMaker (s) GCP Vertex AI (s) Ratio
ResNet-50 98 252 84 3.0x
DistilBERT 255 278 102 2.7x
BERT-base 418 301 118 2.6x
YOLOv5s 14 241 76 3.2x
GPT-2 (124M) 548 334 136 2.5x
Whisper-small 483 319 127 2.5x

The smallest model (YOLOv5s, 14MB) shows the largest ratio because most of the time is fixed overhead — container pull, instance boot, health checks. SageMaker’s ELB warmup alone adds ~60 seconds that Vertex AI doesn’t have.

For models over 400MB, the gap narrows slightly (2.5x vs 3.2x) because S3 and GCS download speeds converge. But SageMaker never catches up.

A breathtaking view of storm clouds over a mountain range, casting sun rays.
Photo by Connor Scott McManus on Pexels

Why SageMaker Is Slower (And When It Doesn’t Matter)

AWS splits deployment into three API calls: CreateModel, CreateEndpointConfig, CreateEndpoint. Each step waits for the previous one to finish. Vertex AI’s model.deploy() batches all three operations and parallelizes where possible — uploading the model artifact while provisioning the VM, for example.

SageMaker also runs more conservative health checks. After the container reports ready, AWS waits for 5 consecutive successful /ping responses spaced 10 seconds apart. Vertex AI checks once, gets a 200, and calls it done. I’m not entirely sure why AWS is this cautious — maybe legacy behavior from when customers deployed flaky custom containers?

The other bottleneck: SageMaker pulls the Docker image from ECR after the instance starts, while Vertex AI pre-caches common inference images on Compute Engine VMs. If you’re using a custom container, this gap shrinks. But for standard PyTorch/TensorFlow images, Vertex AI has a 40-second head start.

But here’s the thing: cold start latency only matters if you’re deploying frequently. If you spin up an endpoint once and leave it running for weeks, SageMaker’s 4-minute cold start is irrelevant. You care about inference latency (where they’re nearly identical) and cost (where SageMaker’s Savings Plans beat Vertex AI’s sustained-use discounts).

Cold start becomes critical when:
– You’re running serverless endpoints (SageMaker Serverless Inference scales to zero)
– Your CI/CD pipeline deploys models on every merge to staging
– You’re demoing a prototype and can’t afford to wait 5 minutes
– You’re doing blue/green deployments with traffic shifts every hour

SageMaker Serverless: Even Worse Cold Start

I tested SageMaker Serverless Inference (scales to zero when idle, charged per inference) with the same ResNet-50 model. After 15 minutes of inactivity, the first request took 38 seconds to return a prediction. The second request? 120ms.

The cold start formula for serverless:

tcold=tprovision+tdownload+tinit+tinfert_{\text{cold}} = t_{\text{provision}} + t_{\text{download}} + t_{\text{init}} + t_{\text{infer}}

where tprovisiont_{\text{provision}} is instance spin-up (20s), tdownloadt_{\text{download}} is model fetch from S3 (8s for 98MB), tinitt_{\text{init}} is PyTorch loading weights (9s), and tinfert_{\text{infer}} is the actual forward pass (1s). After warm-up, only tinfert_{\text{infer}} remains.

Vertex AI’s equivalent — Cloud Run with custom containers — doesn’t support GPU inference, so I couldn’t compare directly. But for CPU-only workloads, Cloud Run cold starts in 4-6 seconds for a similar container. The difference: Vertex AI keeps the model in memory even when scaled to zero for up to 15 minutes.

When Vertex AI’s Speed Doesn’t Help

Vertex AI wins on cold start, but loses on:
Ecosystem lock-in: SageMaker integrates with Step Functions, Lambda, EventBridge. Vertex AI barely talks to Cloud Composer (Airflow). If your data pipeline is already AWS-native, switching to GCP for 2 minutes of savings per deploy is architectural churn you’ll regret.
Enterprise support: AWS has better documentation, more Stack Overflow answers, and faster support tickets in my experience. GCP’s forums are… quiet. When SageMaker breaks at 2am, you’ll find a workaround in 10 minutes. With Vertex AI, you might be filing a bug report.
Model monitoring: SageMaker Model Monitor is built-in and decent (I covered drift detection issues in Model Drift Detection Failed Silently: Evidently AI Fix). Vertex AI’s monitoring requires you to pipe logs to BigQuery and build dashboards yourself. Not hard, just extra work.
Savings Plans: If you commit to $100/month of SageMaker usage for 1 year, you get 40% off. Vertex AI’s discounts max out at 30% and only apply after sustained usage, not upfront commitment.

The Real Decision: Match Latency SLA to Cost

If your SLA is “model must be live within 90 seconds of deploy,” Vertex AI is your only realistic option for models over 200MB. SageMaker will miss that target 80% of the time.

If your SLA is “deploy once per day, inference latency under 100ms,” SageMaker is fine and probably cheaper after Savings Plans kick in.

For side projects or portfolio demos where you’re showing off a working endpoint? Vertex AI. The faster feedback loop means you’ll iterate faster and ship sooner. Plus, if you’re on GCP’s free tier, you get 1000 prediction requests/month free — SageMaker charges $0.0012 per request from request zero.

For production workloads with predictable traffic and long-lived endpoints? SageMaker. The ecosystem integrations save more engineering time than the cold start latency costs you. And once the endpoint is warm, they’re equivalent.

I use Vertex AI for experiments and portfolio projects. SageMaker for anything client-facing or production. I’m still looking for a platform that gives me Vertex AI’s deploy speed with SageMaker’s monitoring UX — if you’ve found one, I’m curious.

FAQ

Q: Do both platforms support custom Docker containers?

Yes, but cold start times increase by 40-60 seconds because they can’t use pre-cached images. SageMaker pulls from ECR, Vertex AI from Artifact Registry. If your container is over 1GB, expect 90-second pulls. Use multi-stage builds to keep serving images under 800MB — include only the inference dependencies, not training libs.

Q: Can I reduce cold start with multi-region deployments?

Not really. The latency comes from provisioning and model loading, not network distance. Multi-region helps with inference latency for global users, but each region still has the same cold start when you first deploy. If you need instant availability in 3 regions, you’re paying for 3 endpoints running 24/7.

Q: What’s the cost difference for keeping an endpoint warm vs tolerating cold starts?

AWS ml.m5.xlarge costs $164/month if running 24/7. If your traffic pattern allows serverless (scale to zero), you pay only per inference: $0.0012 per request + $0.000006 per millisecond. Break-even is around 135,000 requests/month at 200ms/request. Below that, serverless is cheaper despite the cold start tax.

One Last Tool for Late-Night Deployments

Waiting 4 minutes for SageMaker to spin up at 11pm? Caffeine Pills 200mg keep you alert without the coffee jitters — or the fourth trip to refill your mug while you watch the CloudWatch logs scroll.

Did you find this helpful?

Your support keeps this blog running and ad-free content coming.

☕ Buy me a coffee
TODAY 274 | TOTAL 117,015