# US 2023/0267313 A1 · Electronic device for performing convolution calculation and operation method therefor

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

- Number: US 2023/0267313 A1
- Document ID: US20230267313A1
- Status: Published application
- Kind: A1
- Application number: 18/142,170
- Filed: 2023-05-02
- Published: 2023-08-24
- Earliest claimed: 2020-11-05
- Assignees: Samsung Electronics Co., Ltd.
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Minho KIM; Wooseok KANG; Eunkyoung PARK
- Web page: https://patentgrep.com/patent/US20230267313A1

## CPC

- G06N 3/047: Probabilistic or stochastic networks
- G06N 3/063: using electronic means
- G06F 7/544: for evaluating functions by calculation {(G06F7/4824 takes precedence)}
- G06F 17/15: Correlation function computation {including computation of convolution operations (arithmetic circuits for sum of products per se, e.g. multiply-accumulators G06F7/5443; digital filters, e.g. FIR, IIR, adaptive filters H03H17/00)}
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An electronic device and method thereof. The electronic device includes an input feature map transformer configured to transform an input feature map (IFM) to a Winograd domain, a weight kernel transformer configured to transform a weight kernel to the Winograd domain, a transformation data processor configured to map, a plurality of types of multiply-accumulate (MAC) units included in a computation unit, to a plurality of feature groups grouping feature values in a plurality of channels of the transformed input feature map and a plurality of weight value groups grouping weight values in a plurality of channels of the transformed weight kernel, a computation data processor configured to collect MAC operation results from the computation unit, and an inverse transformer configured to perform an inverse Winograd transform on a result output from the computation data processor to thereby generate an output feature map (OFM) useable for performing a convolution operation.

## Claims

### Claim 1

An electronic device, comprising:
an input feature map transformer configured to transform an input feature map (IFM) to a Winograd domain;
a weight kernel transformer configured to transform a weight kernel to the Winograd domain;
a transformation data processor configured to:
map, a plurality of types of multiply-accumulate (MAC) units included in a computation unit, to a plurality of feature groups created by grouping feature values in a plurality of channels of the transformed input feature map and a plurality of weight value groups created by grouping weight values in a plurality of channels of the transformed weight kernel, the plurality of types of MAC units being configured to perform a MAC operation between a weight value group of the plurality of weight value groups and a feature value group of the plurality of feature groups;
a computation data processor configured to collect MAC operation results from the computation unit; and
an inverse transformer configured to perform an inverse Winograd transform on a result output according to the collected MAC operation results from the computation data processor to thereby generate an output feature map (OFM) useable for performing a convolution operation.

### Claim 2 (depends on 1)

The electronic device of claim 1, wherein
the computation unit comprises:
at least one type of MAC unit from among a first type MAC unit, a second type MAC unit, and a third type MAC unit included in the plurality of types of MAC units, and
the transformation data processor is configured to:
map the plurality of feature value groups and the plurality of weight value groups to the at least one type of MAC unit from among the first type MAC unit, the second type MAC unit, and the third type MAC unit included in the plurality of types of MAC units.

### Claim 3 (depends on 2)

The electronic device of claim 2, wherein the transformation data processor is configured to map, based on a pre-generated mapping table, the plurality of feature value groups and the plurality of weight value groups to the at least one type of MAC unit from among the first type MAC unit, the second type MAC unit, and the third type MAC unit included in the plurality of types of MAC units.

### Claim 4 (depends on 3)

The electronic device of claim 3, wherein
the first type MAC unit comprises:
a plurality of multiplier units; and
an accumulator configured to accumulate and add outputs respectively from the plurality of multiplier units, and
each of the plurality of multiplier units comprises:
a first shifter configured to receive a first fixed-point number and perform a right shift operation;
a second shifter configured to receive a second fixed-point number and perform a right shift operation;
a multiplier configured to receive an output of the first shifter and an output of the second shifter and perform a multiplication operation between the output of the first shifter and the output of the second shifter; and
a restoration shifter configured to receive an output of the multiplier and restore a bit length by performing a left shift operation on the output of the multiplier.

### Claim 5 (depends on 4)

The electronic device of claim 4, wherein
the first shifter included in each of the plurality of multiplier units is configured to:
when a bit length of the first fixed-point number exceeds a preset first bit length, reduce the bit length of the first fixed-point number by shifting the first fixed-point number to the right by a bit length in excess of the preset first bit length,
the second shifter included in each of the plurality of multiplier units is configured to:
when a bit length of the second fixed-point number exceeds a preset second bit length, reduce the bit length of the second fixed-point number by shifting the second fixed-point number to the right by a bit length in excess of the preset second bit length, and
the restoration shifter included in each of the plurality of multiplier units is configured to:
restore the bit length of the first fixed-point number by shifting the output of the multiplier to the left by a sum of the bit length of the first fixed-point number by which the first shifter shifts the first fixed-point number to the right and the bit length of the second fixed-point number by which the second shifter shifts the second fixed-point number to the right.

### Claim 6 (depends on 5)

The electronic device of claim 5, wherein the first fixed-point number received by the first shifter and the second fixed-point number received by the second shifter are input by exchanging, based on a value of the first fixed-point number, the first bit length, a value of the second fixed-point number, and the second bit length, the value of the first fixed-point number and the value of the second fixed-point number.

### Claim 7 (depends on 3)

