I&S-ViT: Un metodo inclusivo e stabile per spingere al limite la quantizzazione post-addestramento di ViT
I&S-ViT: An Inclusive & Stable Method for Pushing the Limit of Post-Training ViTs Quantization
November 16, 2023
Autori: Yunshan Zhong, Jiawei Hu, Mingbao Lin, Mengzhao Chen, Rongrong Ji
cs.AI
Abstract
Nonostante le prestazioni scalabili dei vision transformer (ViT), gli elevati costi computazionali (sia in fase di addestramento che di inferenza) ne minano la posizione nelle applicazioni industriali. La quantizzazione post-addestramento (PTQ), che regola i ViT con un piccolo dataset e li esegue in un formato a basso numero di bit, affronta bene il problema dei costi ma purtroppo comporta maggiori cali di prestazioni nei casi a bit più bassi. In questo articolo, introduciamo I&S-ViT, un metodo innovativo che regola la PTQ dei ViT in modo inclusivo e stabile. I&S-ViT identifica innanzitutto due problemi nella PTQ dei ViT: (1) L'inefficienza della quantizzazione nel quantizzatore log2 prevalente per le attivazioni post-Softmax; (2) Un paesaggio di perdita accidentato e amplificato nella granularità di quantizzazione a grana grossa per le attivazioni post-LayerNorm. Successivamente, I&S-ViT affronta questi problemi introducendo: (1) Un nuovo quantizzatore shift-uniform-log2 (SULQ) che incorpora un meccanismo di shift seguito da una quantizzazione uniforme per ottenere sia una rappresentazione inclusiva del dominio che un'approssimazione accurata della distribuzione; (2) Una strategia di ottimizzazione smooth in tre fasi (SOS) che amalgama i punti di forza della quantizzazione per canale e per livello per consentire un apprendimento stabile. Valutazioni complete su diverse attività di visione confermano la superiorità di I&S-ViT rispetto ai metodi PTQ esistenti per i ViT, in particolare negli scenari a basso numero di bit. Ad esempio, I&S-ViT migliora le prestazioni del ViT-B a 3 bit di un impressionante 50,68%.
English
Albeit the scalable performance of vision transformers (ViTs), the dense
computational costs (training & inference) undermine their position in
industrial applications. Post-training quantization (PTQ), tuning ViTs with a
tiny dataset and running in a low-bit format, well addresses the cost issue but
unluckily bears more performance drops in lower-bit cases. In this paper, we
introduce I&S-ViT, a novel method that regulates the PTQ of ViTs in an
inclusive and stable fashion. I&S-ViT first identifies two issues in the PTQ of
ViTs: (1) Quantization inefficiency in the prevalent log2 quantizer for
post-Softmax activations; (2) Rugged and magnified loss landscape in
coarse-grained quantization granularity for post-LayerNorm activations. Then,
I&S-ViT addresses these issues by introducing: (1) A novel shift-uniform-log2
quantizer (SULQ) that incorporates a shift mechanism followed by uniform
quantization to achieve both an inclusive domain representation and accurate
distribution approximation; (2) A three-stage smooth optimization strategy
(SOS) that amalgamates the strengths of channel-wise and layer-wise
quantization to enable stable learning. Comprehensive evaluations across
diverse vision tasks validate I&S-ViT' superiority over existing PTQ of ViTs
methods, particularly in low-bit scenarios. For instance, I&S-ViT elevates the
performance of 3-bit ViT-B by an impressive 50.68%.