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

Claim 4:
5. The method for adapting a deep learning framework to a hardware device based on a unified backend engine according to claim 2, wherein the compiler of the unified backend engine comprises a following step such that different types of operators are processed: constructing two data structure types, namely, an operator context information type of the unified backend engine and a kernel function type of an operator of the unified backend engine, which comprises:
compiling a single operator, wherein the kernel function type of the operator of the unified backend engine is inherited from the computational graph of the framework, the compilation process of a single operator is completed according to a type of the operator, the kernel function of the operator of the unified backend engine is compiled to generate function codes, intermediate caches, and parameters corresponding to input and output of the function codes, the kernel function type of the operator is registered in a kernel function factory of a corresponding operator to the unified backend engine, and a factory registration mode is adopted so that the backend engine can judge whether the engine supports a certain type of operator when dividing subgraphs;
storing meta-information and compilation results, wherein the operator context information type of the unified backend engine temporarily stores meta-information and compilation results required by compilation, and provides necessary interfaces for the kernel function type of the operator, the operator context information type accepts two inputs, namely, currently computational graph nodes and all created parameters, and fills the function codes, the intermediate caches, and the parameters corresponding to the input and output of the function codes generated by compiling the kernel function type of the operator into corresponding member variables of the operator context information type.