Operation accelerator and compression method
AssigneeHuawei Technologies Co., Ltd.
InventorsBaoqing Liu, Hu Liu, Qinglong Chen
Life of this patent
Estimating the term…
Abstract
The present disclosure discloses example operation accelerators and compression methods. One example operation accelerator performs operations, including storing, in a first buffer, first input data. In a second buffer, weight data can be stored. A computation result is obtained by performing matrix multiplication on the first input data and the weight data by an operation circuit connected to the input buffer and the weight buffer. The computation result is compressed by a compression module to obtain compressed data. The compressed data can be stored into a memory outside the operation accelerator by a direct memory access controller (DMAC) connected to the compression module.
Claims20
An operation accelerator, comprising:
- a first buffer, configured to store first input data;
- a second buffer, configured to store weight data;
- an operation circuit connected to the first buffer and the second buffer, configured to perform matrix multiplication on the first input data and the weight data, to obtain a computation result;
- a compression module, configured to compress the computation result to obtain compressed data;
- a third buffer, configured to store a control instruction, wherein the control instruction instructs whether to compress the computation result;
- a controller connected to the third buffer and configured to obtain the control instruction from the third buffer, and when the control instruction comprises instructions to compress the computation result, control the compression module to compress the computation result to obtain the compressed data;
- and
- a direct memory access controller (DMAC) connected to the compression module, configured to store the compressed data in a memory outside the operation accelerator.
A compression method, wherein the compression method is applied to an operation accelerator, the operation accelerator comprises a first buffer and a second buffer, and the method comprises:
- obtaining a computation result by performing matrix multiplication on first input data obtained from the first buffer and weight data obtained from the second buffer;
- obtaining a control instruction, wherein the control instruction instructs whether to compress the computation result;
- when the control instruction comprises instructions to compress the computation result, obtaining compressed data by compressing the computation result;
- and
- storing the compressed data in a memory outside the operation accelerator.
A compression method, wherein the compression method is applied to an operation accelerator, the operation accelerator comprises a first buffer and a second buffer, and the method comprises:
- obtaining a computation result by performing matrix multiplication on first input data obtained from the first buffer and weight data obtained from the second buffer;
- obtaining a control instruction, wherein the control instruction is used to instruct whether to compress and decompress the computation result;
- when the control instruction comprises instructions to compress the computation result, obtaining compressed data by compressing the computation result and storing the compressed data in a memory outside the operation accelerator;
- and
- when the control instruction skips instructing to compress the computation result, storing the computation result in the memory outside the operation accelerator.
An operation accelerator, comprising:
- one or more processors;
- and
- a non-transitory computer readable medium storing a program to be executed by the one or more processors, wherein the program comprises instructions that cause the one or more processors to perform operations comprising:
- storing, in a first buffer, first input data;
- storing, in a second buffer, weight data;
- obtaining a computation result by performing matrix multiplication on the first input data and the weight data;
- storing, in a third buffer, a control instruction, wherein the control instruction instructs whether to compress the computation result;
- obtaining the control instruction from the third buffer;
- when the control instruction comprises instructions to compress the computation result, obtaining compressed data by compressing the computation result;
- and
- storing the compressed data in a memory outside the operation accelerator.
Dependencies are inferred from the claim text.