Neural Network Memory Management for Larger Batch Training

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing neural network training methods face inefficiencies in managing memory resources during forward and backward propagation, leading to suboptimal performance and resource utilization.

Innovation Solution

A processor-implemented memory management method that segregates memory usage by storing forward propagation results in local memory and gradients in global memory, with checkpointing and batch management to optimize parallel operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If forward propagation results are stored in local memory during forward propagation, then memory access speed is improved, but local memory occupancy increases

Engineering Contradiction:
Improvememory access speedVSAvoidlocal memory occupancy
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent divides memory into two distinct segments: local memory for storing forward propagation results and global memory for storing gradients. This segmentation allows each memory type to be optimized for its specific function, with local memory providing fast access for intermediate results and global memory providing sufficient capacity for gradient storage, thereby resolving the contradiction between access speed and memory occupancy.

Inventive Principle:
Principle #1Segmentation

2Productivity

If larger batch sizes are used in parallel operations, then throughput is improved, but memory resource requirements increase

Engineering Contradiction:
ImprovethroughputVSAvoidmemory resource requirements
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent extracts gradient storage from local memory to global memory. By removing the gradient storage function from local memory, the available local memory capacity is increased, enabling larger batch sizes to be processed in parallel operations. This extraction resolves the contradiction by allowing larger batches (higher throughput) without proportionally increasing local memory requirements.

Inventive Principle:
Principle #2Taking out (Extraction)

3Measurement precision

If checkpoints are set in multiple layers, then gradient calculation accuracy is improved, but memory usage increases

Engineering Contradiction:
Improvegradient calculation accuracyVSAvoidmemory usage
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent introduces global memory as an intermediary storage mechanism for gradients. Checkpoints are set in multiple layers to improve gradient calculation accuracy, and the gradients from these checkpoints are stored in global memory rather than consuming local memory. This intermediary approach allows multiple checkpoints to coexist without proportionally increasing local memory usage, resolving the contradiction between accuracy and memory consumption.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS12487763B2Method and apparatus with memory management and neural network operation
Publication Date: 2025.12.02 SAMSUNG ELECTRONICS CO LTD
  • US12487763B2 patent drawing
  • US12487763B2 patent drawing
  • US12487763B2 patent drawing

AI summary

A processor-implemented memory management method includes: receiving a parameter of a neural network and information of a device configured to perform an operation using the neural network; storing a result of an operation by at least one of layers included in the neural network in a first memory of the device, during a forward propagation operation performed for the neural network based on the parameter; storing a gradient of a layer included in the neural network in a second memory of the device, during a backward propagation operation performed for the neural network based on the parameter and the result of the operation by the at least one layer; and managing the first memory and the second memory based on the information, the result of the operation by the at least one layer, and the gradient.