From transistors to tensor cores
agent37.club
Neural networks are fundamentally matrix multiplications — multiply matrices of weights by matrices of activations, billions of times. This is exactly what GPUs were designed for.
The fundamental building block
H100: 132 active SMs
B200: 148 active SMs (74 per die)
// The SM is a mini-computer // with its own memory hierarchy SM { cuda_cores: 128 FP32 tensor_cores: 4 registers: 256 KB shared_memory: 228 KB l1_cache: shared with above warp_schedulers: 4 max_threads: 2,048 max_warps: 64 } // H100: 132 SMs = 16,896 CUDA cores // B200: 148 SMs = 18,944 CUDA cores
All 32 threads in a warp must execute the same instruction. If threads branch differently (if/else), both paths execute serially. This is why GPU code avoids branching.
// CUDA programming model // CPU (host) launches kernel on GPU (device) // Define a kernel __global__ void add(float* a, float* b, float* c, int n) { int i = blockIdx.x * blockDim.x + threadIdx.x; if (i < n) c[i] = a[i] + b[i]; } // Launch: 256 threads per block // ceil(n/256) blocks in the grid add<<<(n+255)/256, 256>>>(a, b, c, n); // GPU distributes blocks to SMs // Each SM runs multiple blocks // Each block = warps of 32 threads
The ratio of active warps to maximum warps on an SM. Higher occupancy means more warps available to hide memory latency. But more warps also means less registers per thread.
The art of GPU programming: balance occupancy vs register usage.
When one warp stalls on a memory access (~400 cycles for HBM), the scheduler instantly switches to another ready warp. This is how GPUs achieve high utilization despite slow memory.
1000× bandwidth gap from top to bottom
~1,000× bandwidth gap between registers and HBM. Every optimization in AI — FlashAttention, KV cache compression, quantization — exists to keep data as high in this hierarchy as possible.
The breakthrough that made long-context LLMs practical. Instead of materializing the full attention matrix in HBM, FlashAttention keeps computation in shared memory (SRAM), tiling the attention computation to fit.
// Without FlashAttention: // Attention matrix lives in HBM Q, K, V = load_from_hbm() S = Q @ K.T // [seq, seq] in HBM! P = softmax(S) // [seq, seq] in HBM! O = P @ V // read from HBM again // 128K context â 128K² = 16B elements // = 32 GB just for attention! // With FlashAttention: // Tile Q, K, V into SRAM-sized chunks for tile_q in tiles(Q): for tile_k, tile_v in tiles(K, V): // Compute attention in SRAM // Never materialize full matrix update_output(tile_q, tile_k, tile_v) // 100x less HBM traffic
GPU compute has grown ~10× faster than memory bandwidth per generation. The gap is widening. This is THE constraint for LLM inference.
The specialized hardware that makes AI possible
The difference in practice: On a matrix multiply, tensor cores deliver ~60× the throughput of CUDA cores. An H100 does 67 TFLOPS FP32 on CUDA cores vs 990 TFLOPS FP16 on tensor cores.
| Gen | Architecture | Key Formats | Notable Feature | Peak TFLOPS |
|---|---|---|---|---|
| 1st | Volta V100 (2017) | FP16 | First tensor cores ever | 125 |
| 2nd | Turing (2018) | +INT8, INT4 | Integer formats for inference | 130 |
| 3rd | Ampere A100 (2020) | +BF16, TF32 | 2:4 Structured sparsity | 312 (624 sparse) |
| 4th | Hopper H100 (2022) | +FP8 | Transformer Engine, warp-group MMA | 990 (1,979 sparse) |
| 5th | Blackwell B200 (2024) | +FP4, FP6 | 2nd-gen Transformer Engine | 2,250 (9,000 FP4) |
Each generation adds lower-precision formats. Lower precision = more operations per cycle = higher throughput. The art is maintaining quality at lower precision.
FP8 uses half the memory of FP16. This means 2× more data per memory access, effectively doubling memory bandwidth utilization. Blackwell’s FP4 goes even further — 4× the throughput of FP16.
// The Transformer Engine workflow // 1. Forward pass in FP8 for layer in model: // Monitor activation statistics stats = observe(activations) // Compute scaling factor scale = compute_scale(stats.max_val) // Scale to FP8 range x_fp8 = quantize(x, scale) // Matrix multiply in FP8 // Accumulate in FP32 out = tensor_core_mma(x_fp8, w_fp8) // Dequantize output out = dequantize(out, scale) // All automatic â no manual tuning
Each generated token loads the entire weight matrix from HBM but performs very few operations per weight. The tensor cores are massively underutilized during decode.
Processing an entire prompt at once — all tokens hit the weight matrix simultaneously. Large matrix multiplies = high arithmetic intensity. GPU runs at full speed.
This is why batching helps so much — serving multiple requests together increases arithmetic intensity, moving from memory-bound to compute-bound.
Hopper → Blackwell → Vera Rubin → beyond
| Spec | H100 SXM | B200 | Change |
|---|---|---|---|
| Process | TSMC 4N | TSMC 4NP | Refined |
| Transistors | 80B | 208B | 2.6× |
| Die Size | 814 mm² | ~1,600 mm² (2 dies) | 2× |
| SMs | 132 | 148 | 1.12× |
| FP16/BF16 TFLOPS | 990 | 2,250 | 2.3× |
| FP8 TFLOPS | 1,979 | 4,500 | 2.3× |
| FP4 TFLOPS | N/A | 9,000 | New |
| HBM | 80 GB HBM3 | 192 GB HBM3e | 2.4× |
| Mem Bandwidth | 3.35 TB/s | 8 TB/s | 2.4× |
| TDP | 700W | 1,000W | 1.43× |
| Component | Est. Cost |
|---|---|
| Logic dies (2×) | ~$900 |
| HBM3e (8 stacks) | ~$2,200 |
| CoWoS-L packaging | ~$1,100 |
| Packaging yield loss | ~$1,000 |
| Total | ~$6,400 |
The “GPU” logic die is actually the cheapest part (~$900). HBM memory (~$2,200) and advanced packaging (~$2,100) dominate the bill of materials.
Manufacturing cost: ~$6,400
Sell price: ~$30,000-$40,000
~5-6× markup — this is NVIDIA’s margin story.
72 Rubin GPUs + 36 Vera CPUs per rack. 260 TB/s NVLink. 20,736 GB HBM4 total. Up to 3.6 ExaFLOPS FP4 inference.
| Year | Architecture | Transistors | HBM | Mem BW | FP4 PFLOPS |
|---|---|---|---|---|---|
| 2020 | Ampere (A100) | 54B | 80 GB HBM2e | 2.0 TB/s | N/A |
| 2022 | Hopper (H100) | 80B | 80 GB HBM3 | 3.35 TB/s | N/A |
| 2024 | Blackwell (B200) | 208B | 192 GB HBM3e | 8 TB/s | 9 |
| H2 2026 | Rubin (R200) | 336B | 288 GB HBM4 | 22 TB/s | 50 |
| H2 2027 | Rubin Ultra | TBD | 1 TB HBM4e | TBD | 100 |
| 2028 | Feynman | TBD | Next-gen HBM | TBD | TBD |
Huang’s Law: GPU AI performance more than doubles every 2 years — more aggressive than Moore’s Law. Achieved through architecture + memory + interconnect + software co-optimization. NVIDIA claims 1,000× improvement over 8 years.
AMD, Google, Amazon, and the fight for AI silicon
NVIDIA’s real moat isn’t hardware — it’s the software ecosystem. CUDA has 20 years of libraries, optimized kernels, and developer familiarity. Every ML framework is CUDA-first.
ROCm is closing the gap, but “closing the gap” isn’t the same as “parity.” For training at scale, CUDA optimization still matters enormously.
| Chip | Company | Performance | Memory | Key Users |
|---|---|---|---|---|
| TPU v7 Ironwood | 4,614 TFLOPS FP8 | 192 GB HBM3e, 7.4 TB/s | Gemini models | |
| TPU v6e Trillium | ~918 TFLOPS BF16 | 144 GB HBM3 | Google Cloud customers | |
| Trainium2 | Amazon | ~667 TFLOPS BF16 | 96 GB HBM3e | Anthropic, Apple |
| Maia 100 | Microsoft | ~800 TFLOPS BF16 | 64 GB HBM2E | Internal only (Copilot) |
Google is the only company that trains frontier models entirely on custom silicon. Ironwood (TPU v7) scales to 9,216 chips = 42.5 ExaFLOPS. Proprietary ICI interconnect. Full vertical stack. Amazon’s Trainium2 is gaining traction (Anthropic uses it). Microsoft Maia 100 has seen limited production deployment.
Dominant in training and inference. Full-stack moat: hardware + NVLink + networking + CUDA software. Blackwell demand exceeds supply.
Wins on memory capacity and price. MI300X/MI350 are compelling for inference. ROCm improving. The value play — but software gap limits training adoption.
Only for Google Cloud and Google’s own models. Not sold externally as chips. The most advanced non-NVIDIA AI silicon, but captive.
Amazon Trainium, Intel Gaudi, Cerebras, Groq, Microsoft Maia. Niche use cases and specific workloads. None threaten NVIDIA broadly — yet.
| GPU | Purchase Price | Cloud $/hr |
|---|---|---|
| H100 80GB | $25,000-$40,000 | ~$1.50-$4.69 |
| MI300X 192GB | $10,000-$15,000 | ~$4.89 |
| B200 192GB | ~$30,000-$40,000 | ~$6-8 (early) |
H100 price collapse: Cloud rental dropped from $8/hr (2024) to ~$1.50/hr (2026) as Blackwell supply expanded and H100 supply increased.
B200 manufacturing cost: ~$6,400
Sell price: ~$30,000-$40,000
Gross margin: ~75-85%
This is why NVIDIA is the most profitable chip company in history. HBM and packaging are the cost bottleneck, not the GPU die itself.
From transistors to AI inference
Every optimization in the AI stack — from FlashAttention to FP4 quantization to MoE routing — exists to feed the tensor cores faster and move less data through the memory hierarchy.
Inside the GPU.
agent37.club