Lune

CVPR2023Top-tier venue

DisCo-CLIP: A Distributed Contrastive Loss for Memory Efficient CLIP Training

Yihao Chen, Xianbiao Qi, Jianan Wang, Lei Zhang

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • CLIP-Driven Open-Vocabulary 3D Scene Graph Generation via Cross-Modality Contrastive Learning cites Learning Transferable Visual Models From Natural Language Supervision
  • Recurrence-Enhanced Vision-and-Language Transformers for Robust Multimodal Document Retrieval cites Language Models are Few-Shot Learners
  • Recurrence-Enhanced Vision-and-Language Transformers for Robust Multimodal Document Retrieval cites Learning Transferable Visual Models From Natural Language Supervision
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites A Simple Framework for Contrastive Learning of Visual Representations
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
  • AmorLIP: Efficient Language-Image Pretraining via Amortization cites A Simple Framework for Contrastive Learning of Visual Representations
  • AmorLIP: Efficient Language-Image Pretraining via Amortization cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • AmorLIP: Efficient Language-Image Pretraining via Amortization cites Learning Transferable Visual Models From Natural Language Supervision
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Learning Transferable Visual Models From Natural Language Supervision
  • Spurious Feature Eraser: Stabilizing Test-Time Adaptation for Vision-Language Foundation Model cites Learning Transferable Visual Models From Natural Language Supervision
  • Breaking the Memory Barrier of Contrastive Loss via Tile-Based Strategy cites A Simple Framework for Contrastive Learning of Visual Representations
  • Breaking the Memory Barrier of Contrastive Loss via Tile-Based Strategy cites Learning Transferable Visual Models From Natural Language Supervision
  • Learning Transferable Visual Models From Natural Language Supervision cites A Simple Framework for Contrastive Learning of Visual Representations
  • Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Learning Transferable Visual Models From Natural Language Supervision cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Spurious Feature Eraser: Stabilizing Test-Time Adaptation for Vision-Language Foundation ModelHuan Ma, Yan Zhu, Changqing Zhang, Peilin Zhao et al.AAAI 2025 · 4 citations
  2. AmorLIP: Efficient Language-Image Pretraining via AmortizationHaotian Sun, Yitong Li, Yuchen Zhuang, Niao He et al.NeurIPS 2025 · 2 citations
  3. CLIP-Driven Open-Vocabulary 3D Scene Graph Generation via Cross-Modality Contrastive LearningLianggangxu Chen, Xuejiao Wang, Jiale Lu, Shaohui Lin et al.CVPR 2024
  4. Recurrence-Enhanced Vision-and-Language Transformers for Robust Multimodal Document RetrievalDavide Caffagni, Sara Sarto, Marcella Cornia, Lorenzo Baraldi et al.CVPR 2025
  5. Breaking the Memory Barrier of Contrastive Loss via Tile-Based StrategyZesen Cheng, Hang Zhang, Kehan Li, Sicong Leng et al.CVPR 2025

Builds on18

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
  3. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  4. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
  5. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations

Related papers

  1. CLIP-KD: An Empirical Study of CLIP Model DistillationChuanguang Yang, Zhulin An, Libo Huang, Junyu Bi et al.CVPR 2024 · 50 citations
  2. MobileCLIP: Fast Image-Text Models through Multi-Modal Reinforced TrainingPavan Kumar Anasosalu Vasu, Hadi Pouransari, Fartash Faghri, Raviteja Vemulapalli et al.CVPR 2024 · 29 citations
  3. NeuCLIP: Efficient Large-Scale CLIP Training with Neural Normalizer OptimizationXiyuan Wei, Chih-Jen Lin, Tianbao YangICLR 2026 · 3 citations
  4. Supervision Exists Everywhere: A Data Efficient Contrastive Language-Image Pre-training ParadigmYangguang Li, Feng Liang, Lichen Zhao, Yufeng Cui et al.ICLR 2022 · 565 citations
  5. Attentive Mask CLIPYifan Yang, Weiquan Huang, Yixuan Wei, Houwen Peng et al.ICCV 2023 · 37 citations
Dusk over the sea between two cliffs drawn in fine vertical lines