The invention discloses a method for accelerating a
convolutional neural network by using matrix sparsity on a multi-GPU platform, and the method comprises the following steps: determining a data scale F and a GPU number G, and starting an MGPUSimm kernel; the input data is loaded to a multi-level cache from a global memory of the MGPUSimm; non-zero value
mask traversal is carried out on input data, and a
mask graph set is obtained through GPU parallel;
convolution calculation is carried out through the
mask graph, and zero value
data input is ignored, so that calculation is reduced; if a
pooling layer exists behind the convolutional layer, subsequent
pooling layer calculation is completed; and completing calculation of the remaining
layers and outputting a result to a global memory. The invention aims to provide a method for accelerating a
convolutional neural network by using matrix sparsity on a multi-GPU platform, and aims to solve the current situations that a
sparse matrix based on a CPU or a single GPU platform is low in calculation efficiency in convolutional layer calculation of the
convolutional neural network and the overall calculation time of the convolutional neural network is relatively long. The method comprises the following steps: adding a mask to remove zero value calculation so as to reduce the calculation amount, and then inversely deducing an input data position from a result mask to ignore the influence of a 0 value in a
sparse matrix on the calculation of a convolutional layer; and meanwhile, multiple GPUs are used in the steps of forming a mask image set, calculating a convolutional layer, calculating a
pooling layer and the like, so that the overall calculation efficiency of the convolutional neural network is improved in parallel.