# US 2021/0240443 A1 · Computation method and apparatus exploiting weight sparsity

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

- Number: US 2021/0240443 A1
- Document ID: US20210240443A1
- Status: Published application
- Kind: A1
- Application number: 16/781,868
- Filed: 2020-02-04
- Published: 2021-08-05
- Earliest claimed: 2020-02-04
- Assignees: Macronix International Co., Ltd.
- Applicants: MACRONIX International Co., Ltd.
- Inventors: Hung-Sheng Chang; Han-Wen Hu; Hsiang-Pang Li; Tzu-Hsien Yang; I-Ching Tseng; Hsiang-Yun Cheng; Chia-Lin Yang
- Web page: https://patentgrep.com/patent/US20210240443A1

## CPC

- G06F 7/5443: {Sum of products (for applications thereof, see the relevant places, e.g. G06F17/10, H03H17/00)}
- G11C 11/54: using elements simulating biological cells, e.g. neuron
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/065: Analogue means
- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G11C 7/1006: {Data managing, e.g. manipulating data before writing or reading out, data bus switches or control circuits therefor}
- G11C 13/004: {Reading or sensing circuits or methods}
- G06N 3/045: Combinations of networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G11C: STATIC STORES (semiconductor memory devices H10B)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A computation method and a computation apparatus exploiting weight sparsity, adapted for a processor to perform multiply-and-accumulate operations on a memory including multiple input and output lines crossing each other. In the method, weights are mapped to the cells of each operation unit (OU) in the memory. The rows of the cells of each OU are compressed by removing at least one row of the cells each mapped with a weight of 0, and an index including values each indicating a distance between every two rows of the cells including at least one cell mapped with a non-zero weight for each OU is encoded. Inputs are inputted to the input lines corresponding to the rows of each OU excluding the rows of the cells with the weight of 0 according to the index and outputs are sensed from the output lines corresponding to the OU to compute a computation result.

## Claims

### Claim 1

A computation method exploiting weight sparsity, adapted for a processor to perform multiply-and-accumulate (MAC) operations on a memory having a crossbar architecture, wherein the memory comprises a plurality of input lines and a plurality of output lines crossing each other, a plurality of cells respectively disposed at intersections of the input lines and the output lines, and a plurality of sense amplifiers respectively connected to the output lines, the method comprising:
mapping a plurality of weights to the cells of each of a plurality of operation units (OUs) in the memory;
compressing the rows of the cells of each OU by removing at least one row of the cells each mapped with a weight of 0, and encoding an index including values each indicating a distance between every two rows of the cells including at least one cell mapped with a non-zero weight for each OU; and
inputting a plurality of inputs to the input lines corresponding to the rows of each OU excluding the rows of the cells with the weight of 0 according to the index and sensing a plurality of multiply-and-accumulate results from the output lines by the sense amplifiers corresponding to the OU to compute a computation result.

### Claim 2 (depends on 1)

The method of claim 1, wherein the step of inputting a plurality of inputs to the input lines corresponding to the rows of each OU excluding the rows of the cells with the weight of 0 according to the index comprises:
decoding the index to obtain the values indicating the distances; and
fetching the inputs to be inputted to the rows of the cells separated by the values and inputting the inputs into the corresponding input lines.

### Claim 3 (depends on 2)

The method of claim 2, wherein the step of inputting the inputs into the corresponding input lines comprises:
checking values of the inputs to be inputted; and
skipping the inputs with a value of 0 and inputting the inputs other than the skipped inputs into the corresponding input lines.

### Claim 4 (depends on 2)

The method of claim 2, wherein the step of inputting the inputs into the corresponding input lines comprises:
rearranging a computation order of the inputs according to a number of rows of each OU.

### Claim 5 (depends on 1)

The method of claim 1, wherein each OU comprises the cells disposed at intersections of at least two of the input lines and at least two of the output lines, and the corresponding sense amplifiers connected to the output lines.

### Claim 6 (depends on 1)

The method of claim 1, wherein the memory further comprises a digital-to-analog converter (DAC) to convert an input data into a plurality of input voltages serving as the inputs.

### Claim 7 (depends on 1)

The method of claim 1, wherein the step of sensing a plurality of multiply-and-accumulate results from the output lines by the sense amplifiers corresponding to the OU to compute a computation result comprises:
sensing the multiply-and-accumulate results, weighting the sensed multiply-and-accumulate results with corresponding exponential bases and then summing weighted results to obtain the computation results.

### Claim 8 (depends on 1)

The method of claim 1, wherein the memory comprises NAND flash, NOR flash, phase change memory (PCM), spin-transfer torque random-access memory (STT-RAM), resistive random-access memory (ReRAM), magnetoresistive random-access memory (MRAM), ferroelectric random-access memory (FRAM), static random-access memory (SRAM), or dynamic random-access memory (DRAM).

### Claim 9 (depends on 1)

The method of claim 1, wherein the input lines are wordlines of the memory and the output lines are bitlines of the memory, or the input lines are bitlines of the memory and the output lines are wordlines of the memory.

### Claim 10

A computation apparatus exploiting weight sparsity, comprising:
a memory having a crossbar architecture, comprising:
a plurality of input lines and a plurality of output lines crossing each other;
a plurality of cells respectively disposed at intersections of the input lines and the output lines; and
a plurality of sense amplifiers respectively connected to the output lines; and
a processor, coupled to the memory and configured to perform MAC operations comprising steps of:
mapping a plurality of weights to the cells of each of a plurality of operation units (OUs) in the memory;
compressing the rows of the cells of each OU by removing at least one row of the cells each mapped with a weight of 0, and encoding an index including values each indicating a distance between every two rows of the cells including at least one cell mapped with a non-zero weight for each OU; and
inputting a plurality of inputs to the input lines corresponding to the rows of each OU excluding the rows of the cells with the weight of 0 according to the index and sensing a plurality of multiply-and-accumulate results from the output lines by the sense amplifiers corresponding to the OU to compute a computation result.

### Claim 11 (depends on 10)

The computation apparatus of claim 10, wherein the processor decodes the index to obtain the values indicating the distances, fetches the inputs to be inputted to the rows of the cells separated by the values and inputs the inputs into the corresponding input lines.

### Claim 12 (depends on 11)

The computation apparatus of claim 11, wherein the processor checks values of the inputs to be inputted, skips the inputs with a value of 0, and inputs the inputs other than the skipped inputs into the corresponding input lines.

### Claim 13 (depends on 11)

The computation apparatus of claim 11, wherein the processor rearranges a computation order of the inputs according to a number of rows of each OU.

### Claim 14 (depends on 10)

The computation apparatus of claim 10, wherein each OU comprises the cells disposed at intersections of at least two of the input lines and at least two of the output lines, and the corresponding sense amplifiers connected to the output lines.

### Claim 15 (depends on 10)

The computation apparatus of claim 10, wherein the memory further comprises a digital-to-analog converter (DAC) to convert an input data into a plurality of input voltages serving as the inputs.

### Claim 16 (depends on 10)

The computation apparatus of claim 10, wherein the processor senses the multiply-and-accumulate results, weights the sensed multiply-and-accumulate results with corresponding exponential bases and then sums weighted results to obtain the computation results.

### Claim 17 (depends on 10)

The computation apparatus of claim 10, wherein the memory comprises NAND flash, NOR flash, PCM, STT-RAM, ReRAM, MRAM, FRAM, SRAM, or DRAM.

### Claim 18 (depends on 10)

The computation apparatus of claim 10, wherein the input lines are wordlines of the memory and the output lines are bitlines of the memory, or the input lines are bitlines of the memory and the output lines are wordlines of the memory.
