Pair HBM and SRAM with their roles on an inference GPU
HBM is the big off-die DRAM holding weights and KV cache; SRAM is the tiny on-die scratchpad where fused kernels keep tiles, and HBM bandwidth is what caps decode TPOT.
Picture a busy chef in a tiny kitchen next to a huge warehouse. The warehouse has every ingredient on the planet, but it is across the parking lot and takes time to walk to. The kitchen counter only fits a few pans, but it is right next to the stove. A smart chef plans meals so most of the chopping and mixing happens on the counter, and trips to the warehouse stay rare. A GPU is the same setup. The warehouse is HBM, the counter is SRAM, and the chef is a kernel. Decoding feels slow when every token forces another warehouse run, and clever attention algorithms keep more work on the counter to make it feel fast.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: HBM as off-die DRAM holding weights and KV + SRAM as per-SM scratchpad + decode is HBM-bandwidth-bound + FlashAttention tiles into SRAM + why batching and quantization help.
Real products, models, and research that use this idea.
- FlashAttention by Tri Dao tiles attention into SRAM on H100 and B200, avoiding the HBM round trips that naive attention pays.
- vLLM's PagedAttention keeps the KV cache organized in HBM blocks so concurrent Llama 3.1 70B requests pack densely.
- DeepSeek V4 inference on H100 clusters hits the HBM bandwidth ceiling during decode, which is why weight quantization to FP8 helps.
- NVIDIA's B200 raises HBM3e bandwidth versus H100, directly lifting decode tokens-per-second for Claude Opus 4.7 and GPT-5.5 class models.
- TensorRT-LLM uses SRAM-resident epilogue fusion to overlap activations with weight loads, squeezing more useful work out of each HBM read.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy is FlashAttention faster than naive attention even though it does the same math?
QWhy is decode bandwidth-bound while prefill can be compute-bound?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating HBM and SRAM as interchangeable cache tiers. HBM is the bulk store at gigabytes; SRAM is per-SM and measured in hundreds of kilobytes.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.