Dynamic ML Model Switching for Response Time and Memory

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Deep learning models are resource-intensive and require significant memory and specialized hardware, limiting their scalability and increasing costs in machine-learning based services due to their larger size compared to non-deep learning models and the need for multiple hosts to handle different models.

Innovation Solution

Implementing a system that uses compressed machine learning models initially and switches to complete models once loaded into memory, allowing for faster response times and reduced costs by reusing hosts for different data domains and utilizing quantization techniques to reduce model size.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If deep learning models are used to achieve higher accuracy, then model accuracy is improved, but model size increases significantly

Engineering Contradiction:
Improvemodel accuracyVSAvoidmodel size
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent segments the model deployment process into two distinct phases: a fast path using compressed models for common requests, and a slow path using complete models for accuracy-critical requests. This segmentation allows the system to maintain high accuracy where needed while reducing overall resource consumption through compressed model serving.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies parameter changes by transforming complete models into compressed models through quantization (reducing precision from 32-bit floating point to 8-bit integers) and pruning (removing redundant neurons and connections). These parameter changes reduce model size by 2-3x while maintaining acceptable accuracy for many use cases.

Inventive Principle:
Principle #35Parameter changes

2Speed

If deep learning models are loaded into memory for fast processing, then response time is improved, but memory consumption increases

Engineering Contradiction:
Improveresponse timeVSAvoidmemory consumption
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent implements dynamic model loading where the system decides at request time whether to use compressed models from memory (fast path) or load complete models from disk (slow path). This dynamic approach allows the system to adapt memory usage to actual workload requirements, loading complete models only when necessary for accuracy-critical requests.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent creates compressed copies of complete models that can be stored in memory with much smaller footprint. These compressed copies serve as lightweight substitutes for the full-precision models, enabling fast inference with reduced memory consumption. The system maintains both compressed and complete model versions to balance speed and accuracy.

Inventive Principle:
Principle #26Copying

3Adaptability or versatility

If multiple complete models are deployed on different hosts to handle various data domains, then model versatility is improved, but the number of hosts required increases

Engineering Contradiction:
Improvemodel versatilityVSAvoidnumber of hosts
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent makes individual hosts universal by enabling them to serve multiple data domains through the fast path compressed model serving. Instead of dedicating specific hosts to specific models, any host can handle requests for any data domain by loading the appropriate compressed model, significantly reducing the total number of hosts required while maintaining full versatility.

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

Solution Approach 2:

The patent uses compressed models as lightweight, easily deployable units that can be quickly loaded and unloaded from host memory. These compressed models act as disposable serving artifacts that can be rapidly instantiated on any host without requiring persistent dedicated infrastructure, reducing overall system complexity and host requirements.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

4Measurement precision

If complete models are loaded into memory for accurate processing, then model accuracy is maintained, but loading time increases

Engineering Contradiction:
Improvemodel accuracyVSAvoidmodel loading time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent performs preliminary compression of complete models into smaller formats during an offline preparation phase. This preliminary action creates compressed model versions that can be quickly loaded into memory, eliminating the need to load large complete models during runtime. The compression work is done in advance, not when requests arrive.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces compressed models as an intermediary between complete models and the inference engine. Instead of directly loading and using complete models, the system uses compressed models as a intermediate representation that requires less memory and loads faster, while still providing sufficient accuracy for most requests.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11444845B1Processing requests using compressed and complete machine learning models
Publication Date: 2022.09.13 AMAZON TECH INC
  • US11444845B1 patent drawing
  • US11444845B1 patent drawing
  • US11444845B1 patent drawing

AI summary

A machine learning-based service processes requests using compressed and complete models to provide faster response times for servicing requests to process data. Initially, a host processes data using a compressed model that is stored in the host's memory and then switches to a larger, more accurate complete model after it is loaded into the host's memory. A host of the machine-learning based service may receive one or more requests to process data. In response, the host uses a compressed version of a model to begin processing the data. The host starts loading the complete version of the model into the host's memory. When the complete version of the model is loaded into memory, the host switches to process a remaining portion of the data using the complete version of the model.