CSC3119 Β· Module 4 of 9

Cloud Computing Concepts, Service Models & Hardware Sizing

Understand NIST cloud characteristics, IaaS/PaaS/SaaS/MLaaS, and GPU/CPU cost modeling

~56 min to study properly

Running model deployment on a personal laptop or physical on-premise server is fraught with power cuts, network drops, and fixed compute limitations. Cloud computing provides elastic, on-demand compute infrastructure.

Checkpoint Β· the examiner asks

Differentiate IaaS, PaaS, and MLaaS in the context of deploying an ML model, and explain how Spot instances reduce cloud costs while managing termination risk.

In one minute

Cloud gives elastic, on-demand compute. Know NIST's five characteristics and the service models: IaaS (VMs), PaaS (managed platforms like Render), SaaS, MLaaS (SageMaker, Vertex AI). Tabular models run cheaply on CPUs; large neural nets need GPUs that should scale to zero when idle. Spot/preemptible VMs are 70–90% cheaper but can be reclaimed, so use them for checkpointed training and batch jobs.

Traps examiners look for
  • Serving a small XGBoost model on an always-on GPU.
  • Running latency-critical serving on Spot instances without fallback.
  • Confusing PaaS with IaaS β€” who manages the OS?
Read

Study notes

01Why the cloud for ML

A model served from a laptop or a single on-prem server inherits all its weaknesses: power cuts, a flaky uplink, no room to grow, and a long wait to buy new hardware. Cloud computing rents compute, storage and networking on demand, billed by usage.

The NIST definition has five essential characteristics β€” learn them by name:

  1. On-demand self-service β€” provision resources yourself, no human in the loop.
  2. Broad network access β€” available over the network from standard clients.
  3. Resource pooling β€” the provider serves many tenants from shared hardware.
  4. Rapid elasticity β€” scale out and in quickly, even automatically.
  5. Measured service β€” usage is metered and billed.

02Service models β€” who manages what

ModelYou manageProvider managesML example
IaaSOS, runtime, app, datahardware, virtualisationan EC2 / Compute Engine VM you install Python on
PaaSapp and dataOS, runtime, scalingRender, App Engine, Cloud Run running your FastAPI container
SaaSjust your usageeverythinga hosted analytics tool
MLaaSdata, model choicestraining/serving infrastructureSageMaker, Vertex AI

Moving down the table you give up control for convenience. Our StudyRoom backend is a PaaS deployment (Render); the hospital might choose IaaS in a nearby region for data-residency reasons.

03CPU, GPU and right-sizing

Match hardware to the model, not to the hype:

  • Tabular models (logistic regression, RandomForest, XGBoost) do little arithmetic per prediction. A small CPU instance serves them in ~10–25 ms for pennies.
  • Large neural networks (vision transformers, LLMs) do billions of multiply-adds; GPUs do these in parallel and are worth their price β€” but only when busy. An idle GPU still bills by the hour, so GPU services should auto-scale to zero when quiet.

Latency has two parts: compute (how long the model takes) and network (distance to the users). For a Ugandan hospital, a server in Johannesburg adds ~40 ms per round trip; one in Ireland ~135 ms. Often the region matters more than the instance size.

04Spot and preemptible instances

Providers sell spare capacity as Spot (AWS), Preemptible/Spot (Google) VMs at 70–90% off β€” with a catch: they can be reclaimed with about two minutes' notice.

  • Great for training and batch scoring: save checkpoints regularly, and if the VM disappears, resume from the last checkpoint on a new one.
  • Wrong for real-time clinical serving: a reclaimed instance means triage stops answering. Serve on on-demand (or reserved) instances, possibly with Spot capacity added behind a load balancer only for overflow.

Cost arithmetic: spot rate = on-demand Γ— (1 βˆ’ discount); job cost = rate Γ— hours.

Watch it done

Worked examples

Worked example 1

Spot retraining bill

Nightly retraining runs 3 hours on a GPU that costs $2.80/h on-demand, with a 72% Spot discount. What is the monthly cost (30 nights) on Spot vs on-demand?

    Worked example 2

    Region or instance?

    A 2-vCPU instance serves in 24 ms; an 8-vCPU instance in 9 ms. The Johannesburg region adds 42 ms of network latency, an on-prem Kampala server 8 ms. Which gives the lowest total latency for hospital users?

      Vocabulary

      Key terms

      Latency Realities in East Africa

      A client in Kampala making API calls to an EU-West (Ireland) data center incurs a minimum physical speed-of-light round-trip latency of ~130ms. Deploying on African edge locations (af-south-1 in Cape Town or local CDNs) drops network latency to under 35ms.

      Practise

      Quick check

      0 of 8 correct so far. Wrong answers come with an explanation β€” and the buddy can unpack them.

      Q1Which cloud service model requires you to configure the Linux kernel, install Nvidia GPU drivers, and manage Docker security updates yourself?

      Q2If an on-demand GPU VM costs $2.40/hour and a spot instance offers a 75% discount, what is the cost of running a 10-hour training job on Spot?

      Q3Which is NOT one of NIST's five essential characteristics?

      Q4Render running your Docker container is an example of…

      Q5Why are Spot VMs unsuitable for a 24/7 triage API?

      Q6The best hardware for serving an XGBoost stroke model is usually…

      Q7On-demand $1.50/h, 80% Spot discount, 10 h job. Spot cost?

      Q8What should a GPU serving service do when there's no traffic?

      Exam-style

      Written practice

      Short answer5 marks

      List NIST's five essential characteristics of cloud computing and explain rapid elasticity with an ML example.

      Short answer6 marks

      Explain when you would use a CPU vs a GPU for inference, and when Spot instances are appropriate.

      Long answer12 marks

      Propose a cloud architecture and monthly budget for the stroke-risk system β€” a 24/7 prediction API used by a Ugandan hospital and a nightly retraining job. Justify the service model, region, instance types and pricing options, and explain how you handle a Spot interruption.

      Watch

      Videos

      Fresh picks are chosen by AI every day.
      Hands-on

      Cloud ML Sizing, Spot Cost & Latency Architecture Simulator

      4 guided tasks: predict, experiment, explain β€” then challenge yourself. Plus 1 coding exercise you run right in the browser.

      Start the lab