HAT: Hardware-Aware Transformers for Efficient Natural Language Processing

By Hanrui Wang, Zhanghao Wu, Zhijian Liu, Han Cai, Ligeng Zhu, Chuang Gan, Song Han. 2020

292 citations recorded by the source corpus.

Transformers are ubiquitous in Natural Language Processing (NLP) tasks, but they are difficult to be deployed on hardware due to the intensive computation. To enable low-latency inference on resource-constrained hardware platforms, we propose to design Hardware-Aware Transformers (HAT) with neural architecture search. We first construct a large design space with arbitrary encoder-decoder attention and heterogeneous layers. Then we train a SuperTransformer that covers all candidates in the design space, and efficiently produces many SubTransformers with weight sharing. Finally, we perform an evolutionary search with a hardware latency constraint to find a specialized SubTransformer dedicated to run fast on the target hardware. Extensive experiments on four machine translation tasks demonstrate that HAT can discover efficient models for different hardware (CPU, GPU, IoT device). When running WMT’14 translation task on Raspberry Pi-4, HAT can achieve 3× speedup, 3.7× smaller size over baseline Transformer; 2.7× speedup, 3.6× smaller size over Evolved Transformer with 12,041× less search cost and no performance loss. HAT is open-sourced at https://github.com/mit-han-lab/hardware-aware-transformers.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Efficiency & Compression, Neural Architecture Search & AutoML, ML Systems & Hardware

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Kurt Keutzer
  2. Song Han
  3. Luke S. Zettlemoyer
  4. Quoc V. Le
  5. Yi Tay
  6. Mohit Bansal
  7. Jianfeng Gao
  8. Mostafa Dehghani

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Ming-Hsuan Yang
  3. Dacheng Tao
  4. Fahad Shahbaz Khan
  5. Jitendra Malik
  6. Xiaogang Wang
  7. Trevor Darrell
  8. Andrew Zisserman

In Efficiency & Compression

  1. Kurt Keutzer
  2. Song Han
  3. A. Gholami
  4. Michael W. Mahoney
  5. Ji Lin
  6. Tijmen Blankevoort
  7. Sehoon Kim
  8. Zhijian Liu

In Neural Architecture Search & AutoML

  1. A. Gholami
  2. Michael W. Mahoney
  3. Song Han
  4. Kurt Keutzer
  5. Ion Stoica
  6. Houwen Peng
  7. Jianlong Fu
  8. Hanrui Wang

In ML Systems & Hardware

  1. Joseph E. Gonzalez
  2. A. Gholami
  3. Mostafa Dehghani
  4. Ion Stoica
  5. Song Han
  6. Michael W. Mahoney
  7. Yi Tay
  8. Donald Metzler

Citations in the corpus