Neural Network Execution Mode Selection Based on Memory Usage

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large neural networks often exceed the memory capacity of a single Graphics Processing Unit (GPU), making it difficult to determine the optimal execution mode for efficient processing, as existing methods lack a dynamic mechanism to switch between modes based on memory usage.

Innovation Solution

A method that starts execution in Unified Memory mode, measures memory usage for each layer of the neural network, and dynamically selects the appropriate execution mode (normal, Out-of-Core, or Unified Memory) to avoid memory shortages and optimize performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If Unified Memory mode is used to support larger neural network models, then the model size capacity is improved, but the execution speed deteriorates

Engineering Contradiction:
Improvemodel size capacityVSAvoidexecution speed
Core Design Contradiction:
Quantity of substanceVSSpeed

Solution Approach 1:

The system dynamically switches between execution modes (normal mode, OoC mode, UM mode) based on real-time memory usage measurements. This allows the system to adapt its execution characteristics - using UM mode when memory capacity is needed and switching to faster modes when memory constraints are satisfied, thereby resolving the speed-capacity tradeoff

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes execution parameters by selecting different execution modes based on measured memory usage. The mode selection is driven by parameter changes in memory consumption patterns, allowing the system to optimize between speed and capacity by adjusting the execution mode parameter

Inventive Principle:
Principle #35Parameter changes

2Speed

If normal memory mode is used for execution, then the execution speed is improved, but the supported model size is limited

Engineering Contradiction:
Improveexecution speedVSAvoidmodel size
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The system starts in UM mode for large models and dynamically switches to normal mode when memory usage measurements indicate that the model fits within GPU memory. This dynamic adaptation allows the system to support large models initially while automatically optimizing for speed when memory constraints are satisfied

Inventive Principle:
Principle #15Dynamics

3Quantity of substance

If Out-of-Core mode is used to support larger models than GPU memory, then the model size capacity is improved, but the execution speed deteriorates compared to UM mode

Engineering Contradiction:
Improvemodel size capacityVSAvoidexecution speed
Core Design Contradiction:
Quantity of substanceVSSpeed

Solution Approach 1:

The system dynamically selects between OoC mode and UM mode based on measured memory usage. When measurements show that the model fits within GPU memory, the system switches to faster UM mode. When memory exceeds GPU capacity, it transitions to OoC mode, thereby adaptively resolving the speed-capacity contradiction

Inventive Principle:
Principle #15Dynamics

4Device complexity

If a fixed execution mode is selected before first execution, then the system complexity is reduced, but the execution efficiency deteriorates due to inability to adapt to actual memory usage

Engineering Contradiction:
Improvesystem complexityVSAvoidexecution efficiency
Core Design Contradiction:
Device complexityVSProductivity

Solution Approach 1:

The system implements feedback by measuring actual memory usage during execution and using this information to select the optimal execution mode. This feedback mechanism allows the system to adapt to actual memory consumption patterns rather than relying on static predictions, thereby improving execution efficiency without excessive complexity

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system performs self-service by automatically measuring its own memory usage and selecting the appropriate execution mode without external intervention. This self-adjusting capability improves execution efficiency while keeping the control mechanism relatively simple

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS11880762B2Choosing execution mode of a neural network based on total memory usage
Publication Date: 2024.01.23 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11880762B2 patent drawing
  • US11880762B2 patent drawing
  • US11880762B2 patent drawing

AI summary

A computer-implemented method, a computer program product, and a computer processing system are provided for selecting from among multiple Graphics Processing Unit (GPU) execution modes for a Neural Network (NN) having a size greater than a threshold size. The multiple GPU execution modes include a normal memory mode, an Out-of-Core (OoC) execution mode, and a Unified Memory (UM) mode. The method includes starting an execution on the NN with the UM mode and measuring the memory usage for each of layers of the NN. The method further includes selecting an execution mode based on the memory usage of all of the layers.