通过动态分层迁移,60%降低大模型显存占用。
Superpipeline: A Universal Approach for Reducing GPU Memory Usage in Large Models
- 将模型分层并跨GPU/CPU高效传输
- 实测显存减少60%且保持精度与速度
- 适配大语言模型等多类模型,无需重训练
大型机器学习模型(如自然语言处理和计算机视觉模型)的快速发展,给资源受限硬件的运行带来挑战。本文提出Superpipeline框架,通过动态管理模型执行过程,将模型划分为独立层,并在GPU与CPU内存间高效传输,实现训练与推理阶段的优化。实验显示,该方法可使GPU内存使用量降低高达60%,同时维持模型精度和可接受的处理速度,使原本超出显存容量的模型得以有效运行。相比仅针对推理或特定模型类型的方法,Superpipeline适用于大语言模型(LLMs)、视觉语言模型(VLMs)及视觉模型。其包含两个可调参数,用于在显存占用与处理速度间进行平衡。重要的是,该方法无需重新训练或修改模型参数,确保原始输出不变。其简单性和灵活性使其适用于研究人员与从业者在有限硬件上部署先进AI模型,可在现有设备上运行更大模型或更大批次,加速多个机器学习应用的创新。代码已开源:https://github.com/abbasiReza/super-pipeline。
原文摘要 · Abstract (English)
The rapid growth in machine learning models, especially in natural language processing and computer vision, has led to challenges when running these models on hardware with limited resources. This paper introduces Superpipeline, a new framework designed to optimize the execution of large AI models on constrained hardware during both training and inference. Our approach involves dynamically managing model execution by dividing models into individual layers and efficiently transferring these layers between GPU and CPU memory. Superpipeline reduces GPU memory usage by up to 60% in our experiments while maintaining model accuracy and acceptable processing speeds. This allows models that would otherwise exceed available GPU memory to run effectively. Unlike existing solutions that focus mainly on inference or specific model types, Superpipeline can be applied to large language models (LLMs), vision-language models (VLMs), and vision-based models. We tested Superpipeline's performance across various models and hardware setups. The method includes two key parameters that allow fine-tuning the balance between GPU memory use and processing speed. Importantly, Superpipeline does not require retraining or changing model parameters, ensuring that the original model's output remains unchanged. Superpipeline's simplicity and flexibility make it useful for researchers and professionals working with advanced AI models on limited hardware. It enables the use of larger models or bigger batch sizes on existing hardware, potentially speeding up innovation across many machine learning applications. This work marks an important step toward making advanced AI models more accessible and optimizing their deployment in resource-limited environments. The code for Superpipeline is available at https://github.com/abbasiReza/super-pipeline.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。