# US 2024/0005213 A1 · System and method for off-chip data compression and decompression for machine learning networks

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

- Number: US 2024/0005213 A1
- Document ID: US20240005213A1
- Status: Published application
- Kind: A1
- Application number: 18/467,157
- Filed: 2023-09-14
- Published: 2024-01-04
- Earliest claimed: 2022-01-19
- Assignees: The Governing Council of the University of Toronto
- Applicants: The Governing Council of the University of Toronto
- Inventors: Alberto DELMAS LASCORZ; Andreas MOSHOVOS
- Web page: https://patentgrep.com/patent/US20240005213A1

## CPC

- G06N 20/00: Machine learning
- H03M 7/4006: {Conversion to or from arithmetic code}
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/063: using electronic means
- H03M 7/30: Compression (speech analysis-synthesis for redundancy reduction G10L19/00; for image communication H04N); Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- H03M 7/3079: {Context modeling}
- H03M 7/6029: {Pipelining}
- H03M 7/6035: {Handling of unkown probabilities}
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

There is provided a system and method for compression and decompression of a data stream used by machine learning networks. The method including: encoding each value in the data stream, including: determining a mapping to one of a plurality of non-overlapping ranges, each value encoded as a symbol representative of the range and a corresponding offset; and arithmetically coding the symbol using a probability count; storing a compressed data stream including the arithmetically coded symbols and the corresponding offsets; and decoding the compressed data stream with arithmetic decoding using the probability count, the arithmetic decoded symbols use the offset bits to arrive at a decoded data stream; and communicating the decoded data stream for use by the machine learning networks.

## Claims

### Claim 1

A method for compression and decompression of a data stream used by machine learning networks, the data stream comprising weight data or activation data used by the machine learning networks, the method comprising:
receiving the data stream to be encoded;
encoding each value in the data stream, comprising:
determining a mapping to one of a plurality of non-overlapping ranges, each value encoded as a symbol representative of the range and a corresponding offset; and
arithmetically coding the symbol using a probability count;
storing a compressed data stream comprising the arithmetically coded symbols and the corresponding offsets; and
decoding the compressed data stream with arithmetic decoding using the probability count, the arithmetic decoded symbols are used with the offset bits to arrive at a decoded data stream; and
communicating the decoded data stream for use by the machine learning networks.

### Claim 2 (depends on 1)

The method of claim 1, wherein the probability count is represented by a range of values representing an approximate frequency of occurrence for the symbol in an input sample.

### Claim 3 (depends on 2)

The method of claim 2, wherein the probability counts are initialized with a uniform value distribution.

### Claim 4 (depends on 2)

The method of claim 2, wherein the probability count in the input sample is used to determine the non-overlapping ranges.

### Claim 5 (depends on 1)

The method of claim 1, wherein encoding each value in the data stream comprises encoding multiple values simultaneously using pipelining, and wherein decoding the compressed data stream comprises decoding multiple values simultaneously using pipelining.

### Claim 6 (depends on 5)

The method of claim 5, wherein the data stream comprises a tensor and wherein the method further comprises splitting the tensor into several subtensors, each subtensor encoded and decoded in a respective pipeline.

### Claim 7 (depends on 1)

The method of claim 1, further comprising encoding the corresponding offsets using two-level encoding.

### Claim 8 (depends on 1)

The method of claim 1, wherein each of the non-overlapping ranges is defined by a respective minimum value, maximum value, and offset length.

### Claim 9 (depends on 8)

The method of claim 8, wherein the non-overlapping ranges are ordered and the maximum value of each range is the minimum value minus one of the next range in the order.

### Claim 10 (depends on 1)

The method of claim 1, wherein the symbol comprises a minimum value for the mapped range, and wherein the corresponding offset comprises the minimum value for the mapped range subtracted from the value from the data stream.

### Claim 11 (depends on 1)

The method of claim 1, wherein encoding each value in the data stream comprises using profiling to determine the probability counts for activation data.

### Claim 12

A system for compression and decompression of a data stream used by machine learning networks, the data stream comprising weight data or activation data used by the machine learning networks, the system comprising:
one or more encoders to receive the data stream to be encoded and encode each value in the data stream, the encoding comprising:
determining a mapping to one of a plurality of non-overlapping ranges, each value encoded as a symbol representative of the range and a corresponding offset; and
arithmetically coding the symbol using a probability count;
a memory storage for storing a compressed data stream comprising the arithmetically coded symbols and the corresponding offsets; and
one or more decoders to decode the compressed data stream with arithmetic decoding using the probability count, the decoder uses the arithmetic decoded symbols and the offset bits to arrive at a decoded data stream, and to communicate the decoded data stream for use by the machine learning networks.

### Claim 13 (depends on 12)

The system of claim 12, wherein the probability count is represented by a range of values representing an approximate frequency of occurrence for the symbol in an input sample.

### Claim 14 (depends on 13)

The system of claim 13, wherein the probability counts are initialized with a uniform value distribution.

### Claim 15 (depends on 13)

The system of claim 13, wherein probability count in the input sample is used to determine the non-overlapping ranges.

### Claim 16 (depends on 12)

The system of claim 12, wherein multiple values in the data stream are encoded simultaneously by each of a plurality of the encoders, and wherein multiple values in the compressed data stream are decoded simultaneously by each of a plurality of the decoders.

### Claim 17 (depends on 16)

The system of claim 16, wherein the data stream comprises a tensor and wherein the method further comprises splitting the tensor into several subtensors, each subtensor encoded by a separate encoder and decoded by a separate decoder.

### Claim 18 (depends on 12)

The system of claim 12, wherein the encoder further encodes the corresponding offsets using two-level encoding.

### Claim 19 (depends on 12)

The system of claim 12, wherein each of the non-overlapping ranges is defined by a respective minimum value, maximum value, and offset length.

### Claim 20 (depends on 19)

The system of claim 19, wherein the non-overlapping ranges are ordered and the maximum value of each range is the minimum value minus one of the next range in the order.

### Claim 21 (depends on 12)

The system of claim 12, wherein the symbol comprises a minimum value for the mapped range, and wherein the corresponding offset comprises the minimum value for the mapped range subtracted from the value from the data stream.

### Claim 22 (depends on 12)

The system of claim 12, wherein the encoder uses profiling to determine the probability counts for activation data.
