S-STE: Continuous Pruning Function for Efficient 2:4 Sparse Pre-training

Yuezhou Hu, Jun Zhu, Jianfei Chen
9/13/2024
cs.LG

No official code found. Best implementation: yuezhouhu/2by4-pretrain (63 stars, BSD-3-Clause, last commit 2024-12-08). 1 more below.

Abstract

Training deep neural networks (DNNs) is costly. Fortunately, Nvidia Ampere and Hopper GPUs can accelerate matrix multiplications twice as fast as a dense equivalent by implementing 2:4 sparsity. However, previous STE-based 2:4 pre-training methods (e.g. STE with hard-thresholding, SR-STE) suffer from optimization difficulties because of discontinuous pruning function. In this study, we comprehensively analyse the bottleneck of traditional N:M sparse training and recognize three drawbacks with discontinuity: incorrect descending direction, inability to predict the amount of descent and sparse mask oscillation. In light of this, we propose S-STE, a simple yet powerful 2:4 training method that contains two parts: to continuously project weights to be 2:4 sparse, and to rescale sparse weights with a per-tensor fixed scaling factor. Besides, we adopt minimum-variance unbiased estimation for activation gradient and FP8 quantization for whole process. Results show that our method surpasses previous 2:4 pre-training recipes and is comparable even with full parameter models. Our toolkit is available at https://github.com/huyz2023/2by4-pretrain.

View on arXivView PDF

Code Implementations(2)

BSD-3-Clause

Efficient 2:4 sparse training algorithms and implementations

631Cuda, PythonMay 27, 20241 years agoBSD-3-Clause
BSD-3-Clause

Code for "Accelerating Transformer Pre-training with 2:4 Sparsity"

280Shell, PythonMay 27, 20241 years agoBSD-3-Clause

Similar Papers

Cite this paper

@article{hu2024sste,
  title  = {S-STE: Continuous Pruning Function for Efficient 2:4 Sparse Pre-training},
  author = {Yuezhou Hu and Jun Zhu and Jianfei Chen},
  year   = {2024},
  eprint = {2409.09099},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2409.09099},
  url    = {http://arxiv.org/abs/2409.09099v3},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.09099.svg)](https://codeofpaper.com/paper/2409.09099)

Discussion