Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

Solving 70B LLM HBM OOM &
Decode Stalls via Per-Group KV Quantization.

A 70B vLLM cluster OOMs 80 GB H100s at batch=20 (8k context) while tensor cores sit 90% idle; implement per-group asymmetric INT4/FP8 KV quantization to 4x concurrency.
Start the journey2 stages· Last modified Dec 2, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When H100s OOM at batch=20, enable per-group INT4 KV quantization and fused SRAM dequantization.

TL;DR30-second simplified summary
▾

Raises max batch from 20 to 80+ and boosts decode throughput 3.2x.

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
KV Cache Byte Sizing
2 * layers * kv_heads * head_dim * bytes_per_elem.
PagedAttention
Manages KV cache in fixed-size virtual blocks.
Full walkthrough · 2 stages
01
STAGE 01intermediate

Diagnosing the 2.56 GB/Request HBM Bottleneck.

Why this matters: Calculate exact KV footprint and identify HBM bandwidth saturation.

20 concurrent 8k requests * 2.56 GB = 51.2 GB KV + 35 GB TP-sharded weights > 80 GB H100 capacity.

Before · FP16 Batch=20 OOM
After · INT4 Batch=80+ Healthy
ChoiceWhat it buysWhat it costs
FP16 (16-bit)Native precision2.56 GB / 8k req; OOM at batch=20
Per-Group INT4 (4-bit)0.64 GB / 8k req; batch=80+Requires fused SRAM dequant kernel
def kv_bytes_per_token(layers: int, kv_heads: int, head_dim: int, bits: int) -> int:
    return (2 * layers * kv_heads * head_dim * bits) // 8
02
STAGE 02advanced

Group-Wise Quantization & Fused Attention.

Why this matters: Implement outlier-safe group quantization and verify perplexity bounds.

Quantize 64-element groups with asymmetric min/max scale and zero-point; dequantize on-the-fly in SRAM.

SchedulerHBM Paged KVGPU SRAM Kernel1. Fetch INT4 blocks + groupscales (4x less BW)2. Fused INT4->FP16 dequant inSRAM3. Emit next token (3.2xthroughput)
Engineering Decision Framework
Problem
Resolve 80 GB H100 OOMs at batch=20 on 70B 8k-context serving without buying 4x more GPUs.
Naive Solution
Evict/recompute KV caches on preemption or use global per-tensor INT4 quantization.
Why It Fails
Recomputation kills TTFT and wastes FLOPs; global per-tensor INT4 destroys accuracy on Key outlier channels.
Alternatives
4x GPU horizontal scaling, KV preemption/recompute, or per-group (64) asymmetric INT4/FP8 KV quantization.
Engineering Decision
Enable per-group asymmetric INT4 KV quantization in PagedAttention blocks with fused SRAM dequantization.
Trade-Offs
Adds minor SRAM dequant ALU instructions, but cuts HBM footprint 4x and boosts decode throughput 3.2x.
Decision Exercise · Make the Call

Your 70B serving cluster is HBM-bound at batch=20. Which change 4x's batch concurrency without hurting TTFT or perplexity?

public static int kvBytesPerToken(int layers, int kvHeads, int headDim, int bits) {
    return (2 * layers * kvHeads * headDim * bits) / 8;
}
Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

At 80 KB/token, how much KV memory does an 8k-token request consume?

Recommended Learning Flow