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

Claim 5:
6. The method of executing dynamic graph for neural network computation according to claim 1, wherein the step S34 includes the following specific sub-steps:
S341: defining an operand type of each of the instruction for reading and modifying the value of the tensor data pointer, the instruction for running the operator and the instruction for releasing the tensor memory, wherein the operand type comprises a constant type, a compile-time variable type, and a runtime variable type, the constant type corresponds to an input and represents a data reading operation, and the compile-time variable type and the runtime variable type correspond to an output and represent a data writing operation;
S342: consuming a readable data pointer object: traversing a constant type operand in a kernel function of a current operator, fetching a corresponding data pointer object of a current operand in an input tensor tuple, and executing a computing task by the kernel function of the current operator by utilizing a value of the obtained data pointer object;
S343: consuming a writable data pointer object, which includes the following specific processes:
(1) traversing a compile-time variable type operand in the kernel function of the current operator and fetching a corresponding data pointer object of a current operand in an output tensor tuple,
(2) when the data pointer object of the output tensor corresponds to a plurality of instruction accesses, maintaining an instruction list for all instructions which access a data pointer object of a current output tensor, and adding the current instruction into the instruction list for the instructions which access the data pointer object, and
(3) carrying out a lock on a plurality of read-write accesses of the data pointer: fetching an access object of a current data pointer by an instruction access pool according to an access type of the current data pointer, the instruction, and the data pointer object, adding the access object into an access list of the current instruction, updating the access list of the current instruction by utilizing the access object, adding the access object into an access list of a writing operation maintained by a current data pointer object, and updating the access list of the writing operation of the current data pointer by utilizing the access object, and
S344: constructing an edge of the instruction: analyzing a relationship between two instructions to respectively construct edges of the instructions, and connecting the two instructions, wherein the relationship between the two instructions is a one-read one-write relationship, or a two-read relationship, or a two-write relationship.