US 11,657,258 B2
Neural network calculation apparatus and method
Yao Zhang, Beijing (CN); Shaoli Liu, Beijing (CN); Bingrui Wang, Beijing (CN); and Xiaofu Meng, Bejing (CN)
Assigned to CAMBRICON TECHNOLOGIES CORPORATION LIMITED, Beijing (CN)
Filed by Cambricon Technologies Corporation Limited, Beijing (CN)
Filed on Nov. 27, 2019, as Appl. No. 16/697,196.
Application 16/697,196 is a continuation of application No. 16/697,189, filed on Nov. 27, 2019.
Application 16/697,189 is a continuation in part of application No. PCT/CN2018/120047, filed on Dec. 10, 2018.
Claims priority of application No. 201711315639.9 (CN), filed on Dec. 11, 2017.
Prior Publication US 2020/0097834 A1, Mar. 26, 2020
This patent is subject to a terminal disclaimer.
Int. Cl. G06N 3/063 (2006.01); G06N 3/04 (2006.01); G06F 9/22 (2006.01); G06N 3/10 (2006.01); G06N 3/08 (2006.01); G06N 3/082 (2023.01); G06N 3/045 (2023.01)
CPC G06N 3/063 (2013.01) [G06F 9/223 (2013.01); G06N 3/04 (2013.01); G06N 3/045 (2023.01); G06N 3/082 (2013.01); G06N 3/10 (2013.01)] 18 Claims
OG exemplary drawing
 
1. A neural network operation module, comprising
a storage circuit configured to store input data, a neural network instruction, and an operation result, wherein
a mapping circuit configured to process the input data after receiving the input data to obtain processed input data, wherein the processed input data includes a processed input neuron and a processed weight;
the input data includes first input data and second input data, the neural network operation module further includes a first input caching circuit and a second input caching circuit between the direct memory access circuit and the mapping circuit, wherein
the first input caching circuit is configured to cache first input data obtained from the storage circuit by the direct memory access circuit, wherein the first input data includes at least one input neuron or at least one weight, and
the second input caching circuit is configured to cache second cache data obtained from the storage circuit by the direct memory access circuit, wherein the second cache data includes at least one input neuron or at least one weight, and the second cache data is inconsistent with the first cache data;
an instruction control circuit configured to obtain the neural network instruction from an instruction caching circuit and decode the neural network instruction into a microinstruction executed by an operation circuit;
the operation circuit configured to obtain the processed input neuron and the processed weight and then perform an artificial neural network operation on the processed input neuron and the processed weight according to the microinstruction to obtain the operation result;
an output caching circuit configured to cache the operation result; and
a direct memory access circuit configured to read/write data between the storage circuit and an instruction caching circuit, the mapping circuit, or the output caching circuit,
wherein before processing the input data, the mapping circuit is further configured to:
group the at least one input neuron to obtain M groups of the input neurons, wherein the M is an integer greater than or equal to 1,
determine whether each group of the input neurons in the M groups of the input neurons satisfies a first preset condition, wherein the first preset condition includes that the count of the input neuron whose absolute value is smaller than or equal to the third threshold in a group of the input neurons is smaller than or equal to the fourth threshold,
when any group of the input neurons in the M groups of the input neurons does not satisfy the first preset condition, delete the group of the input neurons,
group the at least one weight to obtain N groups of the weights, wherein the N is an integer greater than or equal to 1,
determine whether each group of the weights in the N groups of the weights satisfies a second preset condition, wherein the second preset condition includes that the count of the weight whose absolute value is smaller than or equal to the fifth threshold in a group of the weights is smaller than or equal to the sixth threshold, and
when any group of the weights in the N groups of the weights does not satisfy the second preset condition, delete the group of the weights.