Skip to main content
QUICK REVIEW

[논문 리뷰] Accelerated Sparse Neural Training: A Provable and Efficient Method to Find N:M Transposable Masks

Itay Hubara, Brian Chmiel|arXiv (Cornell University)|2021. 02. 16.
Advanced Neural Network Applications인용 수 25
한 줄 요약

이 논문은 forward/backward 가속을 위해 전이 가능한 N:M 미세한 희소성 마스크를 도입하고, 마스크 최적화를 최소비용 흐름(min-cost flow) 문제로 형식화하며(빠른 2-근사 포함), 비전 및 언어 모델에서 거의 정확도 손실 없이 2배의 학습 속도 향상을 시연하고 AdaPrune으로 비구조적 희소성을 N:M 마스크로 적응하는 방법을 제시한다.

ABSTRACT

Unstructured pruning reduces the memory footprint in deep neural networks (DNNs). Recently, researchers proposed different types of structural pruning intending to reduce also the computation complexity. In this work, we first suggest a new measure called mask-diversity which correlates with the expected accuracy of the different types of structural pruning. We focus on the recently suggested N:M fine-grained block sparsity mask, in which for each block of M weights, we have at least N zeros. While N:M fine-grained block sparsity allows acceleration in actual modern hardware, it can be used only to accelerate the inference phase. In order to allow for similar accelerations in the training phase, we suggest a novel transposable fine-grained sparsity mask, where the same mask can be used for both forward and backward passes. Our transposable mask guarantees that both the weight matrix and its transpose follow the same sparsity pattern; thus, the matrix multiplication required for passing the error backward can also be accelerated. We formulate the problem of finding the optimal transposable-mask as a minimum-cost flow problem. Additionally, to speed up the minimum-cost flow computation, we also introduce a fast linear-time approximation that can be used when the masks dynamically change during training. Our experiments suggest a 2x speed-up in the matrix multiplications with no accuracy degradation over vision and language models. Finally, to solve the problem of switching between different structure constraints, we suggest a method to convert a pre-trained model with unstructured sparsity to an N:M fine-grained block sparsity model with little to no training. A reference implementation can be found at https://github.com/papers-submission/structured_transposable_masks.

연구 동기 및 목표

  • 마스크 다양성(MD)이라는 새로운 척도에 따라 서로 다른 희소성 마스크가 모델 정확도에 미치는 영향을 평가하고 이해한다.
  • 학습 중 순전파와 역전파를 모두 가속시키는 전이 가능한 N:M 희소성 마스크를 개발한다.
  • 최적 마스크를 찾는 효율적인 알고리즘(최소비용 흐름과 빠른 2-근사)을 제공하고 재훈련 없이 마스크 전환을 가능하게 하는 AdaPrune을 제공한다.
  • 시각 및 언어 작업에서 정확도 감소가 거의 없으면서 행렬 곱셈에서 2배 속도 향상을 입증한다.

제안 방법

  • 구조 제약 하에서 주어진 희소도에서의 유효한 마스크 수로서 마스크 다양성(MD)을 정의하고 동기를 부여한다.
  • 전이 가능한 N:M 마스크 설계를 각 줄과 열당 N개의 비제로를 갖는 MxM 블록 내에서 보존된 L1 노름을 최대화하도록 최적화 문제로 형식화한다.
  • 사전 학습된 조밀한 모델에 대해 최적 마스크 문제를 최소비용 흐름 인스턴스로 축약한다.
  • 학습을 처음부터 시작할 때 마스크에 대한 빠른 2-근사 탐욕 알고리즘을 도입하고 블록 크기에 거의 선형 시간 복잡도를 가진다.
  • 최소한의 재학습으로 비구조적 희소성을 N:M 구조 마스크로 변환하는 AdaPrune를 제안한다.
  • Adaprune 기반 보정(calibration) 접근법을 제공하여 적은 정확도 손실로 희소성 구조를 전환한다.

실험 결과

연구 질문

  • RQ1마스크 다양성(MD)이 희소성 구조가 모델 정확도에 미치는 영향을 예측할 수 있는가?
  • RQ2전이 가능한 N:M 희소성 마스크를 설계하여 순전파와 역전파 모두를 가속시킬 수 있는가?
  • RQ3학습 중에 최적의 또는 근사 최적의 전이 가능한 마스크를 찾기 위한 효율적인 알고리즘은 무엇인가?
  • RQ4재훈련을 최소화하면서 비구조적 희소성을 N:M 희소성으로 변환할 수 있는가(AdaPrune)?

주요 결과

  • 4:8 전이 가능한 마스크는 2:4 마스크와 비슷한 정확도를 달성하지만 순전파와 역전파 모두에서 희소 텐서 코어를 사용하여 학습 가속을 가능하게 한다.
  • 제안된 행렬 곱셈의 2배 가속은 시각 및 언어 모델에서 정확도 저하 없이 입증된다.
  • 정확한 최소비용 흐름 형식은 사전 학습된 조밀한 모델에 대한 최적의 전이 가능한 마스크를 제공하며, 2-근사 알고리즘은 거의 선형 시간에 실행되고 최적에 비해 2배의 상한 내의 해를 산출한다.
  • AdaPrune은 비구조적 희소 모델을 4:8 전이 가능한 희소 모델로 변환할 수 있으며 일부 설정에서 정확도 저하가 1% 미만으로 하며 재훈련 없이 하드웨어 친화적 배치를 가능하게 한다.
  • 실험 결과는 학습 중 희소 텐서 코어의 2배 활용을 보여주며 선행 방법들보다 동일한 정확도에 근접한다(전방만 가속하는 방법과 비교).

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.