NoMAD-Attention: Efficient LLM Inference on CPUs Through Multiply-add-free Attention
Tianyi Zhang, Jonah Yi, Bowen Yao, Zhaozhuo Xu, Anshumali Shrivastava
摘要
Large language model inference on Central Processing Units (CPU) is challenging due to the vast quantities of expensive Multiply-Add (MAD) matrix operations in the attention computations. In this paper, we argue that there is a rare gem in modern CPUs, Single-Instruction-Multiple-Data (SIMD) registers, which allow for ultra-low-latency lookups in batch. We leverage this unique capability of CPUs to propose NoMAD-Attention, an efficient attention algorithm that replaces MAD operations with in-register lookups. Through hardware-aware algorithmic designs, NoMAD-Attention achieves the computation of attention scores using repeated fast accesses to SIMD registers despite their highly limited sizes. Moreover, NoMAD-Attention works with pre-trained attention-based LLMs without model finetuning. Empirical evaluations demonstrate that NoMAD-Attention maintains the quality of the original LLMs well, and speeds up the 4-bit quantized LLaMA-7B-based model by up to 2 at 16k context length. Our results are reproducible at https://github.com/tonyzhang617/nomad-dist.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) 引用了 Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation
- 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) 引用了 KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization
- 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) 引用了 LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid
- Big Bird: Transformers for Longer Sequences 引用了 Reformer: The Efficient Transformer
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Big Bird: Transformers for Longer Sequences
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Reformer: The Efficient Transformer
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 Reformer: The Efficient Transformer
- Nyströmformer: A Nyström-based Algorithm for Approximating Self-Attention 引用了 Reformer: The Efficient Transformer
- Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation 引用了 KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization
- Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation 引用了 LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid
- LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid 引用了 Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation
- KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization 引用了 H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
- LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid 引用了 KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization
引用它的顶会 Paper4
- KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled QuantizationTianyi Zhang, Jonah Yi, Zhaozhuo Xu, Anshumali ShrivastavaNeurIPS 2024 · 97 次引用
- 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11)Tianyi Zhang, Mohsen Hariri, Shaochen (Henry) Zhong, Vipin Chaudhary 等NeurIPS 2025 · 1 次引用
- Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM AdaptationTianyi Zhang, Junda Su, Aditya Desai, Oscar Wu 等ICML 2025
- LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware GridTianyi Zhang, Anshumali ShrivastavaICLR 2025
它引用的 Paper12
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen 等NeurIPS 2023 · 1,003 次引用
- Nyströmformer: A Nyström-based Algorithm for Approximating Self-AttentionYunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan 等AAAI 2021 · 675 次引用
相关 Paper
- SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM PrefillingXiaodong Ji, Hailin Zhang, Fangcheng Fu, Bin CuiICML 2026 · 3 次引用
- MILLION: MasterIng Long-Context LLM Inference Via Outlier-Immunized KV Product QuaNtizationZongwu Wang, Peng Xu, Fangxin Liu, Yiwei Hu 等DAC 2025 · 6 次引用
- Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda 等ICML 2024 · 390 次引用
- Fast Matrix Multiplications for Lookup Table-Quantized LLMsHan Guo, William Brandon, Radostin Cholakov, Jonathan Ragan-Kelley 等EMNLP Findings 2024 · 5 次引用
- QiMeng-Attention: SOTA Attention Operator is generated by SOTA Attention AlgorithmQirui Zhou, Shaohui Peng, Weiqiang Xiong, Haixin Chen 等ACL Findings 2025 · 1 次引用
