STCO: Enhancing Training Efficiency via Structured Sparse Tensor Compilation Optimization
Open Access
- 9 November 2024
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Design Automation of Electronic Systems
- Vol. 30 (1) , 1-22
Abstract
Network sparsification serves as an effective technique to accelerate Deep Neural Network (DNN) inference. However, existing sparsification techniques often rely on structured sparsity, which yields limited benefits. This is primarily due to the significant memory and computational overhead introduced by numerous sparse storage formats during address generation and gradient updates. Additionally, many of these solutions are tailored solely for the inference phase, neglecting the crucial training phase. In this article, we introduce STCO, a novel Sparse Tensor Compilation Optimization technique that significantly enhances training efficiency through structured sparse tensor compilation. Central to STCO is the Tensorization-aware Index Entity (TIE) format, which effectively represents structured sparse tensors by eliminating redundant indices and minimizing storage overhead. The TIE format plays a pivotal role in the Address-carry flow (AC flow) pass, which optimizes the data layout at the computational graph level. This pass leverages the TIE format to enhance the efficiency of tensor representations, enabling more compact and efficient sparse tensor storage. Meanwhile, a shape inference pass utilizes the AC flow to derive optimized tensor shapes, further refining the performance of sparse tensor operations. Moreover, the Address-Carry TIE Flow dynamically tracks nonzero addresses, extending the benefits of sparse optimization to both forward and backward propagation. This seamless integration into the training pipeline enables a smooth transition to sparse tensor compilation without significant modifications to existing codebases. To further boost training performance, we implement an operator-level AC flow optimization pass tailored for structured sparse tensors. This pass generates efficient addresses, ensuring minimal computational overhead during sparse tensor operations. The flexibility of STCO allows it to be efficiently integrated into various frameworks or compilers, providing a robust solution for enhancing training efficiency with structured sparse tensors. Experiments demonstrated that STCO achieved impressive speedups of 3.64×, 5.43×, 4.89×, and 3.91× when compared to state-of-the-art sparse formats on VGG16, ResNet-18, MobileNetV1, and MobileNetV2, respectively. These findings underscore the efficiency and superiority of our proposed approach in leveraging unstructured sparsity for DNN inference acceleration.Keywords
Funding Information
- National Natural Science Foundation of China (62402311)
This publication has 14 references indexed in Scilit:
- (De/Re)-Composition of Data-Parallel Computations via Multi-Dimensional HomomorphismsACM Transactions on Programming Languages and Systems, 2024
- Polyhedral Specification and Code Generation of Sparse Tensor Contraction with Co-iterationACM Transactions on Architecture and Code Optimization, 2022
- Non-Structured DNN Weight Pruning—Is It Beneficial in Any Platform?IEEE Transactions on Neural Networks and Learning Systems, 2021
- Adaptive sparse tiling for sparse matrix multiplication2019
- The tensor algebra compilerProceedings of the ACM on Programming Languages, 2017
- The Emergence of Edge ComputingComputer, 2017
- Tensor-matrix products with a compressed sparse tensor2015
- Polyhedral parallel code generation for CUDAACM Transactions on Architecture and Code Optimization, 2013
- Parallel sparse matrix-vector and matrix-transpose-vector multiplication using compressed sparse blocks2009
- A practical automatic polyhedral parallelizer and locality optimizerACM SIGPLAN Notices, 2008