The embodiment of the invention provides a cache use optimization method and device, a storage medium and a program product, and relates to the technical field of
artificial intelligence, and the method comprises the steps: segmenting an input
tensor into a plurality of sub-tensors according to the shape of the input
tensor and the number of calculation units; and for each sub-
tensor, a plurality of candidate strategy groups are selected based on the shape of the sub-tensor, and each candidate strategy group comprises a cache use strategy and a pipeline configuration strategy. And calculating corresponding predicted
processing performance when
convolution calculation is performed on the sub-tensor by adopting each candidate strategy group, and selecting an optimal target strategy group from the plurality of candidate strategy groups based on a plurality of obtained predicted
processing performance. In this way, for input tensors of different shapes, the optimal cache use strategy and the optimal pipeline configuration strategy can be selected for
convolution calculation, the efficiency of
convolution calculation is improved, cache resources are fully utilized, and the method can be generalized to various scenes, so that the calculation performance of a convolution operator in various scenes is optimized.