Lune

ICML2022Top-tier venue

Monarch: Expressive Structured Matrices for Efficient and Accurate Training

Tri Dao, Beidi Chen, Nimit Sharad Sohoni, Arjun D. Desai, Michael Poli, Jessica Grogan, Alexander Liu, Aniruddh Rao, Atri Rudra, Christopher Ré

Abstract

Large neural networks excel in many domains, but they are expensive to train and fine-tune. A popular approach to reduce their compute or memory requirements is to replace dense weight matrices with structured ones (e.g., sparse, low-rank, Fourier transform). These methods have not seen widespread adoption (1) in end-to-end training due to unfavorable efficiency--quality tradeoffs, and (2) in dense-to-sparse fine-tuning due to lack of tractable algorithms to approximate a given dense weight matrix. To address these issues, we propose a class of matrices (Monarch) that is hardware-efficient (they are parameterized as products of two block-diagonal matrices for better hardware utilization) and expressive (they can represent many commonly used transforms). Surprisingly, the problem of approximating a dense weight matrix with a Monarch matrix, though nonconvex, has an analytical optimal solution. These properties of Monarch matrices unlock new ways to train and fine-tune sparse and dense models. We empirically validate that Monarch can achieve favorable accuracy-efficiency tradeoffs in several end-to-end sparse training applications: speeding up ViT and GPT-2 training on ImageNet classification and Wikitext-103 language modeling by 2x with comparable model quality, and reducing the error on PDE solving and MRI reconstruction tasks by 40%. In sparse-to-dense training, with a simple technique called"reverse sparsification,"Monarch matrices serve as a useful intermediate representation to speed up GPT-2 pretraining on OpenWebText by 2x without quality drop. The same technique brings 23% faster BERT pretraining than even the very optimized implementation from Nvidia that set the MLPerf 1.1 record. In dense-to-sparse fine-tuning, as a proof-of-concept, our Monarch approximation algorithm speeds up BERT fine-tuning on GLUE by 1.7x with comparable accuracy.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

60 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • MLP-Mixer: An all-MLP Architecture for Vision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Hyena Hierarchy: Towards Larger Convolutional Language Models cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Hyena Hierarchy: Towards Larger Convolutional Language Models cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Hyena Hierarchy: Towards Larger Convolutional Language Models cites Fourier Neural Operator for Parametric Partial Differential Equations
  • Hyena Hierarchy: Towards Larger Convolutional Language Models cites Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet
  • Language Model Cascades: Token-Level Uncertainty And Beyond cites Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites Hyena Hierarchy: Towards Larger Convolutional Language Models
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Gated Linear Attention Transformers with Hardware-Efficient Training cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Gated Linear Attention Transformers with Hardware-Efficient Training
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites MLP-Mixer: An all-MLP Architecture for Vision
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Hyena Hierarchy: Towards Larger Convolutional Language Models
  • Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers60

  1. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  2. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
  3. Hyena Hierarchy: Towards Larger Convolutional Language ModelsMichael Poli, Stefano Massaroli, Eric Nguyen, Daniel Y. Fu et al.ICML 2023 · 481 citations
  4. Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda et al.ICML 2024 · 390 citations
  5. Language Model Cascades: Token-Level Uncertainty And BeyondNeha Gupta, Harikrishna Narasimhan, Wittawat Jitkrittum, Ankit Singh Rawat et al.ICLR 2024 · 119 citations

Builds on25

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  2. Fourier Neural Operator for Parametric Partial Differential EquationsZongyi Li, Nikola Borislavov Kovachki, Kamyar Azizzadenesheli, Burigede Liu et al.ICLR 2021 · 3,911 citations
  3. MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer et al.NeurIPS 2021 · 3,862 citations
  4. Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetLi Yuan, Yunpeng Chen, Tao Wang, Weihao Yu et al.ICCV 2021 · 2,462 citations
  5. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations

Related papers

  1. Compute Better Spent: Replacing Dense Layers with Structured MatricesShikai Qiu, Andres Potapczynski, Marc Anton Finzi, Micah Goldblum et al.ICML 2024 · 26 citations
  2. Monarch Mixer: A Simple Sub-Quadratic GEMM-Based ArchitectureDaniel Y. Fu, Simran Arora, Jessica Grogan, Isys Johnson et al.NeurIPS 2023 · 80 citations
  3. MonarchAttention: Zero-Shot Conversion to Fast, Hardware-Aware Structured AttentionCan Yaras, Alec S. Xu, Pierre Abillama, Changwoo Lee et al.NeurIPS 2025 · 5 citations
  4. Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network ModelsBeidi Chen, Tri Dao, Kaizhao Liang, Jiaming Yang et al.ICLR 2022 · 94 citations
  5. Deep Compression of Pre-trained Transformer ModelsNaigang Wang, Chi-Chun (Charlie) Liu, Swagath Venkataramani, Sanchari Sen et al.NeurIPS 2022 · 38 citations
Dusk over the sea between two cliffs drawn in fine vertical lines