FP32 barely moved from Hopper to Blackwell (67.5 → 75 TFLOP/s), while dense BF16 more than doubled
Blackwell pushes the same architectural bet further with native FP8 and NVFP4 Tensor Cores
Model FLOPs Utilization (MFU)
$$\text{MFU} = \frac{\text{actual FLOP/s}}{\text{promised dense peak FLOP/s (for active dtype)}}$$
Measures how close a real workload gets to the GPU's advertised dense Tensor Core ceiling
Numerator counts only useful model FLOPs: communication, framework overhead and idle time all lower MFU
Rule of thumb: $\text{MFU} \ge 0.5$ is considered strong in end-to-end training
Why is MFU rarely near $1.0$?
Non-matmul ops (elementwise, norms, routing) stall waiting on HBM
Small batch/tile shapes under-utilize SMs; collectives and launches add overhead
To diagnose why a kernel falls short of peak FLOP/s, we need the two-resource bottleneck model.
The Two-Resource Execution Model
Two independent times govern any kernel:
$$T_{\text{comm}} = \frac{\text{bytes moved}}{B_{\text{HBM}}}, \qquad T_{\text{comp}} = \frac{\text{FLOPs}}{F_{\text{peak}}}$$
Assuming ideal overlap of memory transfers and arithmetic (e.g., async TMA loads + Tensor Core math):
$$T_{\text{total}} = \max\!\left(T_{\text{comm}},\; T_{\text{comp}}\right)$$
On Blackwell, Tensor Core throughput scales even faster than HBM bandwidth—pushing the ridge point $I_{\text{hw}}$ higher (especially in FP8 and NVFP4)
Why? Every weight $W_{ij}$ is fetched from HBM for just 2 FLOPs—zero weight reuse across tokens!
Autoregressive inference decoding (1 token per sequence) is a chain of matrix–vector products plus KV-cache reads $\implies$ fundamentally HBM-bandwidth bound unless batched.
Next: count the exact FLOPs and saved tensors required by the backward pass.
Backward Pass Anatomy: Two GEMMs per Layer
h1_grad = einsum(h2.grad, w2, "batch out, in out -> batch in") # 2 B D^2
w2_grad = einsum(h2.grad, h1, "batch out, batch in -> in out") # 2 B D^2
Backward takes $2\times$ the FLOPs of forward ($4BD^2$ vs. $2BD^2$) and forces $h_1$ to stay in HBM until $\nabla_{W_2}L$ runs
The $6 B P$ Rule — Dense Models vs. 2026 Architectures
Forward: $\;2 B P$ FLOPs + Backward: $\;4 B P$ FLOPs $=$ $6 B P$ FLOPs per step
Exact for our $L$-layer MLP ($P = L D^2$, $B$ data points); standard approximation for dense Transformers at short context
Two essential 2026 refinements:
Sparse MoE (e.g., DeepSeek-V4.1-Flash): each token activates only a subset of experts $\implies$ compute scales as $\mathbf{6 B P_{\text{active}}}$, while weight/optimizer memory still scales with $\mathbf{P_{\text{total}}}$
Long context & hybrid/sparse attention: dense self-attention adds an $O(B S^2 D L)$ term that dominates at long sequences $S$—motivating 2026 hybrid and sparse attention designs
This is where our Slide 3 napkin formula ($6 N D$) came from.
Adaptive Optimizers: From SGD to AdamW
Optimizer
Update Idea
FP32 State / Param
SGD
Step along raw gradient $- \eta g$
0 B
Momentum
SGD + exponential moving average of $g$
4 B
AdaGrad (2011)
SGD scaled by $1 / \sqrt{\sum g^2 + \epsilon}$
4 B
RMSProp
AdaGrad with exponential moving average of $g^2$
4 B
Adam / AdamW
RMSProp + Momentum (first & second moments)
8 B (4 + 4)
Optimizer states are kept in FP32 so running moment averages do not underflow or stall over long runs
Optimizer steps are purely elementwise (low arithmetic intensity $\implies$ memory-bound), but execute only once per global step
Optimizer Step & CUDA Memory Hygiene
class AdaGrad(torch.optim.Optimizer):
def step(self):
for group in self.param_groups:
lr = group["lr"]
for p in group["params"]:
state = self.state[p]
grad = p.grad.data
g2 = state.get("g2", torch.zeros_like(grad))
g2 += torch.square(grad)
state["g2"] = g2
p.data -= lr * grad / torch.sqrt(g2 + 1e-5)
Watch the roofline: too small a micro-batch lowers GEMM arithmetic intensity and can drop MFU on Blackwell
Activation Checkpointing (Rematerialization)
Philosophy: trade extra compute for lower HBM usage
Forward keeps only checkpoint tensors; backward recomputes dropped intermediates on demand
for layer in self.layers:
x = torch.utils.checkpoint.checkpoint(
layer, x, use_reentrant=False)
How Often to Checkpoint? The $\sqrt{L}$ Tradeoff
Strategy ($L$ layers)
Activation Memory
Recomputation Cost
Total Step FLOPs
Store every layer
$O(L)$
$0$
$6 B P$
Checkpoint every $\sqrt{L}$
$O(\sqrt{L})$
$O(L)$ (1 extra fwd)
$\le 8 B P$
Store no layers
$O(1)$
$O(L^2)$
prohibitive
On Blackwell GPUs with high compute-to-memory ratios, selective checkpointing of memory-heavy ops (activations, norms, attention) saves substantial HBM for minimal wall-clock cost.
Putting It Together: A Blackwell Training Step
for step in range(num_steps):
for micro in range(accum_steps):
x, y = get_batch() # directly on CUDA
with torch.amp.autocast("cuda", dtype=torch.bfloat16):
loss = F.mse_loss(model(x).mean(), y) / accum_steps
loss.backward() # accumulates .grad
optimizer.step() # FP32 state update
optimizer.zero_grad(set_to_none=True) # free grad HBM
Forward: $2 B P$ FLOPs; allocates (or checkpoints) activations
Backward: $4 B P$ FLOPs; reads activations, frees them, sums into .grad
Optimizer: elementwise update on FP32 state; then releases grad buffers
Every line maps directly to a concrete HBM allocation, HBM transfer, or Tensor Core GEMM.
Recap: Resource Accounting Checklist
Tensors & Precision: footprint $= \text{numel} \times \text{bytes/elem}$; use BF16 mixed precision (FP32 optimizer state), and FP8 / Blackwell NVFP4 for next-generation throughput and memory savings
CUDA & Blackwell: keep tensors on GPU, call torch.cuda.synchronize() before timing, use dense peak ($\frac{1}{2}$ sparse datasheet), and rely on on-chip SRAM/TMEM tiling
Expressivity: write tensor ops with einops (einsum, reduce, rearrange) so dimensions and FLOPs stay explicit
Compute & Roofline: $2BDK$ per GEMM, $6BP$ per dense training step ($6BP_{\text{active}}$ for sparse MoE); $\text{MFU} \le \min(1, I_{\text{op}}/I_{\text{hw}})$ — GEMMs are compute-bound, elementwise & decode are memory-bound
Fitting Large Runs: cut activation HBM via gradient accumulation ($B/k$) and activation checkpointing ($O(\sqrt{L})$ memory for $O(L)$ recompute)
← → / space to move · A to reveal answers · F fullscreen