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

Claim 12:
13. The apparatus for execution of the computational graph in the neural network model according to claim 11, wherein a specific process executed by the task execution body internal module is as follows:
step 1: producing, by the current execution body, tensor data of the current execution body, wherein the current execution body loads a computational task of an internal operator kernel function of the current execution body, executes kernel function computation, and produces output tensor data of the computational task of the kernel function;
step 2: packing, by the current execution body, the tensor data produced by the current execution body into a message, wherein the tensor data produced by the current execution body are stored into an available memory block, an address of the available memory block and an identification number of the downstream execution body corresponding to the current execution body are packed into a message; and then the current execution body prepares to send the message to the downstream execution body corresponding to the current execution body;
step 3: sending, by the current execution body, the message to the downstream execution body, wherein when the current execution body completes the computational task of an kernel function of the current execution body and has prepared the message sent to the downstream execution body, the current execution body starts to send the message to the downstream execution body that needs to consume the tensor data produced by the current execution body, informing the corresponding downstream execution body of reading the data produced by the current execution body;
step 4: sending, by the current execution body, the message to the upstream execution body, wherein the current execution body also needs to return the memory block of the consumed tensor data from the upstream execution body to the upstream execution body, indicating that the current execution body has used the data of the upstream execution body, and that the upstream execution body is permitted to recover the memory block of the output tensor data of the upstream execution body;
step 5: preparing tensor data by the downstream execution body, wherein the downstream execution body prepares tensor data according to the received message sent by the current execution body, the downstream execution body parses the message to obtain the tensor data produced by the current execution body from the message, and the tensor data are used as an input tensor when the downstream execution body operates an operator kernel function of the downstream execution body;
step 6: preparing, by the downstream execution body, a tensor memory block required for storing the tensor data produced by the downstream execution body, wherein the downstream execution body requests a memory block of output tensor data produced when the downstream execution body executes the computational task of a corresponding operator kernel function; and
step 7: operating, by the downstream execution body, the task of an internal operator kernel function of the downstream execution body, and producing output tensor data, wherein the downstream execution body determines whether the following execution conditions are currently satisfied after receiving the message of the current execution body: a) tensor data needing to be read by the downstream execution body are ready; and b) there is an idle memory block used for storing the output tensor data produced when the downstream execution body operates the operator kernel function; and wherein when the execution conditions are satisfied, the downstream execution body starts to call an internal operator kernel function of the downstream execution body, reads the tensor data sent by the current execution body, executes the computational task of the internal operator kernel function of the downstream execution body, and writes the produced output tensor data into an idle tensor memory block.