Computation Graph IR with Alias Analysis for Tensor Register Allocation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing neural network computation graph compilation techniques do not effectively analyze tensor variables pointing to the same memory address, leading to high demands on hardware memory resources.
Innovation Solution
An intermediate representation method for compiling computation graphs that constructs nodes for tensor variables, associates them with pointers, analyzes constraint relationships, and iteratively constructs a topological graph to identify and allocate registers for tensor variables with aliases pointing to the same memory location.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If existing compilation techniques are used for neural network computation graphs, then the compilation process is simple, but the hardware memory resource demand is high
Solution Approach 1:
The patent segments the compilation process into distinct phases: building the computation graph, constructing the intermediate representation with pointer analysis, performing alias analysis, and generating optimized code. This segmentation allows for systematic optimization of memory resource usage without overwhelming complexity
Solution Approach 2:
The patent introduces an intermediate representation (IR) as a mediator between the computation graph and the final executable code. This IR includes pointer information and alias relationships, enabling optimized memory management without directly complicating the compilation process
2Quantity of substance
If tensor variables pointing to the same memory address are not analyzed, then the compilation process is fast, but the memory resource utilization is poor
Solution Approach 1:
The patent performs preliminary pointer analysis and alias analysis during the compilation phase to identify tensor variables pointing to the same memory address. This preliminary action enables optimized memory allocation before execution, improving memory utilization without significantly impacting compilation speed
Solution Approach 2:
The patent implements a feedback mechanism where the intermediate representation analyzes pointer relationships and alias information, then uses this information to optimize memory allocation in the generated code, creating a closed-loop optimization process
Data Source
AI summary
A process for generating an intermediate representation methodically compiles a neural network into a computation graph. First, a distinct node is built for every tensor variable within the graph, and this node is linked to a collection of pointers that reference the variable. Next, the method undertakes an analysis of the constraint relationships among these tensor variables. Using this information, it iteratively builds a topological graph that serves as the intermediate representation. Finally, this representation allows for the crucial step of analyzing variables that use different aliases but point to the same memory location, enabling the system to efficiently allocate a register for these aliased tensor variables.


