# US 12,118,354 B2 · Virtually padding data structures

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

- Number: US 12,118,354 B2
- Document ID: US12118354B2
- Status: Granted
- Kind: B2
- Application number: 17/899,231
- Filed: 2022-08-30
- Published: 2024-02-29
- Granted: 2024-10-15
- Earliest claimed: 2022-08-30
- Assignees: Advanced Micro Devices, Inc.
- Applicants: Advanced Micro Devices, Inc.
- Inventors: Meysam Taassori; Shaizeen Dilawarhusen Aga; Mohamed Assem Abd ElMohsen Ibrahim; Johnathan Robert Alsop
- Web page: https://patentgrep.com/patent/US12118354B2

## CPC

- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 12/10: Address translation
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 16/2237: {Vectors, bitmaps or matrices}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A virtual padding unit provides a virtual padded data structure (e.g., virtually padded matrix) that provides output values for a padded data structure without storing all of the padding elements in memory. When the virtual padding unit receives a virtual memory address of a location in the virtual padded data structure, the virtual padding unit checks whether the location is a non-padded location in the virtual padded data structure or a padded location in the virtual padded data structure. If the location is a padded location in the virtual padded data structure, the virtual padding unit outputs a padding value rather than a value stored in the virtual padded data structure. If the location is a non-padded location in the virtual padded data structure, a value stored at the location is output.

## Claims

### Claim 1

A method comprising:
receiving an address of a location in memory; and
outputting, based on the address corresponding to a padding value in a virtually padded data structure having multiple padding values and without having stored all of the multiple padding values of the virtually padded data structure in memory, the padding value.

### Claim 2 (depends on 1)

The method of claim 1, wherein the virtually padded data structure comprises a virtually padded matrix.

### Claim 3 (depends on 1)

The method of claim 1, further comprising outputting, based on the address corresponding to a value in the virtually padded data structure that is not a padding value, an address of the location in an initial data structure that is a basis for the virtually padded data structure.

### Claim 4 (depends on 1)

The method of claim 1, further comprising, based on the address not corresponding to a location in the virtually padded data structure, passing through the address.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
maintaining a record of a location, a shape, and a size of the virtually padded data structure, and a location, a shape, and a size of an initial data structure that is a basis for the virtually padded data structure.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
receiving a padding instruction identifying the initial data structure and a type of padding to use for the virtually padded data structure; and
maintaining, in the record, an indication of the type of padding as associated with the initial data structure.

### Claim 7 (depends on 1)

The method of claim 1, wherein the outputting comprises outputting, as the padding value, a constant value.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
receiving a padding instruction identifying an initial data structure that is a basis for the virtually padded data structure and a type of padding to use for the virtually padded data structure.

### Claim 9 (depends on 3)

The method of claim 3, further comprising:
retrieving from a cache, based on the address corresponding to a padding value in the virtually padded data structure, the padding value; and
retrieving from the cache, based on the address corresponding to a value in the virtually padded data structure that is not a padding value, the address of the location in the initial data structure.

### Claim 10 (depends on 3)

The method of claim 3, further comprising:
obtaining, based on the address corresponding to a padding value in the virtually padded data structure, the padding value by applying a function to the address; and
obtaining, based on the address corresponding to a value in the virtually padded data structure that is not a padding value, the address of the location in the initial data structure by applying a function to the received address.

### Claim 11 (depends on 1)

The method of claim 1, wherein whether the address corresponds to a value in the virtually padded data structure that is not a padding value is based on a field in a page table entry or other tracking structure that includes the address.

### Claim 12 (depends on 1)

The method of claim 1, wherein whether the address corresponds to a value in the virtually padded data structure that is not a padding value is based on whether the address is within a particular range, based on one or more bits in an issuing instruction including the address, or based on an index into a padding data table.

### Claim 13

A system comprising:
a memory; and
at least one processor configured to:
receive a virtual address of a location in virtual memory; and
output, without having stored all of multiple padding values of a virtually padded data structure in the memory, a padding value based on the address corresponding to a padding value in the virtually padded data structure.

### Claim 14 (depends on 13)

The system of claim 13, wherein the at least one processor is further configured to output, based on the address corresponding to a value in the virtually padded data structure that is not a padding value, an address of the location in an initial data structure that is a basis for the virtually padded data structure.

### Claim 15 (depends on 13)

The system of claim 13, wherein the at least one processor is further configured to:
maintain a record of a location, a shape, and a size of the virtually padded data structure, and a location, a shape, and a size of an initial data structure that is a basis for the virtually padded data structure.

### Claim 16 (depends on 15)

The system of claim 15, wherein the at least one processor is further configured to:
receive a padding instruction identifying the initial data structure and a type of padding to use for the virtually padded data structure; and
maintain, in the record, an indication of the type of padding as associated with the initial data structure.

### Claim 17

A computing device comprising:
a memory; and
at least one processor configured to receive an address of a location in the memory and output, without having stored all of multiple padding values elements of a virtually padded data structure in the memory, an address of the location in an initial data structure that is a basis for the virtually padded data structure.

### Claim 18 (depends on 17)

The computing device of claim 17, wherein the at least one processor is further configured to output a padding value based on the address corresponding to a padding value in the virtually padded data structure.

### Claim 19 (depends on 18)

The computing device of claim 18, wherein the at least one processor is further configured to output, as the padding value, a constant value.

### Claim 20 (depends on 18)

The computing device of claim 18, wherein the at least one processor is further configured to:
receive a padding instruction identifying the initial data structure and a type of padding to use for the virtually padded data structure.
