Patent ID: 11915135
Assignee: ZHEJIANG LAB
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A graph compiling and optimization method for neural network computation, comprising the following steps:
S1: converting a computation graph: converting a neural network computation graph for neural network computation into a computation graph in a global single-node defining mode;
S2: allocating a register of a computer memory: allocating the register of the computer memory for a variable at a node of the computation graph;
S3: defining a route selector for a redefined variable, and selecting a correct definition of the redefined variable at the node of the computation graph according to a path through which execution flow flows in the operation phase of the computation graph;
S4: solving the route selector for the redefined variable;
S41: inserting a copy node of the correct definition of the redefined variable at a non-key edge of the computation graph: inserting an output variable of the route selector at the non-key edge of the computation graph to take over the copy node of the correct definition of the redefined variable;
S42: decomposing a key edge of the computation graph: adding a blank node at the key edge of the computation graph;
S43: inserting the copy node of the correct definition of the redefined variable at the key edge of the computation graph: inserting the output variable of the route selector at the position of a predecessor node of the blank node in the step S42 to take over the copy node of the correct definition of the redefined variable; and
S44: removing the node with the route selector inserted at the junction of multiple paths of computation flow in the computation graph: when the route selector of the correct definition of the redefined variable is de-structured by the step S42 and the step S43, inserting a correct definition node of the redefined variable into the predecessor node corresponding to the junction node of the multiple paths of computation flow;
S5: defining a criterion of inserting the route selector for the redefined variable into the node;
S6: analyzing a dominating edge set of a node for the redefined variable;
S7: inserting the route selector for the redefined variable; and
S8: renaming the redefined variable.