When batching and tail latency compete for accelerator cycles, GPTQ/AWQ & Inference Performance, because autoregressive LLM decode is memory-bandwidth bound at low batch sizes, moving from FP16 to INT4/FP8 cuts HBM reads per token by 2-4x while keeping accuracy loss under ~1% when activation outliers are protected.
TL;DR30-second simplified summary▾
Core Mechanics: Autoregressive LLM inference has two opposite regimes: Prefill (processes prompt tokens in parallel via large GEMMs -> compute-bound) and Decode (generates 1 token per step -> memory-bandwidth bound).
Visual & Structural Flow: Depicts HBM3 Bandwidth Bottleneck & Quantized Weight/KV-Cache Footprint (HBM3 (35 GB INT4) -> Tensor Core / Regs -> FP8 KV Cache -> Decode (~95 tok/s)); 3-Layer Calibration, Accuracy & Concurrency Benchmark Flow (Calibration Set -> AWQ / FP8 Pass -> Task Eval Gate -> vLLM Serving).
Trade-Offs & Production: Match the quantization scheme to your GPU architecture and concurrency regime. An ML platform calibrates AWQ (group_size=128) on 256 production prompts, gates the checkpoint against BF16 on JSON-schema + GSM8K evals, sweeps batch=1..64 latency, and deploys.
Failure Modes & Application: Explore PagedAttention KV-cache management, speculative decoding, and continuous batching.
What is LLM Quantization (Prefill vs. Decode).
Why this matters: The mechanism: understand how LLM Quantization (Prefill vs. Decode) works from first principles.
Autoregressive LLM inference has two opposite regimes: Prefill (processes prompt tokens in parallel via large GEMMs -> compute-bound) and Decode (generates 1 token per step -> memory-bandwidth bound).
A 70B model in FP16 consumes 140 GB of weights—requiring 2x 80 GB H100s—and batch-1 decode on an H100 (3.35 TB/s HBM3) is capped near ~24 tok/s. Quantizing weights to INT4 (W4A16) shrinks weights to ~35 GB (fitting on 1x GPU) and lifts the bandwidth ceiling near ~95 tok/s; FP8 (W8A8) uses Hopper Tensor Cores to accelerate both prefill and high-batch decode.
HBM3 Bandwidth Bottleneck & Quantized Weight/KV-Cache Footprint
1.1. Weight Compression: INT4 (AWQ/GPTQ) cuts 70B weights from 140 GB to ~35 GB, fitting on a single 80 GB GPU.
2.2. Outlier Protection: AWQ scales salient ~1% activation outlier channels before group-wise (128) quantization.
3.3. KV-Cache FP8: At 32k-128k contexts, quantizing KV cache to FP8 prevents VRAM OOM under concurrency.
Shrinking bytes read from HBM per token directly multiplies low-batch decode speed.
Why Naive Rounding Fails (Activation Outliers).
Why this matters: The problem: see what breaks without Why Naive Rounding Fails under real concurrency or scale.
Think of Why Naive Rounding Fails (Activation Outliers) as the intuition layer for LLM Quantization, GPTQ/AWQ & Inference Performance: The problem: see what breaks without Why Naive Rounding Fails under real concurrency or scale.
Transformer activations in models >6B parameters exhibit systematic outlier features: ~0.1%–1% of hidden channels reach magnitudes 10x–100x larger than the median. Naive Round-To-Nearest (RTN) stretches the quantization grid to fit one outlier, crushing normal weights into 1–2 bits and destroying reasoning and JSON tool calling.
- Problem
- How to implement LLM Quantization, GPTQ/AWQ & Inference Performance without hitting unbounded tail latency, state divergence, or operational fragility.
- Naive Solution
- Use a single unpartitioned path with unbounded retries and synchronous global coordination.
- Why It Fails
- Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
- Alternatives
- Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
- Engineering Decision
- When batching and tail latency compete for accelerator cycles, GPTQ/AWQ & Inference Performance, because autoregressive LLM decode is memory-bandwidth bound at low batch sizes, moving from FP16 to INT4/FP8 cuts HBM reads per token by 2-4x while keeping accuracy loss under ~1% when activation outliers are protected.
- Trade-Offs
- Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
When LLM Quantization, GPTQ/AWQ & Inference Performance experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?
AWQ, GPTQ & SmoothQuant
AWQ protects salient weight channels identified by activation magnitude; GPTQ uses second-order Hessian error compensation; SmoothQuant migrates outlier difficulty from activations into weights.
High-Batch W4A16 Inversion
At batch > 32, W4A16 register dequantization ALU overhead saturates compute—making FP8 W8A8 faster on H100/L40S.
Where Quantization fits (and where BF16/QAT wins).
Why this matters: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.
Think of Where Quantization fits (and where BF16/QAT wins) as the intuition layer for LLM Quantization, GPTQ/AWQ & Inference Performance: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.
Choose W4A16 (AWQ+Marlin) for single-GPU 70B / low-latency decode, FP8 (W8A8) for high-batch Hopper serving, and skip sub-4-bit PTQ on complex coding/reasoning.
| Choice | What it buys | What it costs |
|---|---|---|
| Good Candidate: 7B–70B+ Interactive Serving (FP8 / AWQ) | 2–4x VRAM reduction and 2–3x higher decode tok/s with <1% accuracy drop. | Requires fused kernels (Marlin, ExLlamaV2, FP8 Tensor Cores) and domain-matched calibration data. |
| Avoid: Sub-4-Bit PTQ (INT2) on Code/Math Reasoning | Keep BF16/FP8 or use Quantization-Aware Training (QAT) for strict JSON/SQL/reasoning fidelity. | Post-training 2-bit quantization degrades multi-step reasoning severely. |
How Quantized Serving & Task-Specific Evals are managed.
Why this matters: Operational control: configure bounds, failure handling, and safe production defaults.
Think of How Quantized Serving & Task-Specific Evals are managed as the intuition layer for LLM Quantization, GPTQ/AWQ & Inference Performance: Operational control: configure bounds, failure handling, and safe production defaults.
Never ship a quantized checkpoint on WikiText perplexity alone. Calibrate on 256 domain-representative samples (code, JSON, target languages), enable --kv-cache-dtype fp8 for long contexts, and run task-specific evals (HumanEval, JSON schema adherence) + concurrency sweeps against BF16.
How Quantized Serving & Task-Specific Evals are managed
# Production vLLM launch with FP8 weights + FP8 KV-cache & Marlin/PagedAttention
python -m vllm.entrypoints.openai.api_server \
--model meta-llama/Llama-3.1-70B-Instruct-FP8 \
--quantization fp8 \
--kv-cache-dtype fp8 \
--max-model-len 32768 \
--gpu-memory-utilization 0.92
Alternatives: FP8 (W8A8) vs. AWQ (W4A16) vs. GGUF K-Quants.
Why this matters: The trade-off: compare competing approaches across latency, consistency, and operational cost.
Think of Alternatives: FP8 (W8A8) vs. AWQ (W4A16) vs. GGUF K-Quants as the intuition layer for LLM Quantization, GPTQ/AWQ & Inference Performance: The trade-off: compare competing approaches across latency, consistency, and operational cost.
Match the quantization scheme to your GPU architecture and concurrency regime.
| Choice | What it buys | What it costs |
|---|---|---|
| FP8 E4M3 (W8A8 on H100 / L40S) | <0.2% accuracy drop and native Tensor Core acceleration for both prefill and high-batch decode. | Only 2x VRAM savings (~70 GB for 70B) and requires Ada/Hopper+ GPUs. |
| AWQ / GPTQ with Marlin Kernel (W4A16) | ~4x VRAM savings (~35 GB for 70B) and fastest batch-1 decode. | Degrades at high batch (>32) due to register dequantization overhead. |
| GGUF K-Quants (Q4_K_M) | Mixed-precision layer allocation ideal for edge/CPU/Apple Silicon (`llama.cpp`). | Not optimized for high-concurrency datacenter continuous batching. |
Production example: Calibration -> Eval Gate -> Continuous Batching.
Why this matters: Production architecture: see how the components compose end to end under real load.
Think of Production example: Calibration -> Eval Gate -> Continuous Batching as the intuition layer for LLM Quantization, GPTQ/AWQ & Inference Performance: Production architecture: see how the components compose end to end under real load.
An ML platform calibrates AWQ (group_size=128) on 256 production prompts, gates the checkpoint against BF16 on JSON-schema + GSM8K evals, sweeps batch=1..64 latency, and deploys on vLLM with FP8 KV-cache PagedAttention.
3-Layer Calibration, Accuracy & Concurrency Benchmark Flow
Task-specific evals and concurrency sweeps prevent silent tool-calling breakage and high-batch slowdowns.
Problems solved by Quantization & Related LLM Serving Concepts.
Why this matters: Applied problems: connect these internals to concrete system design and debugging scenarios.
Think of Problems solved by Quantization & Related LLM Serving Concepts as the intuition layer for LLM Quantization, GPTQ/AWQ & Inference Performance: Applied problems: connect these internals to concrete system design and debugging scenarios.
Explore PagedAttention KV-cache management, speculative decoding, and continuous batching.
Practice: Make the trade-off yourself.
On an NVIDIA H100 serving high-concurrency traffic (batch size = 64), why can FP8 (W8A8) outperform INT4 (W4A16)?