Memory Allocation Profiling for ML Training Bottlenecks

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Memory management during machine learning model training is challenging due to limited memory capacity in processing units, especially when dealing with large datasets and distributed systems, leading to inefficiencies in memory consumption and computational overhead.

Innovation Solution

A profiling-based memory allocation algorithm that utilizes timestamps to optimize memory usage by grouping objects based on allocation and deallocation timestamps, reducing memory fragmentation, and applying allocation information across subsequent execution steps to balance memory consumption and computational complexity.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If traditional memory allocation methods are used in distributed training systems, then memory capacity can accommodate large datasets, but memory fragmentation increases and computational overhead rises

Engineering Contradiction:
Improvememory capacityVSAvoidmemory management complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The system performs preliminary profiling of memory allocation patterns before actual training execution. By collecting allocation timestamps, deallocation timestamps, and object sizes in advance, the system pre-determines optimal memory allocation strategies, avoiding fragmentation during actual training and reducing computational overhead.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The memory allocation system dynamically adjusts allocation strategies based on profiling results. Different object types receive different allocation treatments, and the system adapts memory management approaches based on observed allocation patterns, thereby optimizing memory usage while reducing fragmentation.

Inventive Principle:
Principle #15Dynamics

2Quantity of substance

If memory allocation is optimized to reduce fragmentation, then memory consumption decreases, but computational complexity increases due to profiling requirements

Engineering Contradiction:
Improvememory consumptionVSAvoidcomputational overhead
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The profiling phase is executed beforehand to collect memory allocation patterns. This preliminary action enables the system to determine optimal allocation strategies in advance, reducing memory consumption during actual training without requiring complex real-time computations.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses its own memory allocation patterns as input data for optimization. By profiling its own allocation behavior and using this information to guide future allocations, the system achieves memory optimization with minimal external intervention or complex external algorithms.

Inventive Principle:
Principle #25Self-service

3Measurement precision

If profiling is performed on all objects, then memory allocation accuracy improves, but processing time increases

Engineering Contradiction:
Improveallocation accuracyVSAvoidprofiling time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system segments objects into different categories based on their allocation patterns and characteristics. By profiling and treating different object segments differently, the system achieves high allocation accuracy for critical objects while reducing profiling overhead for less critical objects.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs profiling selectively on objects that benefit most from optimized allocation, rather than uniformly profiling all objects. This partial action approach maintains high accuracy for memory-critical components while reducing overall profiling time and computational burden.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS20240118818A1Method and system of managing memory usage in a data learning operation
Publication Date: 2024.04.11 LEMON INC(GB)
  • US20240118818A1 patent drawing
  • US20240118818A1 patent drawing
  • US20240118818A1 patent drawing

AI summary

Methods and systems for managing memory usage in data learning operations. The method includes profiling one or more objects used for training in the data learning operation, in which the profiling includes determining an object size, a memory allocation timestamp, and a memory deallocation timestamp; and scheduling the memory usage. The scheduling includes grouping the one or more objects into the one or more groups based on the memory allocation and/or the memory deallocation timestamp of the one or more objects, and arranging the one or more objects in the one or more groups in descending order in a memory space. Two or more objects are provided in the descending order in the memory space, in which one of the objects having an earliest memory allocation timestamp is provided at a first value and the other object having a later memory allocation timestamp is provided at a second value.