Skip to content

Artificial Intelligence

Hardware-Fused Fast Hadamard Transforms Enable Lossless 3-Bit KV-Cache Compression at 128K Context Without Perplexity Drift

Two-cycle butterfly rotation datapaths inside tensor-core shared-memory writeback stages suppress activation outliers before asymmetric group quantization.

By Lazy Tensor
Published · 2 min read

AI hardware engineers examining logic analyzer waveforms and a PCIe accelerator card running hardware-fused Hadamard KV-cache quantization in a Silicon Valley lab
Accelerator architects inspect logic-analyzer waveforms and latency histograms from a hardware-fused Fast Hadamard Transform 3-bit KV-cache pipeline running 128K-context inference.
Your listening Queue & catch up
Unheard stories first, timed at 1×. Your selections stay first.

Add a story or build a catch-up queue to start listening.

Hardware-software co-design researchers from the Stanford Pervasive Parallelism Laboratory in Palo Alto, UC Berkeley, and Santa Clara systems engineers contributing to the open-source FlashInfer Project across the San Francisco Bay Area published silicon validation benchmarks on Saturday morning demonstrating a hardware-fused Fast Walsh-Hadamard Transform (FWHT) datapath that compresses large language model key-value (KV) caches to 3.125 effective bits per element across 128,000-token context windows with less than 0.02 perplexity degradation on Llama-3-70B and Qwen-2.5-72B evaluations. By rotating 128-element attention head vectors in registers immediately before HBM3e writeback, the architecture eliminates the massive channel-wise activation outliers that previously caused sub-4-bit KV quantization to collapse on long-horizon needle-in-a-haystack retrieval tasks.

In conventional software implementations such as QuaRot and SpinQuant, executing an online Hadamard rotation on freshly projected keys and values requires extra shared-memory round trips that add 9 to 14 percent latency overhead during prefill and decode phases. The newly validated tensor-core epilogue block integrates a seven-stage butterfly addition-subtraction network directly into the warp-level register-to-shared-memory crossbar, completing a normalized 128-point orthogonal transform in just two clock cycles without consuming FP16 multiplier array bandwidth.

Once rotated into a near-Gaussian amplitude distribution, each 64-element sub-block is quantized on the fly into 3-bit unsigned integers paired with a shared FP8 scale and zero-point header, shrinking a 128K-context 70B KV cache from 40 gigabytes in FP16 to 7.8 gigabytes. During autoregressive decode, the inverse butterfly rotation is fused into the FlashAttention-3 dequantization load pipeline ahead of the dot-product accumulate stage.

Across an eight-GPU server node at 2400 Condensa Street in Santa Clara serving concurrent 128K-token coding assistants, the $185,000 open-hardware research program and technical committee testbed increases maximum batch concurrency by 4.6x and boosts sustained decode throughput from 640 to 2,710 tokens per second. Full Verilog RTL reference blocks and CUDA PTX microbenchmarks are available in the FlashInfer GitHub Repository.

Sources

Comments (0)

No comments yet. Be the first to share a thought on this story.

Lazy Tensor briefing

The ideas shaping technology and capital.

Independent reporting and analysis on the investors, companies, and technologies shaping tomorrow’s economy.

Subscribe to Lazy Tensor

Free to read. Unsubscribe anytime.

More from Lazy Tensor