Series · 11 posts

PyTorch Training Performance on One GPU

DataLoader workers, GPU augmentation, TF32, autocast, channels_last, torch.compile and memory limits, each timed on a Windows RTX 4080 workstation.

The performance checklists everyone copies, measured on one real machine. Several of the famous flags did almost nothing, one well-known setting backfired, and the Windows-specific traps turn out to matter more than the tuning advice written on Linux.

  1. 1
    Diagnosing CPU-GPU Bottlenecks in PyTorch Training
    July 14, 2026
    Is Your GPU Actually Busy? Diagnosing CPU-GPU Bottlenecks in PyTorch

    Training pipelines stall on data loading more often than on compute. How to prove it with the PyTorch profiler instead of guessing.

  2. 2
    PyTorch DataLoader num_workers on Windows, Benchmarked
    July 24, 2026
    num_workers on Windows: I Benchmarked the Advice I Gave You Last Week

    num_workers measured on a 16-core Windows machine: workers made light pipelines slower, and one overlooked flag mattered more than any count.

  3. 3
    GPU Image Augmentation With torchvision v2: 13x Faster
    July 27, 2026
    I Moved Image Augmentation to the GPU: 13x Faster, With One Catch

    Batched GPU augmentation beat the best CPU worker setup 13x, but every image in a batch silently gets the same random crop, jitter and blur.

  4. 4
    Does Batch-Level GPU Augmentation Hurt Accuracy? 25 Models
    July 29, 2026
    Does Batch-Level GPU Augmentation Hurt Accuracy? I Trained 25 Models to Find Out

    What shared per-batch augmentation parameters cost on CIFAR-10, measured over 25 trained models, and how five seeds nearly gave the wrong answer.

  5. 5
    cudnn.benchmark and TF32 Measured on an RTX 4080
    July 31, 2026
    The 'Free Speedup' Flags, Measured: One Did Almost Nothing on My GPU

    The famous flag bought 3%, the flag nobody mentions was already on, and TF32's numerical error is 340x larger. Timed on an RTX 4080.

  6. 6
    PyTorch Autocast Measured: 1.6x Faster, 40% Less Memory
    August 3, 2026
    Autocast in Practice: 1.6x Faster, 40% Less Memory, and the 0.35% of Gradients That Vanish

    fp16 and bf16 autocast timed on a ResNet18 training step, plus a count of how many real gradients underflow to zero: the reason GradScaler exists.

  7. 7
    channels_last in PyTorch: Faster in bf16, 4x Slower in fp16
    August 4, 2026
    channels_last: 1.4x Faster in bf16, 4x Slower in fp16, on the Same GPU

    The memory-format one-liner worked as documented with bfloat16 and backfired with float16 on the same GPU. Timings, forward/backward split, gotchas.

  8. 8
    torch.compile on Windows GPU: Getting It to Run
    August 5, 2026
    torch.compile on Windows Isn't Supposed to Work. Here's What I Got Anyway

    No official Triton wheels for Windows. With a community wheel, a version pin and a MAX_PATH workaround, torch.compile ran, and I timed what it is worth.

  9. 9
    Training Past GPU Memory: Windows Sysmem Fallback Measured
    August 7, 2026
    My GPU Stopped Throwing OOM Errors. What It Does Instead Is Worse

    ResNet50 batches pushed past 16 GB got a silent 45x slowdown instead of OOM. Real numbers for gradient checkpointing and accumulation.

  10. 10
    DataLoader num_workers=4 Made Training 47% Slower on Windows
    August 26, 2026
    num_workers=4 Made My Training 47% Slower

    On Windows, 4 DataLoader workers made each epoch 47% slower and 8 workers 2.4x slower. The fix is one flag Linux tutorials never mention.

  11. 11
    The loss.item() GPU Sync Tax, Measured in Five Regimes
    September 9, 2026
    I Went Hunting for the Famous loss.item() Tax and Came Back With Pocket Change

    Calling .item() every step across small and big models, sub-ms steps, torch.compile and CUDA graphs. Worst case 7%, and why folklore says more.