Neural Network Compiler Directed Graph Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The current compilation process for neural network models is complex and inefficient, requiring conversion to a specific exchange format and subsequent processing to be recognized by accelerators.
Innovation Solution
A method of compiling neural network models that involves reading a target model, generating a directed graph, revising it based on software and hardware information of the target accelerator, and generating a compilation result directly applicable to the accelerator.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the neural network model is converted to a specific exchange format and processed through a specific importer, then the compilation result can be recognized by the accelerator, but the compilation process becomes complex and efficiency decreases
Solution Approach 1:
The patent extracts the essential compilation logic directly into the compiler, eliminating the need for separate conversion steps. The compiler generates compilation results that are directly compatible with the accelerator's instruction set architecture, removing the intermediary exchange format conversion step while maintaining compatibility.
Solution Approach 2:
The compiler is designed to perform multiple functions: parsing the neural network model, generating the directed graph, optimizing based on accelerator architecture, and producing compatible compilation results all in one unified process. This multi-functional approach eliminates the need for separate conversion tools and importers.
2Adaptability or versatility
If the neural network model is converted to a specific exchange format, then it can be processed by the importer, but the compilation efficiency is reduced
Solution Approach 1:
The compiler performs preliminary optimization of the directed graph by merging subgraphs with identical nodes and edges before generating the final compilation result. This preliminary structuring action reduces the complexity of subsequent processing and eliminates the need for separate format conversion steps, thereby improving compilation efficiency.
Solution Approach 2:
The patent changes the internal representation parameters of the neural network model into a directed graph format that is directly optimized for the target accelerator. By transforming the model representation early in the compilation process and maintaining this optimized format throughout, the system eliminates inefficient format conversion steps and improves overall compilation efficiency.
Data Source
AI summary
Provided are a method of compiling a neural network model, a compiler, and a computer-readable storage medium. The method of compiling a neural network model includes reading a target neural network model and obtaining the target accelerator info; generating a first directed graph corresponding to the target neural network by using operation elements as nodes and dependencies between the operation elements as edges, wherein the operation elements include operation types and accompanying parameters of the operation types; revising the first directed graph based on a software and hardware information supported by the target accelerator to generate a second directed graph; and generating a compilation result of the target neural network model based on the second directed graph.


