paper-with-me

Papers

Accelerating Transformer Pre-training with 2:4 Sparsity

2024-04-02 · Yuezhou Hu, Kang Zhao, Weiyu Huang, Jianfei Chen, Jun Zhu

Training large transformers is slow, but recent innovations on GPU architecture give us an advantage. NVIDIA Ampere GPUs can execute a fine-grained 2:4 sparse matrix multiplication twice as fast as its dense equivalent. In the light of this property, we comprehensively investigate the feasibility of accelerating feed-forward networks (FFNs) of transformers in pre-training. First, we define a ``flip rate'' to monitor the stability of a 2:4 training process. Utilizing this metric, we propose three techniques to preserve accuracy: to modify the sparse-refined straight-through estimator by applying the masked decay term on gradients, to determine a feasible decay factor in warm-up stage, and to enhance the model's quality by a dense fine-tuning procedure near the end of pre-training. Besides, we devise two techniques to practically accelerate training: to calculate transposable 2:4 masks by convolution, and to accelerate gated activation functions by reducing GPU L2 cache miss. Experiments show that our 2:4 sparse training algorithm achieves similar convergence to dense training algorithms on several transformer pre-training tasks, while actual acceleration can be observed on different shapes of transformer block apparently. Our toolkit is available at https://github.com/huyz2023/2by4-pretrain.

📄 PDF Abstract BibTeX arXiv:2404.01847

Code (2)

huyz2023/2by4-pretrain 공식 구현 pytorch
thu-ml/2by4-pretrain-acc-examples 공식 구현 pytorch

Tasks

GPU

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Multi-Head Attention 설명 없음
Adam 설명 없음
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

SaiT: Sparse Vision Transformers through Adaptive Token Pruning

2022-10-11 · Ling Li, David Thorsley, Joseph Hassoun

While vision transformers have achieved impressive results, effectively and efficiently accelerating these models can further boost performances. In this work, we propose a dense/sparse training framework to obtain a uni…

Knowledge Distillation

Attention Condensation via Sparsity Induced Regularized Training

2025-03-03 · Eli Sason, Darya Frolova, Boris Nazarov, Felix Goldberd

As the context window expands, self-attention increasingly dominates the transformer's inference time. Therefore, accelerating attention computation while minimizing performance degradation is essential for the efficient…

An Algorithm-Hardware Co-Optimized Framework for Accelerating N:M Sparse Transformers

2022-08-12 · Chao Fang, Aojun Zhou, Zhongfeng Wang

The Transformer has been an indispensable staple in deep learning. However, for real-life applications, it is very challenging to deploy efficient Transformers due to immense parameters and operations of models. To relie…

Computational EfficiencyModel Compression

DiffSparse: Accelerating Diffusion Transformers with Learned Token Sparsity

2026-04-04 · Haowei Zhu, Ji Liu, Ziqiong Liu, Dong Li 외 arxiv

Diffusion models demonstrate outstanding performance in image generation, but their multi-step inference mechanism requires immense computational cost. Previous works accelerate inference by leveraging layer or token cac…

Image Generation

Efficient Training for Visual Tracking with Deformable Transformer

2023-09-06 · Qingmao Wei, Guotian Zeng, Bi Zeng

Recent Transformer-based visual tracking models have showcased superior performance. Nevertheless, prior works have been resource-intensive, requiring prolonged GPU training hours and incurring high GFLOPs during inferen…

DecoderDenoisingGPUObject Tracking+2