Home › Cloud services › Compute
guide

GPU cloud

Problem Teams training or serving neural nets find GPU time is the biggest line on the bill and prices vary widely between providers. This guide answers where to rent GPUs and what trade-offs each kind of provider brings.

Where to rent GPUs for training and inference: hyperscalers for integration, neoclouds for price, spot and marketplaces for cheap batch work; interconnect decides multi-node training.

gpuh100b200runpodcoreweavelambdatraininginference
Overview

GPU time is the biggest line on any ML bill, and its price varies 3-5x between providers for the same chip. Hyperscalers sell GPUs embedded in their networking, storage and IAM; neoclouds (CoreWeave, Lambda, Nebius, Crusoe, RunPod) sell the same GPUs cheaper with thinner services; marketplaces (Vast.ai, RunPod community) rent consumer and datacenter cards from third parties at the lowest prices with the least guarantees.

Key facts

Use when

  • Training or serving neural nets; batch embedding, transcription, rendering.

Avoid when

  • The model is small enough for CPU inference at your volume (int8 small models often are).

Deep dive

Chips (order of, dense BF16)

GPUMemoryBF16 TFLOPSUse
L424 GB~120Cheap inference, video
A10040/80 GB~312Training, older but plentiful
L40S48 GB~360Inference, fine-tuning
H100 SXM80 GB HBM3, 3.35 TB/s~990Training and serving, the 2024-26 workhorse
H200141 GB HBM3e, 4.8 TB/s~990Memory-bound LLM inference
B200180-192 GB HBM3e, ~8 TB/s~2250Large training, FP4/FP8 inference
RTX 4090 / 509024 / 32 GBorder of 165 / 210 with FP16 accumulate, about half with FP32 accumulateSmall models, hobby, research

Provider classes

ClassExamplesPriceStrengthWeakness
HyperscalerAWS p5/p6, GCP A3/A4, Azure NDHighest on demand; reservations (AWS Capacity Blocks) cheaperVPC, IAM, S3/GCS next door, complianceQuota requests, capacity scarce
NeocloudCoreWeave, Lambda, Nebius, Crusoe, Together2-3x below hyperscalerInfiniBand clusters, k8s/Slurm, good for big trainingFewer regions, storage services thinner
Pod platformsRunPod, Modal, ReplicatePer secondFast start, serverless GPU endpointsLess control of networking
MarketplaceVast.ai, RunPod community cloudLowestConsumer GPUs cheapVariable hosts, trust, no SLA
Own hardwareColocated 8x GPU serversCapex, pays back in order of 12-24 months at high useCheapest at 70 %+ utilisationOps, depreciation, power

Decision table

SituationChoiceWhy
Train < 1B params, one nodeSingle 8x H100 or 1-4x 4090 pod on a neocloudOne node, no interconnect needed
Pretrain > 10B params over weeksReserved InfiniBand cluster (neocloud or hyperscaler reservation)Interconnect and reliability dominate
Bursty experiments, many small runsPer-second pods (RunPod, Modal) or spotNo idle billing
Production LLM serving, steadyReserved H100/H200 or own boxes, vLLM/SGLangUtilisation high, reservations cut 30-60 %
Spiky inference, low volumeServerless GPU endpoints or hosted APIsScale to zero
Data in S3/GCS with heavy readsGPUs in the same cloud and regionEgress at $0.09/GB on TB-scale datasets adds up
Data privacy / regulatedHyperscaler or a neocloud with attestationsContracts

Code

Launch checklist on a fresh GPU box (any provider):

nvidia-smi --query-gpu=name,memory.total,driver_version --format=csv
nvidia-smi topo -m                                 # NVLink (NV#) vs PCIe (PHB/SYS) between GPUs
nvidia-smi --query-gpu=index,compute_cap,pcie.link.gen.current,pcie.link.width.current --format=csv
# NCCL bandwidth: expect ~200+ GB/s bus bw intra-node on H100 NVLink, far less over PCIe
git clone https://github.com/NVIDIA/nccl-tests && cd nccl-tests && make -j
./build/all_reduce_perf -b 8M -e 1G -f 2 -g $(nvidia-smi -L | wc -l)

Resumable training loop for spot/preemptible GPUs (Rust; the same pattern applies in any framework):

use std::fs::{self, File};
use std::io::Write;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;

/// Anything that can serialize its full state: weights, optimizer, step, data position, RNG.
pub trait Trainer {
    fn step(&mut self) -> f32;                       // one optimizer step, returns the loss
    fn step_count(&self) -> u64;
    fn save(&self) -> Vec<u8>;
    fn load(&mut self, bytes: &[u8]);
}

fn save_atomic(path: &str, bytes: &[u8]) -> std::io::Result<()> {
    let tmp = format!("{path}.tmp");
    let mut f = File::create(&tmp)?;
    f.write_all(bytes)?;
    f.sync_all()?;                                   // data durable before the rename
    fs::rename(&tmp, path)                           // atomic: never a half-written checkpoint
}

