Computation Graph IR with Alias Analysis for Tensor Register Allocation

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvehardware memory resource demandVSAvoidcompilation technique complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

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

Inventive Principle:
Principle #1Segmentation

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

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Engineering Contradiction:
Improvememory resource utilizationVSAvoidcompilation speed
Core Design Contradiction:
Quantity of substanceVSProductivity

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

Inventive Principle:
Principle #10Preliminary action

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

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12602322B2Intermediate representation method and apparatus for compiling computation graphs
Publication Date: 2026.04.14 ZHEJIANG LAB
  • US12602322B2 patent drawing
  • US12602322B2 patent drawing
  • US12602322B2 patent drawing

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.