# US 2023/0267011 A1 · Apparatus and method for secondary offloads in graphics processing unit

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

- Number: US 2023/0267011 A1
- Document ID: US20230267011A1
- Status: Published application
- Kind: A1
- Application number: 18/305,085
- Filed: 2023-04-21
- Published: 2023-08-24
- Earliest claimed: 2020-10-22
- Assignees: Shanghai Biren Technology Co., Ltd
- Applicants: Shanghai Biren Technology Co., Ltd
- Inventors: HaiChuan WANG; Song ZHAO; GuoFang JIAO; ChengPing LUO; Zhou HONG
- Web page: https://patentgrep.com/patent/US20230267011A1

## CPC

- G06F 9/5044: {considering hardware capabilities}
- G06F 8/41: Compilation
- G06F 8/45: {Exploiting coarse grain parallelism in compilation, i.e. parallelism between groups of instructions}
- G06F 8/458: {Synchronisation, e.g. post-wait, barriers, locks (synchronisation among tasks G06F9/52)}
- G06F 9/3877: {using a secondary processor, e.g. coprocessor (peripheral processor G06F13/12)}
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 13/28: using burst mode transfer, e.g. direct memory access {DMA}, cycle steal (G06F13/32 takes precedence)
- G06F 15/163: Interprocessor communication
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The invention relates to an apparatus for second offloads in a graphics processing unit (GPU). The apparatus includes an engine; and a compute unit (CU). The CU is arranged operably to: fetch execution codes; when each execution code is suitable to be executed by the CU, execute the execution code; and when each execution code is not suitable to be executed by the CU, generate a corresponding entry, and send a request with the corresponding entry to the engine for instructing the engine to allow a component inside or outside of the GPU to complete an operation in accordance with the corresponding entry.

## Claims

### Claim 1

An apparatus for secondary offloads in a graphics processing unit (GPU), comprising:
an engine; and
a compute unit (CU), coupled to the engine, arranged operably to: fetch a plurality of execution codes; when each execution code is suitable to be executed by the CU, execute the execution code; and when each execution code is not suitable to be executed by the CU, generate a first corresponding entry, and send a first request with the first corresponding entry to the engine for instructing the engine to allow a component inside or outside of the GPU to complete an operation in accordance with the first corresponding entry.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the first corresponding entry comprises information indicating that an operation is performed by a component inside or outside of the GPU, and information indicating how to perform the operation.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the first corresponding entry comprises an operating command, and an operating parameter.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the engine comprises:
an interface; and
a controller, coupled to the memory and the interface, arranged operably to: after receiving the first request with the first corresponding entry from the CU through the interface, direct a command processor (CP) through the interface to issue a command to a component inside or outside of the GPU in accordance with content of the first corresponding entry.

### Claim 5 (depends on 4)

The apparatus of claim 4, wherein the CP is installed in the GPU.

### Claim 6 (depends on 4)

The apparatus of claim 4, wherein the controller is arranged operably to: after receiving information indicating that an execution has been completed from the component inside or outside of the GPU through the interface, notify the CU that a corresponding request has been processed completely.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the CU is arranged operably to determine whether each suitable or unsuitable execution code can be executed; if the suitable execution code can be executed, then execute the suitable execution code; if the unsuitable execution code can be executed, then generate a second corresponding entry, and send a second request with the second corresponding entry to the engine for instructing the engine to allow a component inside or outside of the GPU to complete an operation in accordance with the second corresponding entry; if the suitable execution code or the unsuitable cannot be executed, then wait for a period of time until next round of judgment.

### Claim 8 (depends on 7)

The apparatus of claim 7, wherein, when a synchronization flag associated with any suitable execution code or any unsuitable execution code indicates that there is no need to wait for an execution completion of a previous code, or when the synchronization flag associated with any suitable execution code or any unsuitable execution code indicates that it is necessary to wait for an execution completion of a previous code, and the previous code has been executed completely, the suitable execution code or the unsuitable execution code can be executed; when the synchronization flag associated with any suitable execution code or any unsuitable execution code indicates that it is necessary to wait for an execution completion of a previous code, but the previous code hasn’t been executed completely, the suitable execution code or the unsuitable execution code cannot be executed.

### Claim 9 (depends on 1)

The apparatus of claim 1, wherein the component in the GPU is a layer 2 cache, or a direct memory access/system direct memory access (DMA/SDMA) controller, and the component outside of GPU is a central processing unit (CPU).

### Claim 10 (depends on 1)

The apparatus of claim 1, wherein the execution codes are received from a central processing unit (CPU) outside of GPU.

### Claim 11

A method for secondary offloads, performed by a compute unit (CU) together with an engine in a graphics processing unit (GPU), comprising:
fetching, by the CU, a plurality of execution codes;
executing, by the CU, each execution code when each execution code is suitable to be executed by the CU; and
generating, by the CU, a first corresponding entry, and sending a first request with the first corresponding entry to the engine for instructing the engine to allow a component inside or outside of the GPU to complete an operation in accordance with the first corresponding entry.

### Claim 12 (depends on 11)

The method of claim 11, wherein the first corresponding entry comprises information indicating that an operation is performed by a component inside or outside of the GPU, and information indicating how to perform the operation.

### Claim 13 (depends on 12)

The method of claim 12, wherein the first corresponding entry comprises an operating command, and an operating parameter.

### Claim 14 (depends on 11)

The method of claim 11, comprising:
receiving, by the engine, the first request with the first corresponding entry from the CU; and
directing, by the engine, a command processor (CP) to issue a command to a component inside or outside of the GPU in accordance with content of the first corresponding entry.

### Claim 15 (depends on 14)

The method of claim 14, wherein the CP is installed in the GPU.

### Claim 16 (depends on 14)

The method of claim 14, comprising:
receiving, by the engine, information indicating that an execution has been completed from the component inside or outside of the GPU; and
notifying, by the engine, the CU that a corresponding request has been processed completely.

### Claim 17 (depends on 11)

The method of claim 11, comprising:
determining, by the CU, whether each suitable or unsuitable execution code can be executed;
executing, by the CU, the suitable execution code if the suitable execution code can be executed;
generating, by the CU, a second corresponding entry, and sending a second request with the second corresponding entry to the engine for instructing the engine to allow a component inside or outside of the GPU to complete an operation in accordance with the second corresponding entry if the unsuitable execution code can be executed; and
waiting, by the CU, for a period of time until next round of judgment if the suitable execution code or the unsuitable cannot be executed.

### Claim 18 (depends on 17)

The method of claim 17, wherein, when a synchronization flag associated with any suitable execution code or any unsuitable execution code indicates that there is no need to wait for an execution completion of a previous code, or when the synchronization flag associated with any suitable execution code or any unsuitable execution code indicates that it is necessary to wait for an execution completion of a previous code, and the previous code has been executed completely, the suitable execution code or the unsuitable execution code can be executed; when the synchronization flag associated with any suitable execution code or any unsuitable execution code indicates that it is necessary to wait for an execution completion of a previous code, but the previous code hasn’t been executed completely, the suitable execution code or the unsuitable execution code cannot be executed.

### Claim 19 (depends on 11)

The method of claim 11, wherein the component in the GPU is a layer 2 cache, or a direct memory access/system direct memory access (DMA/SDMA) controller, and the component outside of GPU is a central processing unit (CPU).

### Claim 20 (depends on 11)

The method of claim 11, wherein the execution codes are received from a central processing unit (CPU) outside of GPU.
