Zenaique

Define activation quantization and explain how W8A8 differs from weight only quant.

Flashcard·Easy·4.0 · 0·~30s·Asked atGnaniHarveyMoveworks·Relevant atCloudflareOpenAI
Attempt it
TL;DR

Activation quantization stores the per-token tensors flowing between layers in INT8 or FP8. W8A8 quantizes both weights and activations, so the matmul itself runs at low precision, halving compute as well as memory.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine a factory line. The machines are the model's learned coefficients, and the half-finished products moving from station to station are the in-flight numbers between layers. Compressing only the machines into smaller cabinets saves floor space, but the products are still passed around in big crates that the machines have to unpack before each step. W8A8 is the recipe that also compresses the crates into compact 8-bit packages, so each station receives small parcels and works on them directly. Less storage, faster handoff, less unpacking. The trade-off is that the smaller crates have less precision; rare odd-shaped products can get squashed in transit, which is why the compression step needs careful calibration to keep flavor.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Quantization is one of the few inference optimizations that delivers two kinds of win at once: less memory bandwidth and less compute. But which win you get depends on what you quantize. Weight-only quantization (W4A16, W8A16) saves memory and bandwidth but leaves the matmul running at BF16 precision. Adding activation quantization (W8A8, FP8 W8A8) cuts the matmul precision itself, which lands the workload on the GPU's low-precision tensor-core path.

This question separates candidates who memorized the term quantization from candidates who understand what the GPU actually executes. The right mental model starts with tensor-core matmul: both operands need to be low-precision for the low-precision path to fire. Once that is clear, the rest of the recipe (outlier handling, calibration, INT8 versus FP8) follows logically.

The deep dive walks weights versus activations as memory artifacts, why the matmul throughput depends on both operands, why activations are harder to quantize than weights, and the toolkit production stacks use to make W8A8 hit BF16-comparable quality at near-2x throughput.

Weights versus activations as memory artifacts

A transformer at inference time has two distinct tensor populations in memory. Weights are the trained parameters: the projection matrices for Q, K, V, the MLP linear layers, the embedding and output projections. They are static, loaded once, and reused for every forward pass.

Activations are the intermediate values produced by each layer as a forward pass advances. The token embedding becomes the input to layer 1's attention. The output of layer 1 becomes the input to layer 2. The residual stream, the attention scores before softmax, the MLP intermediate vectors, are all activations. They are computed per request, per layer, and they flow through every forward pass.

The memory math for the two populations is different. Weight memory is fixed: a 70B model in BF16 needs 140 GB regardless of how much traffic you serve. Activation memory scales with batch size and sequence length: longer prompts and larger batches grow the activation footprint linearly. The KV cache, in particular, is an activation that persists across decode steps, which is why long-context decode is dominated by KV cache memory rather than weight memory.

Why weight-only quantization is a memory trick, not a compute trick
What W8A8 changes
Why activations are harder to quantize
INT8 versus FP8 versus mixed
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • NVIDIA TensorRT-LLM ships FP8 W8A8 as the default low-precision recipe on H100 and B200 for Llama 4, Qwen 3, and DeepSeek V4 deployments.
  • vLLM supports both INT8 W8A8 (with SmoothQuant calibration) and FP8 W8A8 as first-class quantization paths for production serving.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QWhy does SmoothQuant migrate outlier magnitude from activations to weights instead of clipping them?
A

Clipping loses signal at the outliers, which are often disproportionately important. Migrating preserves the signal by absorbing it into the weight scale, which is already easy to quantize per-channel. The total information content is preserved; only the difficulty is rebalanced.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Believing weight-only quantization gives the same speedup as W8A8. Weight-only cuts memory, but the matmul still runs in FP16. Only W8A8 reaches the INT8 or FP8 tensor-core path.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • The distinction between weights and activations as memory artifacts

  • Why weight-only quantization saves memory but not matmul compute

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is the KV cache in transformer inference?
Flashcard·Easy