# US 2024/0004656 A1 · Accelerating predicated instruction execution in vector processors

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

- Number: US 2024/0004656 A1
- Document ID: US20240004656A1
- Status: Published application
- Kind: A1
- Application number: 17/853,790
- Filed: 2022-06-29
- Published: 2024-01-04
- Earliest claimed: 2022-06-29
- Assignees: Advanced Micro Devices, Inc.
- Applicants: Advanced Micro Devices, Inc.
- Inventors: Elliott David Binder; Onur Kayiran; Masab Ahmad
- Web page: https://patentgrep.com/patent/US20240004656A1

## CPC

- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30072: {to perform conditional operations, e.g. using predicates or guards}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/3887: {controlled by a single instruction for multiple data lanes [SIMD]}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and systems are disclosed for processing a vector by a vector processor. Techniques disclosed include receiving predicated instructions by a scheduler, each of which is associated with an opcode, a vector of elements, and a predicate. The techniques further include executing the predicated instructions. Executing a predicated instruction includes compressing, based on an index derived from a predicate of the instruction, elements in a vector of the instruction, where the elements in the vector are contiguously mapped, then, after the mapped elements are processed, decompressing the processed mapped elements, where the processed mapped elements are reverse mapped based on the index.

## Claims

### Claim 1

A method for processing a vector by a system, employing a vector processor, comprising:
receiving, by a scheduler, predicated instructions; and
executing the predicated instructions, wherein the executing of a predicated instruction of the predicated instructions comprises:
compressing elements in a first vector of the predicated instruction to generate compressed elements that are contiguously mapped as a second vector,
processing, by an execution unit, the compressed elements to generate processed compressed elements, and
decompressing the processed compressed elements in the second vector.

### Claim 2 (depends on 1)

The method of claim 1, wherein the processing of the compressed elements is performed in one or more cycles, wherein the processing in a cycle comprises:
dispatching a subset of the compressed elements to a hardware vector of the execution unit; and
processing each of the elements in the dispatched subset by a corresponding SIMD lane of the execution unit according to an opcode of the predicated instruction.

### Claim 3 (depends on 2)

The method of claim 2, wherein:
the dispatching comprises,
dispatching the subset of the compressed elements to a portion of the hardware vector, and
dispatching other vector elements to another portion of the hardware vector; and
the processing comprises,
processing the other vector elements by corresponding SIMD lanes of the execution unit according to the opcode.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
dynamically determining whether to perform compression and decompression for the predicated instruction.

### Claim 5 (depends on 4)

The method of claim 4, wherein the determining is based on a level of sparsity of the predicate of the predicated instruction and determining to perform the executing of the predicated instruction is performed in response to the level of sparsity being above a threshold.

### Claim 6 (depends on 5)

The method of claim 5, wherein the determining is based on a ratio of a number of elements in the first vector of the predicated instruction and a number of elements in a hardware vector of the execution unit.

### Claim 7 (depends on 4)

The method of claim 4, wherein the determining is based on a user parameter, a configuration parameter associated with the system, or a combination thereof.

### Claim 8 (depends on 4)

The method of claim 4, wherein the determining is based on a number of the predicated instructions that are queued by the scheduler.

### Claim 9 (depends on 1)

The method of claim 1, wherein:
executing the predicted instruction is performed speculatively.

### Claim 10

A system, employing a vector processor, for processing a vector, comprising:
at least one processor; and
memory storing instructions that, when executed by the at least one processor, cause the processor to:
receive, by a scheduler, predicated instructions, and
execute the predicated instructions, wherein to execute a predicated instruction of the predicated instructions, the instructions further cause the processor to:
compress, by a compressor, elements in a first vector of the predicated instruction to generate compressed elements that are contiguously mapped as a second vector,
process, by an execution unit, the compressed elements to generate processed compressed elements, and
decompress the processed compressed elements in the second vector.

### Claim 11 (depends on 10)

The system of claim 10, wherein the processing of the compressed elements is performed in one or more cycles, wherein the processing in a cycle comprises:
dispatching a subset of the compressed elements to a hardware vector of the execution unit; and
processing each of the elements in the dispatched subset by a corresponding SIMD lane of the execution unit according to an opcode of the predicated instruction.

### Claim 12 (depends on 11)

The system of claim 11, wherein:
the dispatching comprises,
dispatching the subset of the compressed elements to a portion of the hardware vector, and
dispatching other vector elements to another portion of the hardware vector; and
the processing comprises,
processing the other vector elements by corresponding SIMD lanes of the execution unit according to the opcode.

### Claim 13 (depends on 10)

The system of claim 10, wherein the instructions further cause the processor to:
dynamically determining whether to perform compression and decompression for the predicated instruction.

### Claim 14 (depends on 13)

The system of claim 13, wherein the determining is based on a level of sparsity of the predicate of the predicated instruction and determining to perform executing of the predicated instruction is performed in response to the level of sparsity being above a threshold.

### Claim 15 (depends on 14)

The system of claim 14, wherein the determining is based on a ratio of a number of elements in the first vector of the predicated instruction and a number of elements in a hardware vector of the execution unit.

### Claim 16 (depends on 13)

The system of claim 13, wherein the determining is based on a user parameter, a configuration parameter associated with the system, or a combination thereof.

### Claim 17 (depends on 13)

The system of claim 13, wherein the determining is based on a number of the predicated instructions that are queued by the scheduler.

### Claim 18

A non-transitory computer-readable medium comprising instructions executable by at least one processor to perform a method for processing a vector by a system, employing a vector processor, the method comprising:
receiving, by a scheduler, predicated instructions; and
executing the predicated instructions, wherein the executing of a predicated instruction of the predicated instructions comprises:
compressing elements in a first vector of the predicated instruction to generate compressed elements that are contiguously mapped as a second vector,
processing, by an execution unit, the mapped elements in the second vector, generating processed mapped elements, and
decompressing, by a decompressor, the processed mapped elements in the second vector, wherein the processed mapped elements are mapped into a third vector based on the index.

### Claim 19 (depends on 19)

The non-transitory computer-readable medium of claim 19, wherein the method further comprises:
dynamically determining whether to perform compression and decompression for the predicated instruction.

### Claim 20 (depends on 18)

The non-transitory computer-readable medium of claim 18, wherein the processing of the compressed elements is performed in one or more cycles, wherein the processing in a cycle comprises:
dispatching a subset of the compressed elements to a hardware vector of the execution unit; and
processing each of the elements in the dispatched subset by a corresponding SIMD lane of the execution unit according to an opcode of the predicated instruction.
