Neural Network Code Generation Optimizing Memory and Execution Time
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing solutions for optimizing neural network executable codes fail to achieve a good compromise between memory allocation and execution time, as optimizing one often results in increased requirements for the other, leading to suboptimal performance.
Innovation Solution
A method to generate optimized executable code for neural networks by determining optimal memory allocation and execution time thresholds, evaluating implementation solutions for each layer, and developing code that balances performance criteria, allowing users to define desired memory allocation and execution time constraints.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If optimization is performed to reduce execution time, then execution time is improved, but memory allocation required for execution increases
Solution Approach 1:
The patent applies dynamics by making the optimization process adaptive and iterative. The system dynamically adjusts optimization parameters based on user-defined constraints and automatically re-runs optimization with modified parameters until constraints are satisfied, rather than using a static single-pass optimization approach.
Solution Approach 2:
The patent segments the optimization process into distinct phases: initial optimization, constraint evaluation, and iterative re-optimization. This allows the system to address different aspects of the contradiction at different stages, first achieving baseline optimization then systematically adjusting for constraint compliance.
2Quantity of substance
If optimization is performed to reduce memory allocation, then memory allocation is improved, but execution time increases
Solution Approach 1:
The system dynamically responds to constraint violations by automatically adjusting optimization parameters and re-running the optimization process. This dynamic adaptation allows the system to shift optimization focus from execution time to memory allocation when constraints indicate memory is excessive, and vice versa.
Solution Approach 2:
The patent implements feedback mechanisms where the system evaluates whether optimized code satisfies user-defined constraints, and uses this evaluation to guide subsequent optimization iterations. The feedback loop ensures that optimization decisions are continuously adjusted based on actual performance against constraints.
3Quantity of substance
If known solutions optimize memory allocation, then memory allocation is reduced, but a good compromise with execution time is not achieved
Solution Approach 1:
The patent creates a universal optimization framework that can handle multiple types of constraints (execution time, memory allocation, and potentially other constraints) within a single system. The framework is versatile enough to adapt to different user needs and constraint combinations without requiring separate optimization approaches.
Solution Approach 2:
The system changes optimization parameters dynamically based on user-defined constraints. By adjusting parameters such as optimization level, code generation strategies, and resource allocation priorities, the system can achieve different balances between memory allocation and execution time to satisfy various constraint scenarios.
Data Source
Figure 1~2

AI summary
According to one aspect, a method is proposed for generating executable code by a computer to implement an artificial neural network (INN) comprising an elaboration (25) of the executable code (ONN) by choosing for each layer of the neural network (INN) an implementation solution from among the possible implementation solutions of that layer based on the performance loss in terms of execution time and/or allocation of that implementation solution compared to the maximum execution time threshold and/or the maximum memory allocation threshold.