Reversible Vision Transformers

Karttikeya Mangalam, Haoqi Fan, Yanghao Li, Chao-Yuan Wu, Bo Xiong +2 more
2/9/2023
cs.CVcs.AI

Abstract

We present Reversible Vision Transformers, a memory efficient architecture design for visual recognition. By decoupling the GPU memory requirement from the depth of the model, Reversible Vision Transformers enable scaling up architectures with efficient memory usage. We adapt two popular models, namely Vision Transformer and Multiscale Vision Transformers, to reversible variants and benchmark extensively across both model sizes and tasks of image classification, object detection and video classification. Reversible Vision Transformers achieve a reduced memory footprint of up to 15.5x at roughly identical model complexity, parameters and accuracy, demonstrating the promise of reversible vision transformers as an efficient backbone for hardware resource limited training regimes. Finally, we find that the additional computational burden of recomputing activations is more than overcome for deeper models, where throughput can increase up to 2.3x over their non-reversible counterparts. Full code and trained models are available at https://github.com/facebookresearch/slowfast. A simpler, easy to understand and modify version is also available at https://github.com/karttikeya/minREV

View on arXivView PDF

Code Implementations(3)

Apache-2.0

PySlowFast: video understanding codebase from FAIR for reproducing state-of-the-art video models.

7,3561,296Shell, PythonAug 20, 20195 months agoApache-2.0
karttikeya/minREVOfficial100%

A simple minimal implementation of Reversible Vision Transformers

12810Shell, PythonFeb 8, 20232 years ago
Apache-2.0

Code Release for MViTv2 on Image Recognition.

45552Shell, PythonDec 21, 20211 years agoApache-2.0

Cite this paper

@article{mangalam2023reversible,
  title  = {Reversible Vision Transformers},
  author = {Karttikeya Mangalam and Haoqi Fan and Yanghao Li and Chao-Yuan Wu and Bo Xiong and Christoph Feichtenhofer and Jitendra Malik},
  year   = {2023},
  eprint = {2302.04869},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.04869v1}
}

Discussion