Processing device and related products
AssigneeCambricon Technologies Corporation Limited
InventorsShaoli Liu, Tianshi Chen, Bingrui Wang, Yao Zhang
Life of this patent
Estimating the term…
Abstract
A convolution operation method and a processing device for performing the same are provided. The method is performed by a processing device. The processing device includes a main processing circuit and a plurality of basic processing circuits. The basic processing circuits are configured to perform convolution operation in parallel. The technical solutions disclosed by the present disclosure can provide short operation time and low energy consumption.
Claims21
A convolution operation method, performed by a processing device, the convolution operation method comprising:
- receiving, by the processing device, input data and weight data, wherein:
- the input data comprise a plurality of three-dimensional samples in a neural network, each three-dimensional sample including first and second dimensions defining a two-dimensional plane in which an operation window slides for performing a convolution operation and a third dimension defining a depth of the operation window, wherein data in the third dimension are not stored adjacently and consecutively in a memory device of the processing device;
- and
- the weight data comprise a plurality of three-dimensional convolution kernels, each three-dimensional convolution kernel including first and second dimensions defining a two-dimensional weight matrix and a third dimension defining a quantity of the two-dimensional weight matrices in that three-dimensional convolution kernel, wherein a size of each three-dimensional convolution kernel defines a size of the operation window;
- rearranging, by the processing device, an order of dimensions of the input data such that data in the third dimension are stored adjacently and consecutively in the memory device;
- and
- performing, by the processing device, the convolution operation on the rearranged input data and the weight data by performing, in parallel, multiple partial convolution operations using the operation window sliding to one or more positions within the rearranged input data and a corresponding three-dimensional convolution kernel from the weight data, wherein each of the multiple partial convolution operations comprises at least one inner-product operation.
A processing device, comprising a main processing circuit and a plurality of basic processing circuits, wherein:
- the main processing circuit is configured to:
- receive input data and weight data, wherein:
- the input data comprise a plurality of three-dimensional samples in a neural network, each three-dimensional sample including first and second dimensions defining a two-dimensional plane in which an operation window slides for performing a convolution operation and a third dimension defining a depth of the operation window, wherein data in the third dimension are not stored adjacently and consecutively in a memory device of the main processing circuit;
- and
- the weight data comprise a plurality of three-dimensional convolution kernels, each three-dimensional convolution kernel including first and second dimensions defining a two-dimensional weight matrix and a third dimension defining a quantity of the two-dimensional weight matrices in that three-dimensional convolution kernel, wherein a size of each three-dimensional convolution kernel defines a size of the operation window;
- and
- rearrange an order of dimensions of the input data such that data in the third dimension are stored adjacently and consecutively in the memory device;
- and
- the main processing circuit and the plurality of basic processing circuits are configured to collaboratively perform the convolution operation on the rearranged input data and the weight data by performing, in parallel, multiple partial convolution operations using the operation window sliding to one or more positions within the rearranged input data and a corresponding three-dimensional convolution kernel from the weight data, wherein each of the multiple partial convolution operations comprises at least one inner-product operation.
Dependencies are inferred from the claim text.