US 12,423,376 B2
Convolution operation method, convolution operation apparatus, electronic device and storage medium
Shuai Wang, Beijing (CN); Tao Li, Beijing (CN); Hangjian Yuan, Beijing (CN); Yunfeng Shi, Beijing (CN); and Jian Wang, Beijing (CN)
Assigned to Beijing Youzhuju Network Technology Co., Ltd., Beijing (CN)
Filed by Beijing Youzhuju Network Technology Co., Ltd., Beijing (CN)
Filed on Nov. 27, 2024, as Appl. No. 18/963,209.
Application 18/963,209 is a continuation of application No. PCT/CN2023/096983, filed on May 30, 2023.
Claims priority of application No. 202210610935.6 (CN), filed on May 31, 2022.
Prior Publication US 2025/0086249 A1, Mar. 13, 2025
Int. Cl. G06F 17/15 (2006.01)
CPC G06F 17/15 (2013.01) 20 Claims
OG exemplary drawing
 
1. A convolution operation method, comprising:
determining an operation convolution kernel, wherein the operation convolution kernel is obtained based on an initial convolution kernel, the initial convolution kernel is expressed as [R, S, C, K], the operation convolution kernel is expressed as [1, 1, (C×R×S), K], and R, S, C, and K are integers greater than 0;
adjusting a layout of input data based on a number of channels of the operation convolution kernel to obtain target data, wherein a size and a number of channels of the target data are different from a size and a number of channels of the input data, and the number of channels of the target data is equal to the number of channels of the operation convolution kernel; and
performing a convolution operation based on the target data and the operation convolution kernel to obtain a convolution operation result, wherein the convolution operation result of the target data and the operation convolution kernel is equal to a convolution operation result of the input data and the initial convolution kernel,
wherein the adjusting the layout of the input data based on the number of channels of the operation convolution kernel to obtain the target data comprises:
storing the input data in a static memory in units of rows, wherein each row of the input data is stored in corresponding N entries in the static memory, N being an integer greater than 0,
performing padding on the input data stored in the static memory to obtain extended data, wherein the performing padding on the input data stored in the static memory comprises:
in the static memory, padding entries in front of and after a storage location corresponding to the input data with a first preset value to obtain first intermediate data, wherein the first intermediate data comprise the input data and the padded first preset value,
transmitting the first intermediate data to a vector calculation circuit that comprises a memory, and padding two ends of each row corresponding to the first intermediate data with a second preset value using a shift instruction and a padding instruction from the vector calculation circuit to obtain second intermediate data, wherein the second intermediate data comprise the first intermediate data and the padded second preset value, and
transmitting the second intermediate data to a corresponding storage location in the static memory to obtain the extended data, wherein the extended data is the same as the second intermediate data in content.