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

Claim 0:
1. A method of executing dynamic graph for neural network computation, comprising the following steps:
S1: constructing and distributing an operator and a tensor;
S2: deducing an operator executing process by an operator interpreter;
S3: constructing an instruction of a virtual machine at runtime by the operator interpreter, which comprises the following sub-steps:
S31: constructing an instruction for reading and modifying a value of a tensor data pointer,
S32: constructing an instruction for running the operator,
S33: constructing an instruction for releasing a tensor memory, and
S34: constructing a dependency relationship between 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;
S4: sending, to the virtual machine at runtime by the operator interpreter, the instruction of the virtual machine;
S5: scheduling, by the virtual machine, the instruction of the virtual machine; wherein the scheduling comprises: applying for a video memory for an output tensor when the virtual machine executes a current instruction, calling a kernel function of the operator on a current device to carry out computation, and writing a computation result into the output tensor; during a program running period, continuously carrying out polling by the virtual machine in a scheduler thread; in response to a new executable instruction being present, executing the new executable instruction, otherwise continuing to carrying out polling, wherein the polling comprises:
S51: initializing a preparation list, judging whether a current instruction can be issued, and in response to that the current instruction can be issued, adding the current instruction into the preparation list,
S52: receiving the preparation list by a temporary list, traversing the temporary list, and fetching each instruction in the temporary list, and
S53: issuing the each instruction in the temporary list by the virtual machine; and
S6: releasing a new instruction by the virtual machine.