Method and apparatus for generating operator
AssigneeBeijing Baidu Netcom Science Technology Co., Ltd.
InventorsFeng Xing, Xiang Lan, Liling Niu, Xiandong Liu, Yanjun Ma, Dianhai Yu, Haifeng Wang
Life of this patent
Estimating the term…
Abstract
A method and apparatus for generating an operator are provided. The method includes: constructing a group of basic application programming interfaces for providing one of the following basic functions: an access function, a storage function, and a computing function; constructing a kernel application programming interface for invoking the basic application programming interfaces to implement an operator logic; and generating a target kernel operator based on the group of basic application programming interfaces and the kernel application programming interface.
Claims12
A method for generating an operator, comprising:
- constructing a group of basic application programming interfaces for providing one of following basic functions:
- an access function, a storage function, and a computing function;
- constructing a kernel application programming interface for invoking the group of basic application programming interfaces to implement an operator logic, wherein constructing the group of basic application programming interfaces comprises;
- acquiring a category of a hardware architecture of a target kernel operator of a deep neural network framework, wherein the hardware architecture comprises at least one of a graphics processing unit (GPU) or an embedded neural network processing unit (NPU), and
- constructing the group of basic application programming interfaces adapted to the hardware architecture based on the category of the hardware architecture;
- and
- generating the target kernel operator adapted to the hardware architecture based on the group of basic application programming interfaces adapted to the hardware architecture and the kernel application programming interface.
An apparatus for generating an operator, comprising:
- at least one processor;
- and
- a memory storing instructions, wherein the instructions when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising:
- constructing a group of basic application programming interfaces for providing one of following basic functions:
- an access function, a storage function, and a computing function;
- constructing a kernel application programming interface for invoking the group of basic application programming interfaces to implement an operator logic, wherein constructing the group of basic application programming interfaces comprises:
- acquiring a category of a hardware architecture of a target kernel operator of a deep neural network framework, wherein the hardware architecture comprises at least one of a graphics processing unit (GPU) or an embedded neural network processing unit (NPU), and
- constructing the group of basic application programming interfaces adapted to the hardware architecture based on the category of the hardware architecture;
- and
- generating the target kernel operator adapted to the hardware architecture based on the group of basic application programming interfaces adapted to the hardware architecture and the kernel application programming interface.
A non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions are used for causing a computer to execute operations comprising:
- constructing a group of basic application programming interfaces for providing one of following basic functions:
- an access function, a storage function, and a computing function;
- constructing a kernel application programming interface for invoking the basic application programming interfaces to implement an operator logic, wherein constructing the group of basic application programming interfaces comprises;
- acquiring a category of a hardware architecture of a target kernel operator of a deep neural network framework, wherein the hardware architecture comprises at least one of a graphics processing unit (GPU) or an embedded neural network processing unit (NPU), and
- constructing the group of basic application programming interfaces adapted to the hardware architecture based on the category of the hardware architecture;
- and
- generating the target kernel operator adapted to the hardware architecture based on the group of basic application programming interfaces adapted to the hardware architecture and the kernel application programming interface.
Dependencies are inferred from the claim text.