Skip to main content
QUICK REVIEW

[Paper Review] Training a Large Video Model on a Single Machine in a Day

Yue Zhao, Philipp Krähenbühl|arXiv (Cornell University)|Sep 28, 2023
Human Pose and Action RecognitionComputer Science5 citations
TL;DR

This paper presents a highly efficient training pipeline that enables training a state-of-the-art video Transformer model on a single machine with eight consumer-grade A5000 GPUs in under 18 hours. By optimizing I/O, CPU, and GPU computation through FlashAttention, fused decode-crop operations, and chunk-based video loading, the method reduces memory usage by 6.7×, GPU-hours by 11.8×, and hardware costs by 15× compared to prior work.

ABSTRACT

Videos are big, complex to pre-process, and slow to train on. State-of-the-art large-scale video models are trained on clusters of 32 or more GPUs for several days. As a consequence, academia largely ceded the training of large video models to industry. In this paper, we show how to still train a state-of-the-art video model on a single machine with eight consumer-grade GPUs in a day. We identify three bottlenecks, IO, CPU, and GPU computation, and optimize each. The result is a highly efficient video training pipeline. For comparable architectures, our pipeline achieves higher accuracies with $\frac{1}{8}$ of the computation compared to prior work. Code is available at https://github.com/zhaoyue-zephyrus/AVION.

Motivation & Objective

  • Address the high computational and hardware cost of training large video models, which has limited academic access to such training.
  • Identify and resolve three major bottlenecks in video training: I/O, CPU pre-processing, and GPU computation.
  • Enable training of a state-of-the-art contrastive video-language model on a single 8-GPU workstation in under a day.
  • Achieve comparable or better accuracy than prior models while using significantly less computation and memory.
  • Make large-scale video model training accessible to academic and small-scale research labs by reducing hardware requirements and cost.

Proposed method

  • Adopt FlashAttention to reduce the memory footprint of self-attention from O(N²) to O(N), where N is the number of video tokens, enabling larger batch sizes.
  • Design a fused decode-crop operation that integrates RandomResizedCrop into the video decoding stage, minimizing redundant decoding and CPU overhead.
  • Implement a chunk-based video loading system where long videos are split into fixed-length, compressed segments processed in parallel.
  • Move all data augmentation operations (e.g., cropping, flipping) to the GPU to leverage its parallelism and reduce CPU bottlenecks.
  • Optimize the entire pipeline for end-to-end efficiency, minimizing data movement and maximizing GPU utilization across all stages.
  • Use a single 8-GPU A5000 server to train models with total batch sizes up to 2,048, compared to prior work requiring 32+ A100 GPUs.
(a) Decode-then-crop.
(a) Decode-then-crop.

Experimental results

Research questions

  • RQ1Can a state-of-the-art video model be trained on a single machine with consumer-grade GPUs in under 24 hours?
  • RQ2What are the primary bottlenecks in video model training, and how can they be systematically addressed at scale?
  • RQ3To what extent can memory-efficient attention mechanisms and fused operations reduce training cost and resource requirements?
  • RQ4Can the same pipeline achieve SOTA performance on video-language and video recognition benchmarks with significantly reduced computation?
  • RQ5How does the proposed pipeline compare to prior work in terms of memory usage, training time, and hardware cost?

Key findings

  • The proposed pipeline trains a contrastive video-language model on 4 million video-text pairs in 18 hours on a single 8-GPU A5000 machine, achieving state-of-the-art performance on Epic-Kitchens 100.
  • For ViT-Base, the method achieves 2.0% higher zero-shot average mAP and 1.3% higher accuracy after fine-tuning compared to a comparable TimeSformer-Base model.
  • The pipeline reduces memory consumption by 6.7×, GPU·hours by 11.8×, and hardware cost by 15× compared to prior work requiring 32× 40GB A100 GPUs.
  • On VideoMAE pre-training, the pipeline reduces data-loading overhead by 3× and overall training time by 35% compared to the baseline.
  • The system enables a total batch size of 2,048 on a single 8-GPU A5000 server for ViT-Base, while maintaining accuracy comparable to models trained on 32× A100s.
  • The fused decode-crop operation reduces decoding operations by minimizing redundant data retrieval, improving decoding speed and reducing CPU load.
(b) Fused DecodeCrop.
(b) Fused DecodeCrop.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.