Input Batching for Machine Learning Models

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing machine learning systems face inefficiencies in utilizing hardware resources, particularly high-throughput devices like GPUs, due to suboptimal input processing methods, which can lead to increased latency and resource wastage, especially when handling multiple models concurrently.

Innovation Solution

Implementing a batching system that aggregates inputs for each machine learning model into a single, higher-order tensor, processed in parallel, while maintaining separate queues to optimize hardware utilization and manage latency through strategic batch size determination and thread allocation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If inputs are processed individually through the machine learning model, then latency for each input is minimized, but hardware resource utilization is inefficient and throughput is reduced

Engineering Contradiction:
ImprovethroughputVSAvoidlatency
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent combines multiple individual inputs into a single batched input tensor that is processed together through the machine learning model. This merging of inputs allows the hardware to process multiple requests simultaneously in parallel, improving throughput while maintaining acceptable latency through controlled batch sizes and timing mechanisms.

Inventive Principle:
Principle #5Merging (Combining)

2Adaptability or versatility

If hardware resources are allocated to process multiple machine learning models concurrently, then service versatility is improved, but resource allocation complexity increases

Engineering Contradiction:
Improvemulti-model supportVSAvoidresource allocation complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the input processing into separate queues for different machine learning models, allowing independent management of inputs for each model. This segmentation enables the system to handle multiple models concurrently while simplifying resource allocation through a first-available policy that assigns inputs to the first available model, reducing allocation complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements a universal batching mechanism that can handle multiple different machine learning models through a common infrastructure. The same batching and queue management system serves all models, providing multi-functionality without requiring model-specific processing logic, thus improving versatility while managing complexity.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS10789544B2Batching inputs to a machine learning model
Publication Date: 2020.09.29 GOOGLE LLC
  • US10789544B2 patent drawing
  • US10789544B2 patent drawing
  • US10789544B2 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for batching inputs to machine learning models. One of the methods includes receiving a stream of requests, each request identifying a respective input for processing by a first machine learning model; adding the respective input from each request to a first queue of inputs for processing by the first machine learning model; determining, at a first time, that a count of inputs in the first queue as of the first time equals or exceeds a maximum batch size and, in response: generating a first batched input from the inputs in the queue as of the first time so that a count of inputs in the first batched input equals the maximum batch size, and providing the first batched input for processing by the first machine learning model.