Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Cloud and Containers for ML  ›  Lesson

Cloud Compute and Storage for ML

AWS / Azure / GCP 13 minML workloads keep data and artifacts in object storage and rent compute on demand, using large or GPU machines briefly for training and small always-on machines for serving.

Cloud Compute and Storage for ML

Tunebox could buy a GPU server for the churn project. It would sit idle six days a week, fill up with data, and break on a holiday weekend. ML workloads are bursty — a big job once a week, a small steady service the rest of the time — and that shape is exactly what the cloud is good at renting.

The rule

Keep data in buckets; rent big machines briefly; run serving small and steady.

Each of the big three clouds — AWS, Google Cloud and Azure — offers the same three building blocks under different names:

Need AWS Google Cloud Azure
Object storage S3 Cloud Storage Blob Storage
Virtual machines, incl. GPUs EC2 Compute Engine Virtual Machines
Cheaper machines that can be reclaimed Spot Instances Spot VMs Spot VMs

Object storage holds files of any size in buckets, is cheap per gigabyte, and every ML tool can read it. It is the natural home for raw data, the DVC remote, and trained model files.

Compute splits into two very different workloads:

  • Training needs a lot of power for a short time. Start a large machine — with GPUs if the model is a neural network — run the job, and shut it down. You pay only for the hours used.
  • Serving needs a little power all the time, with low latency. A few small machines, or containers, behind a load balancer.

Spot capacity is spare cloud capacity sold at a large discount, but the provider can take it back with little warning. It suits training jobs that save checkpoints and can resume, and it is a poor fit for a live API.

One more rule: put storage and compute in the same region. Moving large data between regions is slow and is usually billed.

The shortcut

For each workload ask two questions: "Does it run always, or in bursts?" and "Can it survive being interrupted?"

Placing the churn workloadsStep 1 of 4
  1. Training data and models

    Stored, not run. An S3 bucket in the same region as the compute.

Drills

Answer fast — trust the rule.

quick drill

Where should the DVC remote and trained model files live?

quick drill

Which churn workload is the best fit for spot machines?

quick drill

Training runs in one region and the 400 GB dataset sits in a bucket in another. What is the problem?

quick drill

Why is a dedicated always-on GPU machine usually a poor choice for weekly training?

Remember

  • Keep data in buckets; rent big machines briefly; run serving small and steady.
  • Ask: always or bursts? Can it survive interruption?
  • Trap: paying for idle GPUs, or putting data and compute in different regions.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainSize the infrastructure

Propose cloud infrastructure for the churn project: where the data and models live, what runs the weekly training, and what runs the prediction API. Justify each choice by cost and workload shape.