Choosing a GPU Cloud for LLMs: A Practical Guide
In this article
Choosing a GPU cloud provider for running large language models (LLMs) comes down to matching your workload's memory, bandwidth, and scaling needs against your budget and operational constraints. This guide walks you through the key decisions—from estimating VRAM to testing network speed—so you can pick a provider that actually runs your model without overspending.
What You'll Need
- A clear idea of the LLM you plan to run (model name, parameter count, and whether you need fine-tuning or just inference).
- Basic familiarity with Linux command line and Docker (most GPU clouds use these).
- A budget range and an estimate of how long you'll run the workload (hours, days, or months).
- Your model's approximate memory footprint—use the formula: parameters (in billions) × 2 bytes for FP16, plus overhead for optimizer states if training.
Step-by-Step
- Estimate your VRAM requirement. For inference, a 7B parameter model in FP16 needs about 14 GB of VRAM, plus a few GB for context and overhead. For training or fine-tuning, multiply by 3–4× for optimizer states and gradients. If you're unsure, use a tool like Hugging Face's model memory calculator.
- Decide on GPU type. For most LLM workloads, NVIDIA A100 (40 or 80 GB) and H100 (80 GB) are the safest choices because of their large memory and high bandwidth. If your model fits in 24 GB, an RTX 4090 or L4 can be far cheaper. For very large models (70B+), you'll need multi-GPU setups—check that the provider offers NVLink or high-speed interconnect.
- Check GPU availability and scaling. Some providers have limited stock of high-end GPUs. Look for those that allow you to rent multiple GPUs on a single node (e.g., 8×A100) and scale down when you're done. Avoid providers that force you to commit to long-term contracts unless you're sure of sustained usage.
- Evaluate network and storage performance. For multi-GPU training, inter-node bandwidth matters—look for InfiniBand or at least 25 Gbps Ethernet. For loading large model weights, fast NVMe storage is critical; test with
ddorfioif possible. - Compare pricing models. On-demand (per second/hour) is best for short experiments. Spot or interruptible instances can save 50–70% but may be terminated without notice—only use for fault-tolerant workloads. Reserved instances are for long-term, predictable loads.
- Verify software stack and support. Check that the provider offers pre-built images with CUDA, PyTorch, or TensorFlow. Look for documentation on mounting volumes, opening ports, and using Jupyter notebooks. Test their support response time with a pre-sales question.
- Run a benchmark test. Before committing, rent a single GPU for a few hours and run a small inference or training job. Measure tokens per second for inference and throughput for training. Compare against your expectations and other providers' published benchmarks (but be cautious—benchmarks can be cherry-picked).
- Check data egress and storage costs. Downloading model weights or training data can incur egress fees. Some providers charge per GB for storage and network—these can add up quickly. Read the pricing page carefully.
- Review security and compliance. If you're handling sensitive data, ensure the provider has SOC 2 or ISO 27001 certifications and offers private networking (VPC). For regulated industries, check data residency options.
- Start small, then scale. Begin with a single GPU to validate your code, then move to multi-GPU once everything works. This avoids wasting money on unused capacity.
Common Mistakes
- Underestimating VRAM for training. Many people calculate only the model weights, forgetting gradients and optimizer states. This leads to out-of-memory errors mid-job.
- Choosing a GPU with insufficient memory bandwidth. For LLM inference, memory bandwidth is often the bottleneck—a GPU with high VRAM but low bandwidth (like some older models) will be slow.
- Ignoring network latency for multi-GPU. If your provider uses slow Ethernet between nodes, training will be painfully slow. Always check interconnect type.
- Not reading the fine print on pricing. Some providers charge extra for public IPs, storage volumes, or support tiers. Calculate total cost, not just the GPU per-hour rate.
- Assuming all A100s are the same. There are different variants (40 GB vs 80 GB, PCIe vs SXM). Make sure you're getting the one you need.
Tips
- Use FP16 or BF16 instead of FP32 to halve memory usage and speed up computation—most LLM frameworks support this out of the box.
- If your model fits in a single GPU, consider quantization (e.g., 8-bit or 4-bit) to reduce VRAM further and lower cost.
- For inference, look for providers that offer serverless or autoscaling options—you pay only for requests, not idle time.
- Take advantage of free tiers or trial credits to test multiple providers before committing.
- Set up auto-shutdown for your instances to avoid leaving them running overnight unintentionally.
Troubleshooting
- Out-of-memory errors during training: Reduce batch size, use gradient accumulation, or switch to a smaller model. Check that you're not storing unnecessary tensors in memory.
- Slow inference on a supposedly fast GPU: Check if you're using the correct CUDA version and that the model is actually running on the GPU (use
nvidia-smi). Also, ensure your code uses the GPU efficiently—e.g., batching requests. - Cannot connect to the instance: Verify the security group/firewall rules allow SSH (port 22) or your chosen port. Check if the provider requires a key pair—download it and set permissions to 400.
- Model loading takes forever: Use a storage type with higher IOPS, or pre-download the model to a persistent volume. Consider using a smaller precision format to speed up loading.
- Spot instance terminated unexpectedly: If your workload is not checkpointing, you'll lose progress. Always save checkpoints to persistent storage (e.g., S3 or a network volume) at regular intervals.
Frequently Asked Questions
What's the cheapest GPU cloud for running LLMs?
There's no single answer—it depends on your model size and uptime. For small models (<13B), consumer GPUs like RTX 4090 on smaller providers can be cheap. For larger models, look for spot instances on major clouds. Always compare per-hour rates plus storage and egress.
Can I run a 70B model on a single GPU?
Only with aggressive quantization (e.g., 4-bit) and even then it's tight—you'd need a GPU with at least 48 GB VRAM. In practice, most people use 2–4 GPUs for 70B models.
Do I need multiple GPUs for fine-tuning?
Not necessarily. If your model fits in one GPU's VRAM (e.g., 7B model on a 24 GB GPU), you can fine-tune on a single GPU using techniques like LoRA. For full fine-tuning of larger models, you'll need multiple GPUs.
What's the difference between A100 and H100 for LLMs?
H100 is newer and faster, with higher memory bandwidth and support for FP8, which can speed up training and inference. A100 is still widely available and often cheaper. Choose based on your performance needs and budget.
How do I know if a provider is reliable?
Check uptime SLAs, read reviews on forums like Reddit, and test with a small workload first. Look for providers that have been around for a while and have transparent pricing.
Can I switch providers after I've started?
Yes, but it requires re-uploading your code and data, and possibly re-configuring your environment. To make switching easier, containerize your application with Docker and keep your data in a portable format.