r/learnmachinelearning • u/readitonly • Oct 27 '26
Tutorial How I would get started with CUDA
I started learning CUDA a while back to work on inference and understand FlashAttention. I read a lot of blogs on various topics, but the order was always confusing, so I wrote up the order that I'd pick if I started over.
What it covers:
- H100 architecture
- CUDA software mental model
- Getting started with Matrix Multiplication and building up to a very optimized solution
- Understanding how all of these add to optimization constraints
- An introduction to reading and understanding PTX(the compiler code)
It's meant to be a starter overview that will get you confident enough to read deeper, niche resources. I'd appreciate any feedback or corrections. Cheers!
Link to blog
3
u/kbr89 29d ago
Starting from the hardware is the right call, the later rules make a lot more sense that way. One correction since you asked for them: an H100 SM has 128 FP32 CUDA cores, so 32 per quadrant, not 256 (132 SMs x 128 = 16,896 on the SXM5). And one note for anyone following along without an H100: TMA only arrived with Hopper and wgmma is Hopper-specific (sm_90a), so on an RTX 30 or 40 card the ceiling to practise on is cp.async double buffering plus warp-level mma.sync. That still covers most of the matmul build-up, and you can rent an H100 by the hour for the last step.
1
u/blazing_cannon Oct 27 '26
great. how long did it take to learn all these?
1
u/TechMelchior Oct 27 '26
Seems interesting I'll read it today !
5
u/Honest_Structure_291 Oct 27 '26
My cuda Journey stopped After
model = model.to(device)
x = x.to(device)
output = model(x)
π
5
u/[deleted] Oct 27 '26
[removed] β view removed comment