# US 2024/0403056 A1 · Shader launch scheduling optimization

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

- Number: US 2024/0403056 A1
- Document ID: US20240403056A1
- Status: Published application
- Kind: A1
- Application number: 18/205,699
- Filed: 2023-06-05
- Published: 2024-12-05
- Earliest claimed: 2023-06-05
- Assignees: Advanced Micro Devices, Inc.
- Applicants: Advanced Micro Devices, Inc.
- Inventors: Wei Ye
- Web page: https://patentgrep.com/patent/US20240403056A1

## CPC

- G06F 9/3804: {for branches, e.g. hedging, branch folding}
- G06F 9/30058: {Conditional branch instructions}
- G06F 9/3836: {Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/3887: {controlled by a single instruction for multiple data lanes [SIMD]}
- G06F 9/3888: {controlled by a single instruction for multiple threads [SIMT] in parallel}
- G06F 9/38885: {Divergence aspects}
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A processing system is configured to implement techniques for dynamically selecting an order for executing operations of different branches in a set of branch instructions. In response to receiving the set of branch instructions, the processing system identifies whether a first branch instruction of the set of branch instructions is associated with a first latency value that meets (i.e., equals or exceeds) a latency threshold. Based on the first latency value meeting the latency threshold, the processing system executes operations associated with a second branch instruction of the set of branch instructions prior to executing operations associated with the first branch instruction.

## Claims

### Claim 1

A method comprising:
in response to receiving a set of branch instructions, identifying whether a first branch instruction of the set of branch instructions is associated with a first latency value that meets a latency threshold; and
executing operations associated with a second branch instruction of the set of branch instructions prior to executing operations associated with the first branch instruction based on the first latency value meeting the latency threshold.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first latency value is based on a memory request to an external memory.

### Claim 3 (depends on 2)

The method of claim 2, wherein the memory request is a buffer load operation or an image sample operation.

### Claim 4 (depends on 1)

The method of claim 1, wherein the identifying that the first branch instruction meets the latency threshold is performed based on an indication from a compiler.

### Claim 5 (depends on 1)

The method of claim 1, wherein the first latency value is a duration of a fetch operation associated with one or more memory requests in the first branch instruction, wherein the latency threshold is based on a second latency value associated with the second branch instruction, and wherein the second latency value is a duration of a fetch operation associated with one or more memory requests of the second branch instruction.

### Claim 6 (depends on 1)

The method of claim 1, wherein the latency threshold is based on a duration required to fetch data from a memory in response to a memory request.

### Claim 7 (depends on 1)

The method of claim 1, wherein executing operations associated with the second branch instruction of the set of branch instructions prior to operations associated with the first branch instruction comprises executing arithmetic logic unit (ALU) operations associated with the second branch instruction prior to ALU operations associated with the first branch instruction.

### Claim 8 (depends on 1)

The method of claim 1, wherein the set of branch instructions are included in a wavefront launched by a scheduler in an accelerated processing unit.

### Claim 9 (depends on 8)

The method of claim 8, wherein the scheduler receives instructions associated with executing the wavefront from a compiler, wherein the compiler is configured to identify whether the first latency value meets the latency threshold.

### Claim 10 (depends on 9)

The method of claim 9, wherein the scheduler schedules the executing of operations associated with the second branch instruction prior to operations associated with the first branch instruction by pausing a program counter associated with the first branch instruction and initiating a program counter associated with the second branch instruction.

### Claim 11

An accelerated processing unit comprising:
a scheduler to receive a set of branch instructions and identify whether a first branch instruction of the set of branch instructions is associated with a first latency value that meets a latency threshold; and
a plurality of compute units to execute operations associated with a second branch instruction of the set of branch instructions prior to operations associated with the first branch instruction based on the first latency value meeting the latency threshold.

### Claim 12 (depends on 11)

The accelerated processing unit of claim 11, wherein the first latency value is based on a memory request to an external memory.

### Claim 13 (depends on 12)

The accelerated processing unit of claim 12, wherein the memory request is a buffer load operation or an image sample operation.

### Claim 14 (depends on 11)

The accelerated processing unit of claim 11, wherein the first latency value is a duration of a fetch operation associated with one or more memory requests of the first branch instruction, wherein the latency threshold is based on a second latency value associated with the second branch instruction, and wherein the second latency value is a duration of a fetch operation associated with one or more memory requests of the second branch instruction.

### Claim 15 (depends on 11)

The accelerated processing unit of claim 11, wherein the latency threshold is based on a duration required to fetch data from a memory in response to a memory request.

### Claim 16 (depends on 11)

The accelerated processing unit of claim 11, further comprising:
the scheduler to receive the set of branch instructions from a compiler, where the compiler identifies whether the first branch instruction of the set of branch instructions is associated with the first latency value that meets the latency threshold,
wherein the scheduler instructs the plurality of compute units to execute operations associated with the second branch instruction prior to operations associated with the first branch instruction.

### Claim 17 (depends on 11)

The accelerated processing unit of claim 11, further comprising:
an interface to a memory that stores data for executing operations associated with the first branch instruction and data for executing operations associated with the second branch instruction.

### Claim 18

A processing system comprising:
a memory; and
an accelerated processing unit coupled to the memory and configured to receive a set of branch instructions comprising a first branch instruction and a second branch instruction from the memory, the accelerated processing unit to:
in response to receiving the set of branch instructions, identify whether the first branch instruction is associated with a first latency value that meets a latency threshold; and
execute operations associated with the second branch instruction prior to operations associated with the first branch instruction based on the first latency value meeting the latency threshold.

### Claim 19 (depends on 18)

The processing system of claim 18, wherein the first latency value is a duration of a fetch operation associated with a memory request of the first branch instruction.

### Claim 20 (depends on 18)

The processing system of claim 18, wherein the latency threshold is based on a second latency value associated with the second branch instruction, and wherein the first latency value meeting the latency threshold comprises the first latency value exceeding the second latency value.
