[Paper Review] Bi-directional Masks for Efficient N:M Sparse Training
This paper proposes Bi-directional Masks (Bi-Mask), a novel method for efficient N:M sparse training that decouples forward and backward weight sparsity using separate masks, enabling full acceleration on N:M sparse tensor cores without performance degradation. By applying an efficient row permutation before backward masking, Bi-Mask maintains high model accuracy while achieving superior training efficiency compared to existing methods.
We focus on addressing the dense backward propagation issue for training efficiency of N:M fine-grained sparsity that preserves at most N out of M consecutive weights and achieves practical speedups supported by the N:M sparse tensor core. Therefore, we present a novel method of Bi-directional Masks (Bi-Mask) with its two central innovations in: 1) Separate sparse masks in the two directions of forward and backward propagation to obtain training acceleration. It disentangles the forward and backward weight sparsity and overcomes the very dense gradient computation. 2) An efficient weight row permutation method to maintain performance. It picks up the permutation candidate with the most eligible N:M weight blocks in the backward to minimize the gradient gap between traditional uni-directional masks and our bi-directional masks. Compared with existing uni-directional scenario that applies a transposable mask and enables backward acceleration, our Bi-Mask is experimentally demonstrated to be more superior in performance. Also, our Bi-Mask performs on par with or even better than methods that fail to achieve backward acceleration. Project of this paper is available at \url{https://github.com/zyxxmu/Bi-Mask}.
Motivation & Objective
- Address the inefficiency of N:M sparse training caused by dense backward propagation despite hardware support for sparse tensor cores.
- Overcome the performance degradation caused by rigid transposable masks in existing methods that constrain sparsity patterns.
- Enable both forward and backward acceleration in N:M sparse training while preserving model accuracy.
- Develop a flexible yet efficient mechanism to minimize gradient gap between forward and backward passes in sparse training.
- Demonstrate that bi-directional masking with intelligent permutation can match or exceed the performance of non-accelerated sparse training methods.
Proposed method
- Introduce two independent N:M sparse masks: one for forward propagation (rows) and one for backward propagation (columns), decoupling the sparsity patterns.
- Apply an efficient row permutation to the weight matrix before computing the backward mask to maximize the number of eligible N:M blocks.
- Use magnitude-based pruning on the permuted weights to generate the backward mask, ensuring compatibility with N:M sparse tensor core acceleration.
- Maintain gradient consistency by aligning the column order of the output gradient with the permuted weight matrix, minimizing gradient gap.
- Select the best permutation from a small candidate set (e.g., 12) based on the number of N:M blocks, avoiding expensive greedy search.
- Use weight magnitude as the binarization criterion for the backward mask to align it with the forward mask and reduce gradient discrepancy.

Experimental results
Research questions
- RQ1Can we achieve full forward and backward acceleration in N:M sparse training without imposing a transposable mask constraint?
- RQ2How does decoupling forward and backward sparsity masks affect model performance and training efficiency?
- RQ3Can an efficient row permutation strategy improve the number of valid N:M blocks in the backward pass while minimizing gradient gap?
- RQ4Does Bi-Mask outperform existing methods that either sacrifice performance for acceleration or fail to accelerate the backward pass?
- RQ5What is the impact of different binarization criteria on the backward mask’s effectiveness and overall model accuracy?
Key findings
- Bi-Mask achieves full forward and backward acceleration on N:M sparse tensor cores by decoupling the sparsity patterns in forward and backward passes.
- The method reduces performance degradation compared to transposable mask methods, especially at high sparsity levels like 1:8 and 1:16.
- The ablation study shows that adding the backward mask causes only a 0.3% Top-1 accuracy drop on ResNet-18, while permutation updating improves accuracy by 0.3% over the baseline.
- Among binarization criteria, using weight magnitude yields the best performance (70.73% Top-1 accuracy on ResNet-18 with 2:4 sparsity), outperforming gradient magnitude (70.56%) and random selection (67.76%).
- The permutation strategy with a limited candidate set (e.g., 12) is sufficient to achieve near-optimal N:M block counts, making it computationally efficient.
- Bi-Mask surpasses SOTA methods that rely on transposable masks and even outperforms non-accelerated baselines in accuracy, demonstrating both efficiency and effectiveness.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.