Variable Batch Sizing and Gradient Checkpoint Segments
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The challenge in machine learning model training is the efficient use of computing resources, particularly in scenarios where deep learning models are large and resource-constrained, such as on mobile/edge devices or in cloud environments, due to high memory requirements and variable system loads, leading to impractical inferencing costs and latencies.
Innovation Solution
The implementation of gradient checkpointing and variable batch sizes during the training process, where intermediate results are discarded and recovered as needed, and optimal batch sizes are calculated dynamically based on available memory and system load, allowing for larger models and improved resource utilization.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If gradient checkpointing is used to discard intermediate activations, then memory usage is reduced, but training time increases due to re-computation
Solution Approach 1:
The training process is segmented into forward pass and backward pass phases, with gradient checkpointing applied selectively to different segments. This allows the system to discard activations during forward pass and re-compute only when needed during backward pass, reducing peak memory usage while minimizing re-computation overhead
Solution Approach 2:
The system dynamically adjusts batch sizes as a parameter during training based on available memory and system load. By changing the batch size parameter adaptively, the system can optimize the trade-off between memory consumption and training speed, allowing larger batches when memory is available and smaller batches when memory is constrained
2Productivity
If larger batch sizes are used during training, then training speed increases, but memory requirements increase
Solution Approach 1:
The batch size is made dynamic rather than fixed, allowing it to change during the training process based on available memory resources and system load conditions. This enables the system to utilize larger batches for faster training when memory is available, and automatically reduce batch size when memory constraints arise
Solution Approach 2:
The system employs parameter changes by adjusting batch size as a controllable parameter. This allows flexible adaptation to different memory conditions, enabling the system to optimize training speed by using larger batches when memory permits and preventing out-of-memory errors by reducing batch size when needed
Data Source
AI summary
A computer-implemented machine learning model training method and resulting machine learning model. One embodiment of the method may comprise receiving at a computer memory training data; and training on a computer processor a machine learning model on the received training data using a plurality of batch sizes to produce a trained processor. The training may include calculating a plurality of activations during a forward pass of the training and discarding at least some of the calculated plurality of activations after the forward pass of the training.


