Kernel Launch Overhead: Why Many Small Ops Are Slow — Practical PyTorch | 3.8
Автор: Glass Box Computing
Загружено: 2026-08-25
Просмотров: 81
Описание:
A hundred tiny GPU calls can lose to one big call — even when the arithmetic underneath is identical — because every launch pays a fixed toll no matter how small the work is. This video measures a real anti-pattern on an NVIDIA L4: a thousand tiny Python-loop ops take 8.44 ms, while the same math batched into one call takes 0.019 ms — a measured 441 times faster — and then shows how to fold that loop out of a training step.
What you'll learn:
• Why every op is a kernel launch with a fixed cost, no matter how tiny the work
• The anti-pattern measured: 1,000 tiny ops (8.44 ms) vs one batched op (0.019 ms)
• The 441.3× measured speedup — and why it's an extreme case, not a universal rule
• Reading the per-launch cost directly: about 8.44 microseconds per call
• Batching or fusing ops to do more work per launch
• Spotting the loop-of-tiny-ops anti-pattern inside a real training step
Chapters:
0:00 Intro & roadmap
1:16 The Fixed Toll
3:05 The Anti-Pattern, Measured
4:49 Batch It, or Fuse It
7:31 Recap & what's next
Playlists:
▶ Full course — Practical PyTorch (Tensors to Transformers): • Practical PyTorch — Full Course (Tensors t...
▶ CUDA & PyTorch Performance: • PyTorch Performance & CUDA
Every number on screen is a real measurement, timed on an NVIDIA L4 (torch 2.12.0+cu130), not asserted. Practical PyTorch teaches one idea per picture — for people who can already code and want to actually understand the framework.
#PyTorch #DeepLearning #CUDA #GPU #Performance #Python #Optimization
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: