# US 2021/0173662 A1 · Processor unit for multiply and accumulate operations

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

- Number: US 2021/0173662 A1
- Document ID: US20210173662A1
- Status: Published application
- Kind: A1
- Application number: 16/703,934
- Filed: 2019-12-05
- Published: 2021-06-10
- Earliest claimed: 2019-12-05
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Jentje Leenstra; Andreas Wagner; Jose E. Moreira; Brian W. Thompto
- Web page: https://patentgrep.com/patent/US20210173662A1

## CPC

- G06F 9/3001: {Arithmetic instructions}
- G06F 9/3893: {controlled in tandem, e.g. multiplier-accumulator}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30101: {Special purpose registers}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/3889: {controlled by multiple instructions, e.g. MIMD, decoupled access or execute}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A processor unit for multiply and accumulate (“MAC”) operations is provided. The present invention may include the processor unit having a plurality of MAC units for performing a set of MAC operations. The present invention may include each MAC unit having an execution unit and a one-write one-read (“1W/1R”) register file, where the 1W/1R register file may have at least one accumulator. The present invention may include the execution unit of each MAC unit being configured to perform a subset of MAC operations by computing a product of a set of values received from another register file of the processor unit and adding the computed product to the at least one accumulator. The present invention may include each MAC unit being configured to perform the respective subset of MAC operations in a single clock cycle.

## Claims

### Claim 1

A processor unit for multiply and accumulate (“MAC”) operations, the processor unit comprising:
a plurality of MAC units for performing a respective subset of MAC operations of a set of MAC operations, each MAC unit of the plurality of MAC units including a respective execution unit and a respective one-write one-read (“1W/1R”) ported register file, the respective 1W/1R ported register file having at least one accumulator; and
another register file, wherein the respective execution unit of each MAC unit is configured to perform the respective subset of MAC operations of the set of MAC operations by computing a product of a set of values received from the another register file and adding the computed product to a content of the at least one accumulator of the MAC unit, wherein each MAC unit is configured to perform the respective subset of MAC operations in a single clock cycle.

### Claim 2 (depends on 1)

The processor unit of claim 1, wherein each MAC unit of the plurality of MAC units includes an associated index, wherein each MAC unit is configured to perform the respective subset of MAC operations by executing a processor instruction referencing the associated index.

### Claim 3 (depends on 2)

The processor unit of claim 2, wherein the associated index includes an architected accumulator register index of the at least one accumulator of each MAC unit.

### Claim 4 (depends on 2)

The processor unit of claim 2, the wherein the at least one accumulator includes a respective accumulator element, wherein the computed product is added to a content of the respective accumulator element, wherein each MAC unit is configured to perform the respective subset of MAC operations of a set of MAC operations using the respective accumulator element of the at least one accumulator.

### Claim 5 (depends on 2)

The processor unit of claim 2, further comprising a dispatch/issue unit, the dispatch/issue unit being configured to process a plurality of processor instructions, select a MAC unit using the associated index, and send a respective set of processor instructions to the selected MAC unit for performing the set of MAC operations.

### Claim 6 (depends on 5)

The processor unit of claim 5, wherein the respective set of processor instructions further comprises at least one operand indicating the at least one accumulator as a source and target register of the respective set of processor instructions and indicating at least one further register, of the another register file, comprising a set of numbers.

### Claim 7 (depends on 5)

The processor unit of claim 5, wherein the dispatch/issue unit is associated with the MAC unit.

### Claim 8 (depends on 5)

The processor unit of claim 5, wherein the dispatch/issue unit is configured to dispatch the plurality of processor instructions in accordance with a single threaded (“ST”) mode such that the selected MAC unit receives the respective set of processor instructions from a single thread.

### Claim 9 (depends on 5)

The processor unit of claim 5, wherein the dispatch/issue unit is configured to dispatch the plurality of processor instructions in accordance with a two-way simultaneous multithreading (“SMT2”) mode such that the selected MAC unit receives the respective set of processor instructions from any one of two threads.

### Claim 10 (depends on 5)

The processor unit of claim 5, wherein the dispatch/issue unit is configured to dispatch the plurality of processor instructions in accordance with a four-way simultaneous multithreading (“SMT4”) mode such that each MAC unit of the plurality of MAC units receives the respective set of processor instructions from respective two threads.

### Claim 11 (depends on 1)

The processor unit of claim 1, wherein each MAC unit further comprises at least one multiplier for computing the product and at least one adder for performing the addition of the computed product.

### Claim 12 (depends on 1)

The processor unit of claim 1, being configured to perform further sets of MAC operations, wherein all the sets of MAC operations provide all elements of an output matrix, the output matrix being a result of a matrix convolution on an input matrix.

### Claim 13

A method for performing multiply and accumulate (“MAC”) operations comprising:
receiving, at a multiplier of a MAC unit, a set of values from a one-write one-read (“1W/1R”) ported register file, wherein the 1W/1R ported register file includes an accumulator;
calculating, using the multiplier, a product of the received set of values;
reading a current content of the accumulator;
calculating, using an adder of the MAC unit, a sum of the read current content of the accumulator and the calculated product of the received set of value; and
writing the calculated sum to the accumulator of the MAC unit.

### Claim 14

A computer program product for performing multiply and accumulate (“MAC”) operations, the computer program product comprising:
one or more computer-readable storage media and program instructions collectively stored on the one or more computer-readable storage media, the program instructions comprising:
program instructions to receive, at a multiplier of a MAC unit, a set of values from a one-write one-read (“1W/1R”) ported register file, wherein the 1W/1R ported register file includes an accumulator;
program instructions to calculate, using the multiplier, a product of the received set of values;
program instructions to read a current content of the accumulator;
program instructions to calculate, using an adder of the MAC unit, a sum of the read current content of the accumulator and the calculated product of the received set of value; and
program instructions to write the calculated sum to the accumulator of the MAC unit.

### Claim 15

A multiply and accumulate (“MAC”) unit comprising:
an execution unit; and
a one-write one-read (“1W/1R”) ported register file, the 1W/1R ported register file including at least one accumulator, the execution unit of the MAC unit being configured to perform a MAC operation by computing a product and adding the product to a content of the at least one accumulator of the MAC unit.

### Claim 16 (depends on 15)

The MAC unit of claim 15, further comprising: an architected accumulator register index, wherein the MAC unit is configured to perform the MAC operation by executing a processor instruction referencing the architected accumulator register index.

### Claim 17 (depends on 15)

The MAC unit of claim 15, wherein the execution unit of the MAC unit is configured to consecutively perform a plurality of MAC operations using a same accumulator for accumulating the product of each MAC operation of the plurality of MAC operations.

### Claim 18 (depends on 15)

The MAC unit of claim 15, wherein the at least one accumulator further comprises: a plurality of accumulators, wherein the MAC unit is configured to perform a plurality of MAC operations in parallel using a respective accumulator of the plurality of accumulators.

### Claim 19 (depends on 15)

The MAC unit of claim 15, further comprising:
at least one multiplier for performing the computation of the product; and
at least one adder for performing an addition of the product.

### Claim 20 (depends on 15)

The MAC unit of claim 15, wherein the at least one accumulator further comprises a plurality of accumulator elements, the MAC unit comprising a plurality of multipliers and an adder, wherein the MAC unit is configured to perform a plurality of MAC operations in parallel using respective accumulator elements of the plurality of accumulator elements and respective multipliers of the plurality of multipliers.