The electronic device of claim 3, wherein
the second type MAC unit comprises:
a plurality of multiplier units;
an accumulator configured to accumulate and add outputs respectively from the plurality of multiplier units; and
a second restoration shifter configured to receive an output of the accumulator and restore a bit length by performing a left shift operation on the output of the accumulator, and
each of the plurality of multiplier units comprises:
a first shifter configured to receive a first fixed-point number and perform a right shift operation;
a second shifter configured to receive a second fixed-point number and perform a right shift operation;
a multiplier configured to receive an output of the first shifter and an output of the second shifter and perform a multiplication operation between the output of the first shifter and the output of the second shifter; and
a first restoration shifter configured to receive an output of the multiplier and increase a bit length by performing a left shift operation on the output of the multiplier.

### Claim 8 (depends on 7)

The electronic device of claim 7, wherein
the first shifter included in each of the plurality of multiplier units is configured to:
reduce a bit length of the first fixed-point number by shifting the first fixed-point number to the right by a preset first bit length,
the second shifter included in each of the plurality of multiplier units is configured to:
when a bit length of the second fixed-point number exceeds a preset second bit length, reduce the bit length of the second fixed-point number by shifting the second fixed-point number to the right by a bit length in excess of the preset second bit length,
the first restoration shifter included in each of the plurality of multiplier units is configured to:
increase the bit length of the second fixed-point number by shifting the output of the multiplier to the left by the bit length of the second fixed-point number by which the second shifter shifts the second fixed-point number to the right, and
the second restoration shifter is configured to:
restore the bit length of the first fixed-point number by shifting the output of the accumulator to the left by the preset first bit length.

### Claim 9 (depends on 8)

The electronic device of claim 8, wherein the preset first bit length is determined for each of the plurality of weight value groups, based on a maximum value and a minimum value of weight values included in each of the plurality of weight value groups.

### Claim 10 (depends on 3)

The electronic device of claim 3, wherein
the third type MAC unit comprises:
a plurality of multiplier units;
an accumulator configured to accumulate and add outputs respectively from the plurality of multiplier units; and
a restoration shifter configured to receive an output of the accumulator and restore a bit length by performing a left shift operation, and
each of the plurality of multiplier units comprises:
a first shifter configured to receive a first fixed-point number and perform a right shift operation;
a second shifter configured to receive a second fixed-point number and perform a right shift operation; and
a multiplier configured to receive an output of the first shifter and an output of the second shifter and perform a multiplication operation between the output of the first shifter and the output of the second shifter.

### Claim 11 (depends on 10)

The electronic device of claim 10, wherein
the first shifter included in each of the plurality of multiplier units is configured to:
reduce a bit length of the first fixed-point number by shifting the first fixed-point number to the right by a preset first bit length,
the second shifter included in each of the plurality of multiplier units is configured to:
reduce a bit length of the second fixed-point number by shifting the second fixed-point number to the right by a preset second bit length, and
the restoration shifter is configured to:
restore the bit length by shifting the output of the accumulator to the left by a sum of the first bit length and the second bit length.

### Claim 12 (depends on 11)

The electronic device of claim 11, wherein
the preset first bit length is determined for each of the plurality of weight value groups, based on a maximum value and a minimum value of weight values included in each of the plurality of weight value groups, and
the preset second bit length is determined for each of the plurality of feature value groups, based on a maximum value and a minimum value of feature values included in each of the plurality of feature value groups.

### Claim 13 (depends on 11)

The electronic device of claim 11, wherein
the preset first bit length is determined for each of the plurality of weight value groups, based on a preset maximum threshold and a preset minimum threshold of weight values included in each of the plurality of weight value groups, and
the preset second bit length is determined for each of the plurality of feature value groups, based on a maximum value and a minimum value of feature values included in each of the plurality of feature value groups.

### Claim 14

An operation method of an electronic device, comprising:
transforming an input feature map (IFM) to a Winograd domain;
transforming a weight kernel to the Winograd domain;
creating a plurality of feature value groups by grouping feature values at same coordinates in a plurality of channels of the transformed input feature map;
creating a plurality of weight value groups by grouping weight values at same coordinates in a plurality of channels of the transformed weight kernel;
mapping the plurality of feature value groups and the plurality of weight value groups to a plurality of types of multiply-accumulate (MAC) units included in the electronic device;
outputting a MAC operation value by performing, a MAC operation, for the plurality of feature value groups with the plurality of weight value groups, respectively;
generating a transformed output feature map by collecting MAC operation results according to the outputting of the output MAC operation value; and
performing an inverse Winograd transform on the generated transformed output feature map to thereby generate an output feature map (OFM) useable for performing a convolution operation.

### Claim 15

A non-transitory computer-readable recording medium having recorded thereon a program to execute a method by an electronic device, the method comprising:
transforming an input feature map (IFM) to a Winograd domain;
transforming a weight kernel to the Winograd domain;
grouping feature values at same coordinates in a plurality of channels of the transformed input feature map to create a plurality of feature value groups;
grouping weight values at same coordinates in a plurality of channels of the transformed weight kernel to create a plurality of weight value groups;
mapping the plurality of feature value groups and the plurality of weight value groups to a plurality of types of multiply-accumulate (MAC) units included in the electronic device;
outputting a MAC operation value by performing, a MAC operation, for the plurality of feature value groups, with the plurality of weight value groups, respectively;
generating a transformed output feature map by collecting MAC operation results according to the outputting of the output MAC operation value; and
performing an inverse Winograd transform on the generated transformed output feature map to thereby generate an output feature map (OFM) useable for performing a convolution operation.
