DisCo-CLIP: A Distributed Contrastive Loss for Memory Efficient CLIP Training
摘要
We propose DisCo-CLIP, a distributed memory-efficient CLIP training approach, to reduce the memory consumption of contrastive loss when training contrastive learning models. Our approach decomposes the contrastive loss and its gradient computation into two parts, one to calculate the intra-GPU gradients and the other to compute the inter-GPU gradients. According to our decomposition, only the intra-GPU gradients are computed on the current GPU, while the inter-GPU gradients are collected via all reduce from other GPUs instead of being repeatedly computed on every GPU. In this way, we can reduce the GPU memory consumption of contrastive loss computation from O(B 2 ) to O( B 2 N ), where B and N are the batch size and the number of GPUs used for training. Such a distributed solution is mathematically equivalent to the original non-distributed contrastive loss computation, without sacrificing any computation accuracy. It is particularly efficient for large-batch CLIP training. For instance, DisCo-CLIP can enable contrastive training of a ViT-B/32 model with a batch size of 32K or 196K using 8 or 64 A100 40GB GPUs, compared with the original CLIP solution which requires 128 A100 40GB GPUs to train a ViT-B/32 model with a batch size of 32K.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- CLIP-Driven Open-Vocabulary 3D Scene Graph Generation via Cross-Modality Contrastive Learning 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Recurrence-Enhanced Vision-and-Language Transformers for Robust Multimodal Document Retrieval 引用了 Language Models are Few-Shot Learners
- Recurrence-Enhanced Vision-and-Language Transformers for Robust Multimodal Document Retrieval 引用了 Learning Transferable Visual Models From Natural Language Supervision
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- AmorLIP: Efficient Language-Image Pretraining via Amortization 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- AmorLIP: Efficient Language-Image Pretraining via Amortization 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- AmorLIP: Efficient Language-Image Pretraining via Amortization 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Spurious Feature Eraser: Stabilizing Test-Time Adaptation for Vision-Language Foundation Model 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Breaking the Memory Barrier of Contrastive Loss via Tile-Based Strategy 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Breaking the Memory Barrier of Contrastive Loss via Tile-Based Strategy 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Learning Transferable Visual Models From Natural Language Supervision 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Learning Transferable Visual Models From Natural Language Supervision 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Learning Transferable Visual Models From Natural Language Supervision 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper6
- Spurious Feature Eraser: Stabilizing Test-Time Adaptation for Vision-Language Foundation ModelHuan Ma, Yan Zhu, Changqing Zhang, Peilin Zhao 等AAAI 2025 · 4 次引用
- AmorLIP: Efficient Language-Image Pretraining via AmortizationHaotian Sun, Yitong Li, Yuchen Zhuang, Niao He 等NeurIPS 2025 · 2 次引用
- CLIP-Driven Open-Vocabulary 3D Scene Graph Generation via Cross-Modality Contrastive LearningLianggangxu Chen, Xuejiao Wang, Jiale Lu, Shaohui Lin 等CVPR 2024
- Recurrence-Enhanced Vision-and-Language Transformers for Robust Multimodal Document RetrievalDavide Caffagni, Sara Sarto, Marcella Cornia, Lorenzo Baraldi 等CVPR 2025
- Breaking the Memory Barrier of Contrastive Loss via Tile-Based StrategyZesen Cheng, Hang Zhang, Kehan Li, Sicong Leng 等CVPR 2025
它引用的 Paper18
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh 等ICML 2021 · 47,906 次引用
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
相关 Paper
- CLIP-KD: An Empirical Study of CLIP Model DistillationChuanguang Yang, Zhulin An, Libo Huang, Junyu Bi 等CVPR 2024 · 50 次引用
- MobileCLIP: Fast Image-Text Models through Multi-Modal Reinforced TrainingPavan Kumar Anasosalu Vasu, Hadi Pouransari, Fartash Faghri, Raviteja Vemulapalli 等CVPR 2024 · 29 次引用
- NeuCLIP: Efficient Large-Scale CLIP Training with Neural Normalizer OptimizationXiyuan Wei, Chih-Jen Lin, Tianbao YangICLR 2026 · 3 次引用
- Supervision Exists Everywhere: A Data Efficient Contrastive Language-Image Pre-training ParadigmYangguang Li, Feng Liang, Lichen Zhao, Yufeng Cui 等ICLR 2022 · 565 次引用
- Attentive Mask CLIPYifan Yang, Weiquan Huang, Yixuan Wei, Houwen Peng 等ICCV 2023 · 37 次引用
