Flusso Gradiente Progressivo per l'Addestramento Robusto di Sparsità N:M nei Transformer
Progressive Gradient Flow for Robust N:M Sparsity Training in Transformers
February 7, 2024
Autori: Abhimanyu Rajeshkumar Bambhaniya, Amir Yazdanbakhsh, Suvinay Subramanian, Sheng-Chun Kao, Shivani Agrawal, Utku Evci, Tushar Krishna
cs.AI
Abstract
La sparsità strutturata N:M ha attirato un notevole interesse grazie al suo overhead relativamente modesto e al miglioramento dell'efficienza. Inoltre, questa forma di sparsità è particolarmente attraente per ridurre l'impronta di memoria a causa del suo overhead di rappresentazione contenuto. Ci sono stati sforzi per sviluppare ricette di addestramento per la sparsità strutturata N:M, che si concentrano principalmente su regioni a bassa sparsità (circa 50\%). Tuttavia, le prestazioni dei modelli addestrati con questi approcci tendono a diminuire quando si confrontano con regioni ad alta sparsità (>80\%). In questo lavoro, studiamo l'efficacia delle ricette di addestramento sparse esistenti nelle regioni ad alta sparsità e sosteniamo che questi metodi non riescono a mantenere la qualità del modello allo stesso livello delle regioni a bassa sparsità. Dimostriamo che il fattore significativo che contribuisce a questa disparità è la presenza di livelli elevati di rumore indotto nelle magnitudini dei gradienti. Per mitigare questo effetto indesiderato, utilizziamo meccanismi di decadimento per limitare progressivamente il flusso dei gradienti verso gli elementi potati. Il nostro approccio migliora la qualità del modello fino al 2% e al 5% nei modelli di visione e linguaggio rispettivamente nel regime di alta sparsità. Valutiamo anche il compromesso tra l'accuratezza del modello e il costo computazionale di addestramento in termini di FLOPs. A parità di FLOPs di addestramento, il nostro metodo offre prestazioni migliori rispetto alle ricette di addestramento sparse convenzionali, mostrando un miglioramento dell'accuratezza fino al 2%. Il codice sorgente è disponibile all'indirizzo https://github.com/abhibambhaniya/progressive_gradient_flow_nm_sparsity.
English
N:M Structured sparsity has garnered significant interest as a result of
relatively modest overhead and improved efficiency. Additionally, this form of
sparsity holds considerable appeal for reducing the memory footprint owing to
their modest representation overhead. There have been efforts to develop
training recipes for N:M structured sparsity, they primarily focus on
low-sparsity regions (sim50\%). Nonetheless, performance of models trained
using these approaches tends to decline when confronted with high-sparsity
regions (>80\%). In this work, we study the effectiveness of existing sparse
training recipes at high-sparsity regions and argue that these methods
fail to sustain the model quality on par with low-sparsity regions. We
demonstrate that the significant factor contributing to this disparity is the
presence of elevated levels of induced noise in the gradient magnitudes. To
mitigate this undesirable effect, we employ decay mechanisms to progressively
restrict the flow of gradients towards pruned elements. Our approach improves
the model quality by up to 2% and 5% in vision and language models at
high sparsity regime, respectively. We also evaluate the trade-off between
model accuracy and training compute cost in terms of FLOPs. At iso-training
FLOPs, our method yields better performance compared to conventional sparse
training recipes, exhibiting an accuracy improvement of up to 2%. The source
code is available at
https://github.com/abhibambhaniya/progressive_gradient_flow_nm_sparsity.