Inference Query Execution Using Unified DB-ML Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems face challenges in efficiently executing inference queries in database management systems by integrating machine learning models, leading to high resource consumption and latency, while maintaining data security and privacy.
Innovation Solution
A system that generates a unified intermediate representation (UIR) of inference queries and machine learning models, allowing cross-optimization between database and machine learning operators, with portions executed by respective engines to optimize resource usage and accuracy.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If machine learning models are integrated into database management systems to execute inference queries, then query accuracy and insights are improved, but resource consumption and latency increase
Solution Approach 1:
The system segments the inference query execution into distinct components: database operators for data retrieval and machine learning operators for model inference. This segmentation allows each component to be optimized independently and executed by specialized engines, reducing overall resource consumption while maintaining query accuracy.
Solution Approach 2:
The system dynamically determines which portions of the unified intermediate representation to execute using the database engine versus the machine learning engine based on cross-optimization analysis. This dynamic allocation optimizes resource usage by assigning each operation to the most efficient executor, reducing overall resource consumption while maintaining accuracy.
2Measurement precision
If machine learning models are integrated into database management systems, then query accuracy is improved, but execution latency increases
Solution Approach 1:
The system performs preliminary actions by generating a unified intermediate representation that captures both database and machine learning operators before execution. Cross-optimization is performed in advance to determine the optimal execution plan, which reduces execution latency during actual query processing by avoiding runtime decision-making.
Solution Approach 2:
The system dynamically selects execution strategies and optimizes the unified intermediate representation based on the specific query and model characteristics. This dynamic optimization reduces execution latency by choosing the most efficient path for each inference query while maintaining accuracy.
3Use of energy by moving object
If inference queries are executed using traditional database engines alone, then resource consumption is lower, but query accuracy and machine learning insights are lost
Solution Approach 1:
The system merges database operators and machine learning operators into a unified intermediate representation that can be executed by coordinating both database and machine learning engines. This merging enables the system to leverage the strengths of both engines, achieving high query accuracy with optimized resource consumption by executing only necessary operations in each engine.
4Use of energy by moving object
If cross-optimization between database and machine learning operators is performed, then resource consumption and latency are reduced, but system complexity increases
Solution Approach 1:
The unified intermediate representation serves as an intermediary that bridges database operators and machine learning operators. This intermediary enables cross-optimization between the two systems without requiring direct complex interactions, reducing system complexity while still achieving optimized resource consumption and latency.
Data Source
Figure 1A
Figure 1B
Figure 1C
AI summary
The description relates to executing an inference query relative to a database management system, such as a relational database management system. In one example a trained machine learning model can be stored within the database management system. An inference query can be received that applies the trained machine learning model on data local to the database management system. Analysis can be performed on the inference query and the trained machine learning model to generate a unified intermediate representation of the inference query and the trained model. Cross optimization can be performed on the unified intermediate representation. Based upon the cross-optimization, a first portion of the unified intermediate representation to be executed by a database engine of the database management system can be determined, and, a second portion of the unified intermediate representation to be executed by a machine learning runtime can be determined.