Home

Awesome

Accelerating Vision Transformer Training via a Patch Sampling Schedule (PSS)

We introduce the notion of a Patch Sampling Schedule (PSS), that varies the number of Vision Transformer (ViT) patches used per batch during training. Since all patches are not equally important for most vision objectives (e.g., classification), we argue that less important patches can be used in fewer training iterations, leading to shorter training time with minimal impact on performance. Additionally, we observe that training with a PSS makes a ViT more robust to a wider patch sampling range during inference. This allows for a fine-grained, dynamic trade-off between throughput and accuracy during inference. We evaluate using PSSs on ViTs for ImageNet both trained from scratch and pre-trained using a reconstruction loss function.

preprint on arXiv

Overview

Training Times

Image Patches

Model Checkpoints and Logs

Below are checkpoints and training/validation logs for baseline models and models + PSS. All training times are for a single machine with 4 A100 GPUs.

CodebaseModelCheckpointLogsPretrained?Training TimeAccuracy
SimMIMViT-Bcheckpointlogsyes24.6h83.7%
SimMIMViT-B + PSScheckpointlogsyes17.0h83.5%
DeiTDeiT-S-224checkpointlogsno29.9h80.1%
DeiTDeiT-S-224 + PSScheckpointlogsno27.9h80.4%
DeiTDeiT-S-384 + PSScheckpointlogsno109.0h82.7%

Training and Inference results

Please refer to the simmim/ or deit/ directories for more information on how to train and validate PSS models.