[Paper Review] Virtualizing Deep Neural Networks for Memory-Efficient Neural Network Design
This paper proposes a runtime memory manager called virtualized DNN (vDNN) that enables training larger deep neural networks by transparently offloading activations between GPU and CPU memory, reducing memory usage by up to 83% and allowing VGG-16 with batch size 256 to train on a single 12 GB GPU with only 22% performance loss compared to a memory-capacity-matching system.
The most widely used machine learning frameworks require users to carefully tune their memory usage so that the deep neural network (DNN) fits into the DRAM capacity of a GPU. This restriction hampers a researcher's flexibility to study different machine learning algorithms, forcing them to either use a less desirable network architecture or parallelize the processing across multiple GPUs. We propose a runtime memory manager that virtualizes the memory usage of DNNs such that both GPU and CPU memory can simultaneously be utilized for training larger DNNs. Our virtualized DNN (vDNN) reduces the average memory usage of AlexNet by 61% and OverFeat by 83%, a significant reduction in memory requirements of DNNs. Similar experiments on VGG-16, one of the deepest and memory hungry DNNs to date, demonstrate the memory-efficiency of our proposal. vDNN enables VGG-16 with batch size 256 (requiring 28 GB of memory) to be trained on a single NVIDIA K40 GPU card containing 12 GB of memory, with 22% performance loss compared to a hypothetical GPU with enough memory to hold the entire DNN.
Motivation & Objective
- To overcome the memory capacity limitations of GPUs that restrict the size and batch size of deep neural networks (DNNs) during training.
- To enable training of larger, deeper DNNs such as VGG-16 on a single GPU with limited memory (e.g., 12 GB) without requiring multi-GPU setups.
- To reduce the need for manual memory tuning and architectural compromises by automating memory management across GPU and CPU memory spaces.
- To maintain high training efficiency while offloading intermediate activations to CPU memory, minimizing performance degradation.
Proposed method
- The vDNN system dynamically manages memory by identifying and offloading less-frequently accessed activations from GPU memory to CPU memory during training.
- It uses a runtime memory manager that monitors memory access patterns and applies a virtual memory abstraction to treat GPU and CPU memory as a unified address space.
- The system employs a page-based memory management strategy, similar to virtual memory in operating systems, to swap DNN activation tensors between GPU and CPU memory.
- It integrates with existing deep learning frameworks without requiring model rewrites, enabling transparent memory virtualization.
- The approach leverages the fact that not all activations are needed simultaneously, allowing selective eviction and retrieval of tensors based on access frequency.
Experimental results
Research questions
- RQ1Can a virtual memory abstraction be effectively applied to deep neural network training to reduce GPU memory pressure?
- RQ2To what extent can memory usage in DNNs be reduced by offloading activations to CPU memory without incurring prohibitive performance costs?
- RQ3Can large, memory-intensive models like VGG-16 be trained on a single GPU with limited memory using this approach?
- RQ4How does the performance of the virtualized DNN compare to a fully GPU-resident version under equivalent conditions?
Key findings
- vDNN reduces the average memory usage of AlexNet by 61% through intelligent offloading of activations to CPU memory.
- For OverFeat, the memory reduction reaches 83%, significantly lowering the GPU memory footprint.
- vDNN enables training of VGG-16 with a batch size of 256—requiring 28 GB of GPU memory—on a single NVIDIA K40 GPU with only 12 GB of memory, achieving 78% of the performance of a memory-capacity-matching system.
- The performance loss due to memory virtualization is quantified at 22% compared to an ideal GPU with sufficient memory, demonstrating practical feasibility.
- The method enables researchers to explore larger models and batch sizes without architectural compromises or multi-GPU setups.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.