Method and apparatus for generating operator
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.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 20 · Forward citations: 0.
Claims (12 — 3 Independent, 9 Dependent)
- Claim 1Independent Claim
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.
- Claim 2Depends on #1
The method according to claim 1, wherein 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 comprises: generating the target kernel operator based on three types of basic application programming interfaces in the group of basic application programming interfaces and the kernel application programming interface, wherein the three types of basic application programming interfaces are a type of input/output application programming interface, a type of computing application programing interface, and a type of computing rule application programming interface, respectively, wherein the input/output application programming interface is used for completing read/write in a global memory and a register, the computing application programming interface is a general-purpose computing function, and the computing rule application programming interface is used for defining a computing rule in the computing application programming interface for invoking by the computing application programming interface.
- Claim 3Depends on #2
The method according to claim 2, wherein the computing rule application programming interface is set based on user needs.
- Claim 4Depends on #1
The method according to claim 1, wherein generating the target kernel operator adapted to the hardware architecture based on the group of basic application programming interfaces and the kernel application programming interface comprises: generating, in response to detecting an updating operation on the basic application programming interfaces, an updated group of basic application programming interfaces based on the updating operation; and generating the target kernel operator based on the updated group of basic application programming interfaces and the kernel application programing interface.
- Claim 5Independent Claim
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.
- Claim 6Depends on #5
The apparatus according to claim 5, wherein 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 comprises: generating the target kernel operator based on three types of basic application programming interfaces in the group of basic application programming interfaces and the kernel application programming interface, wherein the three types of basic application programming interfaces are a type of input/output application programming interface, a type of computing application programing interface, and a type of computing rule application programming interface, respectively, wherein the input/output application programming interface is used for completing read/write in a global memory and a register, the computing application programming interface is a general-purpose computing function, and the computing rule application programming interface is used for defining a computing rule in the computing application programming interface for invoking by the computing application programming interface.
- Claim 7Depends on #6
The apparatus according to claim 6, wherein the computing rule application programming interface is set based on user needs.
- Claim 8Depends on #5
The apparatus according to claim 5, wherein generating the target kernel operator adapted to the hardware architecture based on the group of basic application programming interfaces and the kernel application programming interface comprises: generating, in response to detecting an updating operation on the basic application programming interfaces, an updated group of basic application programming interfaces based on the updating operation; and generating the target kernel operator based on the updated group of basic application programming interfaces and the kernel application programming interface.
- Claim 9Independent Claim
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.
- Claim 10Depends on #9
The non-transitory computer readable storage medium according to claim 9, wherein 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 comprises: generating the target kernel operator based on three types of basic application programming interfaces in the group of basic application programming interfaces and the kernel application programming interface, wherein the three types of basic application programming interfaces are a type of input/output application programming interface, a type of computing application programing interface, and a type of computing rule application programming interface, respectively, wherein the input/output application programming interface is used for completing read/write in a global memory and a register, the computing application programming interface is a general-purpose computing function, and the computing rule application programming interface is used for defining a computing rule in the computing application programming interface for invoking by the computing application programming interface.
- Claim 11Depends on #10
The non-transitory computer readable storage medium according to claim 10, wherein the computing rule application programming interface is set based on user needs.
- Claim 12Depends on #9
The non-transitory computer readable storage medium according to claim 9, wherein generating the target kernel operator adapted to the hardware architecture based on the group of basic application programming interfaces and the kernel application programming interface comprises: generating, in response to detecting an updating operation on the basic application programming interfaces, an updated group of basic application programming interfaces based on the updating operation; and generating the target kernel operator based on the updated group of basic application programming interfaces and the kernel application programing interface.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATIONS The present application claims the priority of Chinese Patent Application No. 202111503431.6, titled “ METHOD AND APPARATUS FOR GENERATING OPERATOR ” , filed on Dec. 10, 2021, which is incorporated herein by reference in its entirety. TECHNICAL FIELD The present disclosure relates to the technical field of computers, specifically relates to the technical field of neural networks, and more specifically relates to a method and apparatus for generating an operator. BACKGROUND At present, a deep neural network framework contains a large number of operators. In a current operator system, it is required to separately develop a Kernel function for each operator. For different hardware, Kernel implementations are different, i.e., each hardware platform for each operator in an existing deep learning framework corresponds to at least one Kernel. SUMMARY Embodiments of the present disclosure provide a method and apparatus for generating an operator, a device, and a storage medium. Some embodiments of the present disclosure provide a method for generating an operator, including: 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. Some embodiments of the present disclosure provide an apparatus for generating an operator, including: a first constructing module configured to construct 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; a second constructing module configured to construct a kernel applica
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (20)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (8)
- Notice of Allowance dated Feb. 27, 2025 in Korean Application No. 10-2022-0106027, 3 pages.
- OpenMP task generation using Batched Kernel API from https://jglobal.jst.go_jp/detail?JGLOBAL_ID=201902250649754535, retrieved on Aug. 30, 2022, in 3 pages.
- Higuchi et al.,
- “
- CIPy: A NumPy-compatible Library Accelerated with OpenCL
- ”
- , 2019 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), IEEE, May 20, 2019 (May 20, 2019), pp. 933-940.
- First Office Action issued in European Patent Application No. 22189729.1 dated Aug. 27, 2025, in 13 pages.