pub fn run(t: &mut impl Trainer, ckpt: &str, total: u64, every: u64) -> std::io::Result<()> {
    // preemption ends in an OS shutdown or pod stop, which sends SIGTERM (signal-hook crate)
    let stop = Arc::new(AtomicBool::new(false));
    signal_hook::flag::register(signal_hook::consts::SIGTERM, Arc::clone(&stop))?;
    if let Ok(bytes) = fs::read(ckpt) { t.load(&bytes) }       // resume where we left off
    while t.step_count() < total {
        let loss = t.step();
        let n = t.step_count();
        if n % 100 == 0 { eprintln!("step {n} loss {loss:.4}") }
        let stopping = stop.load(Ordering::Relaxed);
        if n % every == 0 || stopping {
            save_atomic(ckpt, &t.save())?;           // then copy to object storage in the background
            if stopping { break }
        }
    }
    Ok(())
}

On AWS, poll http://169.254.169.254/latest/meta-data/spot/instance-action (IMDSv2 token required) to get the 2-minute notice and checkpoint before the shutdown starts.

Efficiency

  • Cost: GPU time bills per hour (per second on pod platforms) whether the GPU computes or waits, so the effective price is the hourly price divided by model FLOPs utilisation (MFU, defined in the PaLM paper). 35-55 % MFU is good for transformer training on H100 (order of). H100 prices are order of $2-3 per hour on neoclouds and $4-8 on hyperscalers. AWS gives a two-minute notice before reclaiming a Spot Instance (EC2 User Guide). Bound: interconnect and data loading as much as FLOPs.
  • Levers:
    • local NVMe or same-datacenter dataset with prefetch — raises MFU; below 25 % look at data loading first (order of) — all training
    • NVLink inside a node, InfiniBand or EFA across nodes; verify with nccl-tests — collective bandwidth decides scaling (nccl-tests) — multi-GPU jobs
    • Spot or marketplace GPUs with atomic checkpoints — up to 90 % off on AWS Spot (AWS Spot page) — restartable training
    • idle shutdown — idle GPUs bill in full (order of) — notebooks, pods waiting on data
    • reservations — 30-60 % off at high utilisation (order of) — steady serving and long pretraining
  • Naive → standard → state of the art:
    • on-demand hyperscaler GPUs, data pulled over the WAN · highest price, low MFU
    • neocloud GPUs, data on local NVMe, periodic checkpoints · 2-3x cheaper per hour (order of)
    • Spot with resumable training, reserved cluster for long pretraining · up to 90 % off Spot (AWS), MFU 35-55 %

Implementation notes

  • Measure MFU (model FLOPs utilisation): 35-55 % is good for transformer training on H100; below 25 % look at data loading, small batches or communication.
  • Keep the dataset on local NVMe or a parallel filesystem in the same datacenter; stream from object storage with large sequential reads and prefetch.
  • Sync checkpoints to object storage asynchronously; a lost node must cost minutes, not hours.
  • Check driver/CUDA/NCCL versions on day one; mismatches are the top cause of "it was slow on that provider".
  • Reservations: hyperscalers and neoclouds sell 1-week to 3-year blocks; price a reservation vs on-demand at your expected utilisation.

Pitfalls

  • Paying for idle GPUs: notebooks left running, pods waiting on data. Add idle shutdown.
  • PCIe-only 8-GPU boxes sold as "8x H100" (H100 PCIe or no NVLink) run tensor parallelism several times slower.
  • Ephemeral container disks: pod restart deletes unsynced checkpoints.
  • Marketplace hosts can see your data and weights; don't put secrets or private data there.
  • Quota: new hyperscaler accounts often have 0 GPU quota; requests take days.

Implementations

namelangrepoinstallverdictlicencehealthas_ofnotes
SkyPilotPythonskypilot-org/skypilotpip install skypilot————run jobs on the cheapest cloud or Kubernetes, with Spot recovery
dstackPythondstackai/dstackpip install "dstack[all]" -U————GPU orchestration across clouds and on-prem
NVIDIA GPU OperatorGoNVIDIA/gpu-operatorn/a (Helm chart, see NVIDIA docs)————drivers and device plugin on Kubernetes
nccl-testsC++/CUDANVIDIA/nccl-testsgit clone https://github.com/NVIDIA/nccl-tests && cd nccl-tests && make -j————collective bandwidth check, used above

Sources

  • NVIDIA, H100 Tensor Core GPU (datasheet and product page). page and Blackwell (B200) datasheet.
  • NVIDIA, nccl-tests (GitHub repository). code
  • Aakanksha Chowdhery et al., PaLM: Scaling Language Modeling with Pathways, 2022 (MFU definition). paper
  • AWS, Amazon EC2 Spot Instances. page

Used by

Systems (2):

Alternatives and related