# US 2021/0294625 A1 · Multiformat data generation for neural network

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0294625 A1
- Document ID: US20210294625A1
- Status: Published application
- Kind: A1
- Application number: 17/204,874
- Filed: 2021-03-17
- Published: 2021-09-23
- Earliest claimed: 2020-03-17
- Assignees: OnSpecta, Inc.
- Applicants: Onspecta, Inc.
- Inventors: Victor Jakubiuk
- Web page: https://patentgrep.com/patent/US20210294625A1

## CPC

- G06F 9/45516: {Runtime code conversion or optimisation}
- G06F 9/4552: {Involving translation to a different instruction set architecture, e.g. just-in-time translation in a JVM}
- G06N 3/10: Interfaces, programming languages or software development kits, e.g. for simulating neural networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Disclosed are systems and methods for efficiently processing artificial intelligence networks. In some embodiments, a just-in-time (JIT) compiler can determine an efficient input data format for a second kernel or microkernel, which is to digest the output of a first kernel or microkernel. The JIT compiler can generate the first kernel or microkernel with an embedded postprocessor, which can dynamically generate a data structure in the efficient data format as the first kernel or microkernel generates its output. The embedded postprocessor can receive the output stream of the first kernel, individually or in portions and can dynamically populate a data structure in the determined efficient data format to be digested by the second kernel or microkernel.

## Claims

### Claim 1

A computer-implemented system of compiling AI network code to hardware instructions, the system comprising:
a plurality of kernels, wherein each kernel translates an operation of the AI network to hardware instructions to execute the operation in the hardware, wherein an output of a kernel feeds as input into another kernel, wherein each kernel accepts an input data in an input data format and outputs data in an output data format; and
a just-in-time (JIT) compiler configured to generate and plug a postprocessor module in a first kernel, wherein the postprocessor module is configured to dynamically and at run-time determine an efficient input data format of a second kernel and dynamically and at run-time convert an output data stream of the first kernel from a first data format to a second data format, wherein the second data format comprises the efficient input data format of the second kernel.

### Claim 2 (depends on 1)

The system of claim 1, wherein converting dynamically and at run-time comprises the postprocessor module populating an output data structure with the output data stream of the first kernel in the second data format as the first kernel generates the output data stream and/or partial output data stream, wherein the second data format comprises the input data format of the second kernel.

### Claim 3 (depends on 1)

The system of claim 1 further comprising a plurality of postprocessor modules plugged in one or more kernels, wherein each postprocessor is configured to receive the output stream of a kernel and populate a data structure in a data format compatible with input data format of a subsequent kernel, and wherein the plurality of postprocessors are configured to optimize end-to-end execution of the neural network on the hardware.

### Claim 4 (depends on 1)

The system of claim 1, wherein determining the input data format of a second kernel is at least partly based on determining the hardware on which the hardware instructions are to be executed.

### Claim 5 (depends on 1)

The system of claim 1, wherein the hardware comprises a CPU, GPU or TPU.

### Claim 6 (depends on 1)

The system of claim 1, wherein the data formats comprise NHWC or NCHW.

### Claim 7 (depends on 1)

The system of claim 1, wherein the kernels comprise a plurality of microkernels or the kernels are microkernels.

### Claim 8 (depends on 1)

The system of claim 1, wherein the AI network comprises a neural network.

### Claim 9

A computer-implemented system of compiling AI network code to hardware instructions, the system comprising:
a plurality of kernels, wherein each kernel translates an operation of the AI network to hardware instructions to execute the operation in the hardware, wherein an output of a kernel feeds as input into another kernel, wherein each kernel accepts an input data in an input data format and outputs data in an output data format; and
a just-in-time (JIT) compiler configured to generate and plug a preprocessor module in a first kernel, wherein the preprocessor module is configured to dynamically and at run-time determine an output data format of a second kernel and dynamically and at run-time convert an output data stream of the second kernel from a first data format to a second data format, wherein the second data format comprises the input data format of the first kernel.

### Claim 10 (depends on 9)

The system of claim 9, wherein converting dynamically and at run-time comprises the preprocessor module populating an input data structure with the output data stream of the second kernel in the second data format as the second kernel generates the output data stream and/or partial output data stream, wherein the second data format comprises the input data format of the first kernel.

### Claim 11

A computer-implemented method of compiling AI network code to hardware instructions, the method comprising:
translating operations of an AI network to hardware instructions, with a plurality of kernels, wherein each kernel translates an operation of the AI network to hardware instructions to execute the operation in the hardware, wherein an output of a kernel feeds as input into another kernel, wherein each kernel accepts an input data in an input data format and outputs data in an output data format; and
generating, with a just-in-time (JIT) compiler, a postprocessor module in a first kernel, wherein the postprocessor module is configured to dynamically and at run-time determine an efficient input data format of a second kernel and dynamically and at run-time convert an output data stream of the first kernel from a first data format to a second data format, wherein the second data format comprises the efficient input data format of the second kernel.

### Claim 12 (depends on 11)

The method of claim 11, wherein converting dynamically and at run-time comprises the postprocessor module populating an output data structure with the output data stream of the first kernel in the second data format as the first kernel generates the output data stream and/or partial output data stream, wherein the second data format comprises the input data format of the second kernel.

### Claim 13 (depends on 11)

The method of claim 11 further comprising generating a plurality of postprocessor modules and embedding them in one or more kernels, wherein each postprocessor is configured to receive the output stream of a kernel and populate a data structure in a data format compatible with input data format of a subsequent kernel, and wherein the plurality of postprocessors are configured to optimize end-to-end execution of the neural network on the hardware.

### Claim 14 (depends on 11)

The method of claim 11, wherein determining the input data format of a second kernel is at least partly based on determining the hardware on which the hardware instructions are to be executed.

### Claim 15 (depends on 11)

The method of claim 11, wherein the hardware comprises a CPU, GPU or TPU.

### Claim 16 (depends on 11)

The method of claim 11, wherein the data formats comprise NHWC or NCHW.

### Claim 17 (depends on 11)

The method of claim 11, wherein the kernels comprise a plurality of microkernels or the kernels are microkernels.

### Claim 18 (depends on 1)

The system of claim 1, wherein an AOT compiler, instead of the JIT compiler, is configured to generate and plug the postprocessor module in the first kernel.

### Claim 19 (depends on 9)

The system of claim 9, wherein an AOT compiler, instead of the JIT compiler, is configured to generate and plug the preprocessor module in the first kernel.

### Claim 20 (depends on 11)

The method of claim 11, wherein an AOT compiler is used in lieu of a JIT compiler.
