Yahya/Blog
Apr 22, 2026By Yahya

Cloud GPU Infrastructure: Navigating AWS H100s, RunPod, and Serverless GPUs

An practical cost and performance comparison of AWS EC2, RunPod, and Modal serverless GPUs for AI training and inference workloads.

Renting cloud GPUs for LLM fine-tuning and inference can get expensive quickly if you choose the wrong provider or instance type. Between AWS EC2, specialized GPU clouds like RunPod/Lambda Labs, and serverless compute like Modal, here is a practical breakdown of GPU economics and deployment strategies.

Hyperscalers (AWS / GCP / Azure) vs Specialized Cloud Providers

  • Hyperscalers (AWS EC2 p5.48xlarge, g5.2xlarge): High availability, enterprise SOC2 compliance, and tight integration with S3/VPC. However, pricing is steep ($3.80/hr+ for A10G, $30+/hr for H100s).
  • Specialized GPU Clouds (RunPod, Lambda, DeepInfra): Up to 60% cheaper hourly rates for H100/A100 instances. Ideal for batch fine-tuning runs and non-critical batch processing.

Serverless GPU Workloads (Modal / RunPod Serverless)

For intermittent workloads (e.g., generating embeddings or batch document OCR), serverless GPU functions scale to zero when idle:

PYTHON
# Example Modal Serverless GPU Deployment
import modal
app = modal.App("llm-inference-service")
image = modal.Image.debian_slim().pip_install("vllm")
@app.function(gpu="A10G", timeout=300)
def generate_text(prompt: str):
from vllm import LLM
llm = LLM(model="meta-llama/Meta-Llama-3-8B-Instruct")
return llm.generate([prompt])

Key Takeaways

  1. Cold Starts: Serverless GPUs experience 10-30 second cold starts due to container image pulling and model weight loading into VRAM. Use warm instances for user-facing interactive chat APIs.
  2. Spot Instances: Use spot/interruptible instances for long training jobs with automatic checkpointing to S3/R2 every 100 steps.