Vision Transformer Computation and Resilience for Dynamic Inference

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Sreedhar, Kavya, Clemons, Jason, Venkatesan, Rangharajan, Keckler, Stephen W., Horowitz, Mark
Formato: Preprint
Publicado: 2022
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913316041916416
author Sreedhar, Kavya
Clemons, Jason
Venkatesan, Rangharajan
Keckler, Stephen W.
Horowitz, Mark
author_facet Sreedhar, Kavya
Clemons, Jason
Venkatesan, Rangharajan
Keckler, Stephen W.
Horowitz, Mark
contents State-of-the-art deep learning models for computer vision tasks are based on the transformer architecture and often deployed in real-time applications. In this scenario, the resources available for every inference can vary, so it is useful to be able to dynamically adapt execution to trade accuracy for efficiency. To create dynamic models, we leverage the resilience of vision transformers to pruning and switch between different scaled versions of a model. Surprisingly, we find that most FLOPs are generated by convolutions, not attention. These relative FLOP counts are not a good predictor of GPU performance since GPUs have special optimizations for convolutions. Some models are fairly resilient and their model execution can be adapted without retraining, while all models achieve better accuracy with retraining alternative execution paths. These insights mean that we can leverage CNN accelerators and these alternative execution paths to enable efficient and dynamic vision transformer inference. Our analysis shows that leveraging this type of dynamic execution can lead to saving 28\% of energy with a 1.4\% accuracy drop for SegFormer (63 GFLOPs), with no additional training, and 53\% of energy for ResNet-50 (4 GFLOPs) with a 3.3\% accuracy drop by switching between pretrained Once-For-All models.
format Preprint
id arxiv_https___arxiv_org_abs_2212_02687
institution arXiv
publishDate 2022
record_format arxiv
spellingShingle Vision Transformer Computation and Resilience for Dynamic Inference
Sreedhar, Kavya
Clemons, Jason
Venkatesan, Rangharajan
Keckler, Stephen W.
Horowitz, Mark
Computer Vision and Pattern Recognition
Hardware Architecture
State-of-the-art deep learning models for computer vision tasks are based on the transformer architecture and often deployed in real-time applications. In this scenario, the resources available for every inference can vary, so it is useful to be able to dynamically adapt execution to trade accuracy for efficiency. To create dynamic models, we leverage the resilience of vision transformers to pruning and switch between different scaled versions of a model. Surprisingly, we find that most FLOPs are generated by convolutions, not attention. These relative FLOP counts are not a good predictor of GPU performance since GPUs have special optimizations for convolutions. Some models are fairly resilient and their model execution can be adapted without retraining, while all models achieve better accuracy with retraining alternative execution paths. These insights mean that we can leverage CNN accelerators and these alternative execution paths to enable efficient and dynamic vision transformer inference. Our analysis shows that leveraging this type of dynamic execution can lead to saving 28\% of energy with a 1.4\% accuracy drop for SegFormer (63 GFLOPs), with no additional training, and 53\% of energy for ResNet-50 (4 GFLOPs) with a 3.3\% accuracy drop by switching between pretrained Once-For-All models.
title Vision Transformer Computation and Resilience for Dynamic Inference
topic Computer Vision and Pattern Recognition
Hardware Architecture
url https://arxiv.org/abs/2212.02687