Paper 1 of 5
FuTransformer: FP8 prefill and INT4 decode for Llama-style inference on Hopper
Problem
Prefill is limited by matrix multiplication and activation data movement, while single‑token decode is limited by weight and KV‑cache reads, leading to low reuse and high latency.
Approach
FuTransformer builds on CODA's GEMM‑plus‑epilogue for inference, adds direct KV‑cache placement, folds the fixed RMSNorm gain into the weights, writes FP8 output with delayed scaling and supports prefill without padding. For decode it uses INT4 projection weights and an INT4 KV‑cache copy, arranging weights and keys in Tensor Core fragment layouts so they can be dequantized directly into MMA operands. A block‑diagonal Hadamard transform is applied to the cache to reduce quantization error from outlier channels. All components are integrated into a CUDA‑graphed implementation for Hopper GPUs.
Result
FuTransformer prefill is up to 1.48x faster than compiled PyTorch FP8 and reaches 1.29 PFLOP/s; its BF16 gate/up path is 1.13x faster than CODA at the 8B shape. INT4 decode is 1.3 to 2.4x faster than the stronger of PyTorch's BF16 and INT4 decode blocks, 2.1 to 3.3x faster than compiled BF16, 1.3 to 6.3x faster than PyTorch's INT4 projection kernel, and 31 to 51% faster than FuTransformer's FP8 path. Whole‑model Llama‑3.1‑8B decode is 2.9x faster than compiled PyTorch at batch one, while INT4 weights raise WikiText‑2 perplexity from 6.24 to 7.23 (round‑to‑nearest) or 6.99 (GPTQ).
Why it matters
Engineers targeting LLM inference on Hopper GPUs can adopt FuTransformer to achieve substantially lower latency for both prefill and decode, especially when using low‑bit INT4 formats.
Method details
- Evaluated on Llama‑style layer shapes 1B, 8B, 70B and 405B on a single NVIDIA H100 80GB SXM5 GPU with CUDA 13.0 and PyTorch 2.14.1+cu130.
- Prefill baseline is a compiled, CUDA‑graphed PyTorch block using torch._scaled_mm with one activation scale per row and one weight scale per output channel.
- Decode baselines include an eager BF16 block and a compiled, CUDA‑graphed BF16 block from PyTorch; no direct INT4+INT4 block exists in PyTorch.
- Ablation Table 7 swaps INT4 cache design elements (natural order K, separate cache quantization, bias MMA conversion, FMA split‑KV attention) and reports latency changes.
- INT4 weights and cache are quantized with a round‑to‑nearest quantizer; GPTQ‑packed weights reduce perplexity increase without changing latency.
Numbers
- prefill up to 1.48x faster than compiled PyTorch FP8
- prefill reaches 1.29 PFLOP/s
- BF16 gate/up 1.13x faster than CODA at 8B shape
- INT4 decode 1.3 to 2.4x faster than PyTorch decode blocks
- INT4 decode 2.1 to 3.3x faster than compiled BF16
- INT4 decode 31 to 51% faster than FuTransformer FP8 path
- whole‑model decode 2.9x faster than compiled PyTorch at batch one
- perplexity increase 0.99 (round‑to‑nearest) or 0.75 (GPTQ) over BF16
Limitations
The study does not cover multi‑GPU scheduling, distributed communication, request admission, or full serving latency, and it does not run a complete 405B model on a single GPU.
On one H100, FuTransformer prefill is up to 1.48 faster than compiled PyTorch FP8 and reaches 1.29 PFLOP/s.Found in the source text, word for word.
Picked because: Provides a CUDA implementation (FuTransformer) enabling FP8 prefill and INT4 decode for Llama-style models on NVIDIA Hopper, offering concrete performance gains for self‑hosted inference pipelines.