GPU Setup & Cloud
Training on CPU is fine for learning. Training for real needs a GPU. Verify local GPU availability using nvidia-smi and PyTorch's CUDA API. Configure Google Colab with a T4 GPU for free cloud-based experiments. Benchmark matrix multiplication on CPU vs GPU and measure the speedup. Estimate the largest model that fits in your VRAM using the fp16 rule of thumb. Most lessons in phases 1-3 run fine on CPU. But once you start training CNNs, transformers, or LLMs (phases 4+), you need GPU acceleration. A training run that takes 8 hours on CPU takes 10 minutes on GPU. You have three options: local GPU, cloud GPU, or Google Colab (free). Check if you have one: Install PyTorch with CUDA: Go to colab.research.google.com. Runtime > Change runtime type > T4 GPU. Run !nvidia-smi to verify. Upload notebooks from this course directly to Colab. For Lambda Labs, RunPod, or Vast.ai: Most lessons work on CPU. The ones that need GPU will say so and include Colab links. Run the benchmark above and compare CPU vs GPU times. If you don't have a GPU, run it on Google Colab and compare. Check how much GPU memory you have and estimate the largest model you can fit (rule of thumb: 2 bytes per parameter for fp16).
GPU Setup & Cloud: Training on CPU is fine for learning. Training for real needs a GPU. Verify local GPU availability using nvidia-smi and PyTorch's CUDA API.…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.