Convolution operator shape parameter processing method, device, equipment, medium and product

By automatically generating and selecting candidate combinations of convolution operator shape parameters, the problem of manual parameter adjustment is solved, and efficient parameter optimization is achieved.

CN119202495BActive Publication Date: 2025-08-15BEIJING QINGCHENG JIZHI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411211046.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-08-15
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

During image processing, manual parameter adjustment takes a long time and low parameter adjustment efficiency, especially due to the large number of convolution operators and large parameter search space.

Method used

By determining the initial parameter value combination and parameter search space of the convolution operator, multiple groups of candidate parameter value combinations are generated, and the operator can automatically select the parameter value combination that consumes the shortest time to perform, and automatically adjust the parameter.

Benefits of technology

The efficiency of parameter tuning is improved, manual intervention and time cost is reduced, and optimization accuracy and efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202495B_ABST
    Figure CN119202495B_ABST
Patent Text Reader

Abstract

The present application discloses a convolution operator shape parameter processing method, apparatus, device, medium, and product, relating to the field of image processing technology, including: determining each convolution operator shape parameter of a convolution operator in an image processing project to be optimized; determining an initial parameter value combination for each convolution operator shape parameter, and determining a parameter search space for each convolution operator shape parameter based on the initial parameter value combination; determining multiple sets of candidate parameter value combinations for each convolution operator shape parameter based on the parameter search space for each convolution operator shape parameter, running each set of candidate parameter value combinations in the image processing project to be optimized, and determining the operator execution time of the convolution operator under each set of candidate parameter value combinations; and assigning the candidate parameter value combination with the shortest operator execution time among each set of candidate parameter value combinations to each convolution operator shape parameter. The present application improves the tuning efficiency of the operator shape parameter tuning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, apparatus, device, medium and product for processing shape parameters of a convolution operator. Background Art

[0002] GPU (Graphics Processing Unit) acceleration libraries are a series of libraries designed to perform general-purpose computing tasks on graphics processing units (GPUs). For example, the CUTLASS library is a high-performance CUDA (Compute Unified Device Architecture) C++ library designed by NVIDIA to accelerate matrix multiplication and convolution operations in deep learning. When using GPU acceleration libraries for image processing, the shape parameters of the convolution operators used in image processing can be adjusted to optimize the convolution operators, thereby improving computational efficiency. Currently, this adjustment is primarily done manually. However, due to the large number of convolution operators in image processing and the large search space for the shape parameters of each operator, manual parameter adjustment is time-consuming and inefficient.

[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of this application is to provide a method, device, equipment, medium and product for processing the shape parameters of a convolution operator, aiming to solve the technical problems of time-consuming and low efficiency of manual parameter adjustment.

[0005] To achieve the above objectives, the present application proposes a method for processing convolution operator shape parameters, the method comprising:

[0006] Determine the shape parameters of each convolution operator in the image processing project to be optimized;

[0007] Determining an initial parameter value combination of each convolution operator shape parameter, and determining a parameter search space for each convolution operator shape parameter based on the initial parameter value combination;

[0008] Determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on a parameter search space of each convolution operator shape parameter, running each group of the candidate parameter value combinations in the image processing project to be optimized, and determining an operator execution time of the convolution operator under each group of the candidate parameter value combinations;

[0009] The candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations is assigned to each convolution operator shape parameter.

[0010] In one embodiment, the step of determining the shape parameters of the image processing project to be optimized includes:

[0011] Deploying the graphics processing project to be optimized on an image processor, and performing operator fusion on the image processing project to be optimized to obtain a fusion operator;

[0012] Determine the image input size and the image output size of the image processing project to be optimized, determine a convolution operator from each of the fusion operators, and determine a convolution operator shape parameter of the convolution operator based on the image input size and the image output size.

[0013] In one embodiment, the step of determining the initial parameter value combination of each convolution operator shape parameter includes:

[0014] Determining initial parameter values corresponding to the shape parameters of each convolution operator based on the image input size and the image output size;

[0015] The initial parameter values of the shape parameters of the convolution operators are combined to obtain an initial parameter value combination.

[0016] In one embodiment, the step of determining the parameter search space of each convolution operator shape parameter based on the initial parameter value combination includes:

[0017] Obtaining the preset neighborhood range corresponding to each of the convolution operator shape parameters;

[0018] For any benchmark operator parameter of each convolution operator shape parameter, the parameter search space of the benchmark operator parameter is obtained with the initial parameter value corresponding to the benchmark operator parameter in the initial parameter value combination as the center and the preset neighborhood range corresponding to the benchmark operator parameter as the value range.

[0019] In one embodiment, before the step of determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on the respective parameter search spaces of the convolution operator shape parameters, the method further includes:

[0020] Determining the number of calls of each of the convolution operator shape parameters;

[0021] The step of determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on the respective parameter search spaces of the convolution operator shape parameters comprises:

[0022] The parameter search space of each convolution operator shape parameter is traversed in descending order of the number of calls to obtain multiple groups of candidate parameter value combinations of each convolution operator shape parameter.

[0023] In one embodiment, the step of running each group of the candidate parameter value combinations in the image processing project to be optimized and determining the operator execution time of the convolution operator under each group of the candidate parameter value combinations includes:

[0024] For any target parameter value combination in each set of candidate parameter value combinations, defining the target parameter value combination as an environment variable through a Shell script, retrieving the parameter variable through the environment variable in a compilation setting file of the image processing project to be optimized, and defining the parameter variable as a global macro through a compilation option;

[0025] At the to-be-optimized position of the source file of the image processing project to be optimized, the global macro is passed as a variable parameter in a function to obtain a target file;

[0026] Compile and run the image processing project to be optimized based on the target file, and determine the time consumed in compiling and running the image processing project to be optimized based on the target file, and use the time consumed in compiling and running as the operator execution time of the convolution operator under the target parameter value combination.

[0027] In addition, to achieve the above-mentioned purpose, the present application also proposes a convolution operator shape parameter processing device, the convolution operator shape parameter processing device comprising:

[0028] A first determining module is used to determine each convolution operator shape parameter of the convolution operator in the image processing project to be optimized;

[0029] a second determining module, configured to determine an initial parameter value combination of each convolution operator shape parameter, and determine a parameter search space of each convolution operator shape parameter based on the initial parameter value combination;

[0030] a third determining module, configured to determine, based on a parameter search space of each of the convolution operator shape parameters, a plurality of candidate parameter value combinations for each of the convolution operator shape parameters, run each of the candidate parameter value combinations in the image processing project to be optimized, and determine an operator execution time of the convolution operator under each of the candidate parameter value combinations;

[0031] An assignment module is used to assign the candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations to the shape parameters of each convolution operator.

[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a convolution operator shape parameter processing device, which includes: a memory, a processor, and a computer program stored on the memory and runnable on the processor, and the computer program is configured to implement the steps of the convolution operator shape parameter processing method as described above.

[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the convolution operator shape parameter processing method described above are implemented.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the convolution operator shape parameter processing method as described above.

[0035] In the present application, each convolution operator shape parameter of the convolution operator in the image processing project to be optimized is determined; an initial parameter value combination of each convolution operator shape parameter is determined, and a parameter search space of each convolution operator shape parameter is determined based on the initial parameter value combination; multiple groups of candidate parameter value combinations of each convolution operator shape parameter are determined based on the parameter search space of each convolution operator shape parameter, each group of the candidate parameter value combinations is run in the image processing project to be optimized, and the operator execution time of the convolution operator under each group of the candidate parameter value combinations is determined; and the candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations is assigned to each convolution operator shape parameter.

[0036] Compared with manual parameter tuning, this application defines an efficient search range by defining the search space for each parameter, avoiding blind search in the entire parameter space and improving the efficiency of parameter tuning. In addition, this application reduces manual intervention and the complexity and time cost of parameter tuning by automatically generating multiple sets of candidate parameter value combinations and selecting the parameter value combination with the shortest operator execution time, while improving the accuracy and efficiency of optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0039] Figure 1 A flowchart of the first embodiment of the method for processing the shape parameters of the convolution operator of this application is provided;

[0040] Figure 2 A flowchart of the second embodiment of the method for processing the shape parameters of the convolution operator of this application is provided;

[0041] Figure 3 A schematic diagram of a simplified flow chart of a method for processing shape parameters of a convolution operator provided in an embodiment of the present application;

[0042] Figure 4 Schematic diagram of the module structure of the convolution operator shape parameter processing device according to an embodiment of the present application;

[0043] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the convolution operator shape parameter processing method in the embodiment of the present application.

[0044] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0045] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0046] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0047] The main solution of the embodiment of the present application is: determining each convolution operator shape parameter of the convolution operator in the image processing project to be optimized; determining the initial parameter value combination of each convolution operator shape parameter, and determining the parameter search space of each convolution operator shape parameter based on the initial parameter value combination; determining multiple groups of candidate parameter value combinations of each convolution operator shape parameter based on the parameter search space of each convolution operator shape parameter, running each group of the candidate parameter value combination in the image processing project to be optimized, and determining the operator execution time of the convolution operator under each group of the candidate parameter value combination; assigning the candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combination to each convolution operator shape parameter.

[0048] The CUTLASS library is a high-performance CUDA C++ library designed by NVIDIA to accelerate matrix multiplication and convolution operations in deep learning. (CUDA is a parallel computing platform and programming model invented by NVIDIA). Optimized primarily for GPUs, the CUTLASS library utilizes technologies such as CUDA Warp-Level Primitives and Tensor Cores to achieve efficient parallel processing of matrix multiplication and convolution operations. The CUTLASS library provides a rich API interface that supports multiple data types and precision. Highly customizable and flexible, the CUTLASS library allows developers to implement operator fusion on NVIDIA GPUs, thereby improving the efficiency of deep learning computations.

[0049] The CUTLASS library implements operator fusion by combining multiple computational operations into a single kernel, thereby reducing the number of data reads and writes and improving computational efficiency. Specifically, the CUTLASS library can perform other operations, such as activation functions, normalization, and dropout, while executing matrix multiplication or convolution operations. This avoids reading and writing data multiple times, reduces memory bandwidth consumption, and improves computational efficiency. For example, in deep learning models, convolutional layers are often combined with activation layers, normalization layers, and the like. If these layers are implemented by different kernels, then each calculation requires reading data from GPU memory into registers and then writing it back to GPU memory, which consumes a large amount of memory bandwidth. However, if the operator fusion function of the CUTLASS library is used, these operations can be combined into a single kernel, and all calculations can be completed directly in registers, avoiding the process of multiple data reads and writes, thereby improving computational efficiency.

[0050] The CUTLASS library provides an automatic tuning feature that automatically selects the optimal algorithm and CUTLASS parameters based on different hardware configurations and data types. However, this automatic tuning strategy is not necessarily optimal for convolution operators of specific shapes. In specific practical application scenarios, if the shape parameters of the convolution operator required for the calculation (the dimensions of the input and output tensors, the size of the convolution kernel, the stride, the padding, etc.) are known, the operator can be further optimized at a customized level. For example, in the application scenario of using a diffusion model for text-to-image tasks, if the model structure and the input and output sizes of the image are determined, the shape parameters of all convolution operators that the model needs to process and calculate can also be determined accordingly. This allows for customized CUTLASS parameters for convolution operators of specific shapes to be used for operator fusion, further improving computational efficiency.

[0051] The existing solution is manual parameter tuning, which is labor-intensive and time-consuming for the following reasons:

[0052] 1) A large number of operators requiring parameter tuning: Business needs vary depending on the output image size. Each output image size corresponds to a certain number of convolution operators of different shapes, requiring manual parameter tuning. For example, using the Stable Diffusion v1.5 model with a 512*512 output image size, the number of convolution operators to be processed is approximately 60. Depending on the output image size requirements of different businesses, the total number of operators to be processed could reach hundreds.

[0053] 2) Large parameter search space and long search time: There are 11 parameters to be debugged, which together determine the kernel's parallel execution strategy and memory access pattern. Each parameter has a discrete value with at least two possible values, resulting in thousands of different parameter combinations and a vast search space. Each time a different parameter combination is debugged, the project must be recompiled. Even for projects with fast compilation speeds (approximately 10 seconds), the total parameter tuning time for a single operator can reach at least several hours.

[0054] 3) Manual parameter adjustment brings additional costs: Existing technical solutions rely on manual parameter modification for debugging and recording, which greatly increases additional manpower and time costs as well as potential error rates.

[0055] According to practical experience, the time cost required for adjusting parameters for a single output size using existing methods is already about 20 days, which poses a great obstacle to actual engineering mass production.

[0056] In response to the above reasons, the purpose of this application is to: 1) Design a heuristic search method to narrow the search space and reduce the search time of the parameter adjustment process to address the problem of time-consuming parameter search; 2) Design an automated parameter adjustment method to reduce the manpower required to address the high cost of manual parameter adjustment. This application starts from the above two aspects to reduce the manpower and time costs of the operator parameter adjustment process.

[0057] Compared with manual parameter tuning, this application defines an efficient search range by defining the search space for each parameter, avoiding blind search in the entire parameter space and improving the efficiency of parameter tuning. In addition, this application reduces manual intervention and the complexity and time cost of parameter tuning by automatically generating multiple sets of candidate parameter value combinations and selecting the parameter value combination with the shortest operator execution time, while improving the accuracy and efficiency of optimization.

[0058] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of implementing the above functions. This embodiment and the following embodiments are described below.

[0059] Based on this, the embodiment of the present application provides a convolution operator shape parameter processing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the convolution operator shape parameter processing method of the present application.

[0060] In this embodiment, the convolution operator shape parameter processing method includes steps S10 to S40:

[0061] Step S10, determining each convolution operator shape parameter of the convolution operator in the image processing project to be optimized;

[0062] It should be noted that the convolution operator is a mathematical tool used to perform convolution operations and has a wide range of applications in fields such as signal processing, image processing, computer vision, and deep learning. The convolution operator is typically a small two-dimensional matrix, also known as a filter or kernel. In deep learning, especially in convolutional neural networks (CNNs), the convolution operator is used to extract features from input data. The convolution operator shape parameter is the shape parameter of the convolution operator, typically referring to properties such as the size, stride, and padding of the convolution kernel. Image processing projects to be optimized refer to image processing tasks or software that require performance optimization.

[0063] Identifying and listing all shape parameters of the convolution operators used in image processing projects, such as kernel size, stride, padding, etc., ensures the comprehensiveness of the optimization process and provides necessary parameter information for subsequent steps.

[0064] Step S20, determining an initial parameter value combination of each convolution operator shape parameter, and determining a parameter search space of each convolution operator shape parameter based on the initial parameter value combination;

[0065] It should be noted that the initial parameter value combination is a set of parameter values set at the beginning of the optimization process, which serves as the starting point for optimization. The parameter search space refers to the range of values that each parameter can take during the optimization process.

[0066] By setting an initial parameter value for each convolution operator shape parameter, based on these initial values, the search space of each parameter is determined, that is, the range in which the parameter may vary. This provides a starting point for subsequent parameter optimization and limits the search scope, which helps to improve search efficiency.

[0067] Step S30: determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on a parameter search space of each convolution operator shape parameter, running each group of the candidate parameter value combinations on the image processing project to be optimized, and determining the operator execution time of the convolution operator under each group of the candidate parameter value combinations;

[0068] It should be noted that a candidate parameter value combination is a set of possible parameter values selected according to a certain strategy within the search space and used to evaluate performance. Operator execution time refers to the time spent on the convolution operator during execution and is an important indicator for evaluating operator performance.

[0069] In this embodiment, multiple sets of candidate parameter value combinations are generated in the search space of each parameter, these candidate parameter value combinations are run in the image processing project, and the execution time of the convolution operator under each set of parameter value combinations is recorded.

[0070] Step S40: assigning the candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations to the shape parameters of each convolution operator.

[0071] It can be understood that, from all candidate parameter value combinations, the combination with the shortest operator execution time is selected, which ensures that the parameter combination finally selected can minimize the consumption of computing resources and processing time while maintaining or improving the image processing quality.

[0072] Compared with manual parameter tuning, this application defines an efficient search range by defining the search space for each parameter, avoiding blind search in the entire parameter space and improving the efficiency of parameter tuning. In addition, this application reduces manual intervention and the complexity and time cost of parameter tuning by automatically generating multiple sets of candidate parameter value combinations and selecting the parameter value combination with the shortest operator execution time, while improving the accuracy and efficiency of optimization.

[0073] In one feasible implementation, the step of determining the shape parameters of the image processing item to be optimized includes:

[0074] Step S101: deploying a graphics processing project to be optimized on an image processor, and performing operator fusion on the image processing project to be optimized to obtain a fusion operator;

[0075] It should be noted that the image processing project is first deployed on the image processor, which usually involves transferring the project code and resources to the processing hardware, analyzing and merging multiple convolution operators in the project to form one or more fusion operators. The fusion operator can reduce repeated calculations and memory access, thereby improving processing efficiency.

[0076] It is understandable that by reducing repeated calculations, the overall computing efficiency is improved and the computing resources of the image processor are more effectively utilized.

[0077] Step S102, determining the image input size and image output size of the image processing project to be optimized, and determining a convolution operator from each of the fusion operators, and determining a convolution operator shape parameter of the convolution operator based on the image input size and the image output size.

[0078] It should be noted that image input size and image output size refer to the resolution or size of the input and output images in image processing projects. The neighborhood range refers to the range of possible values centered around the initial parameter value when determining the parameter search space.

[0079] By clarifying the input and output sizes of the image processing project, the operators that actually perform the convolution operation are identified from the fusion operators. Based on the input and output sizes, the shape parameters of these convolution operators, such as the convolution kernel size and step size, are determined. This ensures that the shape parameters of the convolution operator match the image size and achieves accurate image processing effects. Appropriate convolution operator parameters can reduce unnecessary calculations and improve processing speed.

[0080] In one feasible implementation, the step of determining the initial parameter value combination of each convolution operator shape parameter includes:

[0081] Step S201, determining initial parameter values corresponding to shape parameters of each convolution operator based on the image input size and the image output size;

[0082] Based on the image's input and output sizes, an initial shape parameter value is determined for each convolution operator. For example, if the output size is half the input size, the kernel size and stride might be chosen accordingly. This implementation ensures that the initial parameter values are appropriate for the image size, providing a reasonable starting point for subsequent optimization, narrowing the search space, and reducing unnecessary computation.

[0083] Step S202: combining the initial parameter values of the shape parameters of the convolution operators to obtain an initial parameter value combination.

[0084] The initial shape parameter values of all convolution operators are combined into a parameter set. This set will serve as the starting point of the optimization algorithm. It can ensure that the parameters of all convolution operators are coordinated and consistent at the beginning of optimization, providing a clear starting point for evaluating the impact of subsequent parameter adjustments.

[0085] By determining the initial parameter values based on the image size, a more reasonable starting point is provided for the optimization algorithm, which helps to converge to the optimal solution faster. Reasonable initial parameter values can reduce the number of candidate solutions that need to be evaluated, thereby reducing the overall computational complexity.

[0086] In one feasible implementation, the step of determining the parameter search space of each convolution operator shape parameter based on the initial parameter value combination includes:

[0087] Step S203, obtaining the preset neighborhood range corresponding to each of the convolution operator shape parameters;

[0088] A preset neighborhood range is established for each convolution operator shape parameter. This neighborhood range defines the maximum distance or interval that the parameter can vary around its initial value. It clarifies the search boundary for each parameter, helps limit the search range, and improves search efficiency. By limiting the neighborhood range, it can avoid invalid searches in parameter areas that have little impact on performance.

[0089] In step S204, for any benchmark operator parameter of each convolution operator shape parameter, a parameter search space of the benchmark operator parameter is obtained with the initial parameter value corresponding to the benchmark operator parameter in the initial parameter value combination as the center and the preset neighborhood range corresponding to the benchmark operator parameter as the value range.

[0090] For any benchmark operator parameter of each convolution operator shape parameter, the search space of this parameter is determined with the value of the parameter in the initial parameter value combination as the center and the preset neighborhood range as the boundary.

[0091] By centering on the initial value, we can concentrate search resources on the area where better solutions are most likely to be found. While maintaining search flexibility, we can limit the search by the neighborhood range to avoid wasting resources.

[0092] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 Step S30: Before determining the multiple sets of candidate parameter value combinations of the convolution operator shape parameters based on the parameter search spaces of the respective convolution operator shape parameters, the convolution operator shape parameter processing method further includes step S01:

[0093] Step S01, determining the number of calls of each convolution operator shape parameter;

[0094] It should be noted that the number of calls refers to the number of times a convolution operator is executed during the optimization process.

[0095] It is understandable that by counting and recording the frequency of each convolution operator being called in the image processing project, we can identify the more critical or frequently used operators in the project, provide more attention to the optimization of these operators, reasonably allocate optimization resources based on the number of calls, and ensure that the optimization work is concentrated on the parts that have the greatest impact on performance.

[0096] The step S20: determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on the parameter search space of each convolution operator shape parameter, comprises:

[0097] Step S301 , traversing the parameter search space of each convolution operator shape parameter in descending order of the number of calls to obtain multiple groups of candidate parameter value combinations of each convolution operator shape parameter.

[0098] It is understandable that sorting the convolution operators from high to low according to their call frequency, traversing the parameter search space of each convolution operator in this order, and generating multiple sets of candidate parameter value combinations can ensure that the most frequently called operators are optimized first. Optimizing the most frequently used operators can bring more significant overall performance improvements.

[0099] In one feasible implementation, step S30 of running each set of candidate parameter value combinations on the image processing project to be optimized and determining the operator execution time of the convolution operator under each set of candidate parameter value combinations includes:

[0100] Step S302: For any target parameter value combination in each set of candidate parameter value combinations, define the target parameter value combination as an environment variable through a shell script, retrieve the parameter variable through the environment variable in the compilation setting file of the image processing project to be optimized, and define the parameter variable as a global macro through a compilation option;

[0101] It's important to note that Shell scripting is a scripting language used in Linux or Unix systems to automate command-line tasks. Environment variables are variables defined in the operating system that can be referenced within a program for configuration or information transfer. In software development, a compilation settings file is a configuration file used to define how the compiler compiles source code. In programming, a global macro is a preprocessing directive that can be replaced with a specific code snippet at compile time. A global macro is a macro that applies to the entire program.

[0102] It's easy to understand that by writing a shell script, defining a selected set of candidate parameter value combinations as environment variables, reading these environment variables in the compilation settings file to obtain parameter values, and using compiler options to define these parameter values as global macros for use during the compilation process, you can automate the parameter configuration process, reduce human error, and improve efficiency. The use of environment variables provides a high degree of flexibility, facilitating quick switching between different parameter combinations.

[0103] Step S303, at the to-be-optimized position of the source file of the to-be-optimized image processing project, the global macro is passed as a variable parameter in a function to obtain a target file;

[0104] It should be noted that the target file refers to the intermediate file generated during the compilation process, which contains the code processed by the compiler.

[0105] It is understandable that at the location to be optimized in the source code, global macros are passed as function parameters, allowing the behavior of the algorithm to be adjusted according to the value of the macro definition at compile time, reducing code duplication through macro definitions and improving code maintainability.

[0106] Step S304: compile and run the image processing project to be optimized based on the target file, and determine the time consumed in compiling and running the image processing project to be optimized based on the target file, and use the time consumed in compiling and running as the operator execution time of the convolution operator under the target parameter value combination.

[0107] It should be noted that compilation and running refer to the process of converting source code into an executable file and executing this file.

[0108] It can be understood that by compiling and running the target file to generate an executable file, the time required to compile and run the executable file is measured and recorded, and this time is used as the execution time of the convolution operator under the set of parameter value combinations. This embodiment provides a quantitative method to evaluate the impact of different parameter combinations on performance, and based on the actual measurement results, more informed optimization decisions can be made.

[0109] For example, in order to help understand the implementation process of the convolution operator shape parameter processing method obtained by combining this embodiment with the above-mentioned embodiment 1, this embodiment provides a brief process of the convolution operator shape parameter processing method.

[0110] The CUTLASS library provides an automatic tuning function. You can call the cutlass::conv::findOperation function to automatically find the default convolution operator fusion strategy. However, as mentioned above, the automatic tuning strategy is not optimal. To optimize the CUTLASS convolution operator fusion strategy, the existing method manually adjusts the parameters to determine the optimal operator. The specific steps are as follows:

[0111] Preparation: You need to have an image processing project containing convolution operations to be optimized, and have completed the installation and configuration of the CUTLASS library. Use the CUTLASS library to perform CUTLASS's default automatic optimization on the project; Determine the operator shape: After clarifying the specific sizes of the input and output images, record the shape parameters of all convolution operators used through the actual compilation and running process, including the dimension of the input tensor, the size of the convolution kernel, the step size, padding, and grouping; Manual parameter tuning: For each shape of the convolution operator, use the convolution kernel function of the CUTLASS library to replace it, and manually adjust the configuration parameters of the kernel function. Recompile the project after each parameter change, measure the average time of the operator multiple times, and find the optimal parameter configuration; Determine the replacement plan: Keep the replacement plan for the operator with more obvious optimization effect during the tuning process; Test the overall performance and record the effect improvement.

[0112] The main process of the technical solution of this application includes: preparing CUTLASS project, determining operator shape, heuristic search parameter combination, automatic parameter adjustment, and testing performance improvement; the overall flow chart is as follows Figure 3 Each step is described in detail below, and at the end of this section, examples based on specific scenarios are used to illustrate how this application solution is implemented:

[0113] 1) Prepare the CUTLASS project (preparation of system equipment)

[0114] This application requires at least one NVIDIA GPU, an image processing project to be optimized (e.g., a diffusion model Vincent image project) deployed on the GPU, and automatic optimization of the project using the CUTLASS library using the default operator fusion. This application will further customize the optimization of operators for specific shapes.

[0115] 2) Determine the operator shape

[0116] First, you need to determine the desired set of image input and output dimensions. Once determined, print and record the shape parameters of all convolution operators used in this scenario in the code. Count all operators of different shapes and their call counts. Shape parameters include: input tensor dimensions, kernel size, stride, padding, and grouping. Prioritize operators with the highest number of calls. The following steps explain how to optimize the parameters of operators of a specific shape.

[0117] 3) Heuristic search parameter combination

[0118] 3.1 Introduction to parameters to be adjusted

[0119] First, we need to identify the CUTLASS parameters to be adjusted and their effects. ThreadblockShape, WarpShape, and InstructionShape are configuration parameters for the convolution kernel function in the CUTLASS library, while stage and split_k are configuration parameters for matrix multiplication. They directly determine the kernel's parallel execution strategy and memory access mode. The following details the meaning of these parameters:

[0120] ThreadblockShape defines the shape of a thread block, typically represented as a three-dimensional vector corresponding to the output channel, output height, and output width dimensions of the convolution computation. For example, ThreadblockShape(128,128,32) means that each thread block is responsible for computing 128 output channels, 128 pixels in the output height direction, and 32 pixels in the output width direction of the output feature map. The size of the thread block directly affects the degree of parallelism in the computation and the utilization of GPU resources. Larger thread blocks can increase computational density but may increase shared memory usage, while smaller thread blocks may reduce computational efficiency.

[0121] The WarpShape parameter is how the ThreadblockShape is divided at the warp granularity, also expressed as a three-dimensional vector. It specifies each warp's responsibility for the output channels, output height, and output width dimensions. For example, if the ThreadblockShape is (128, 128, 32) and the WarpShape is (64, 16, 8), this means that each warp will process 64 output channels, 16 pixels in the output height direction, and 8 pixels in the output width direction. This division helps optimize memory access and computational load balancing between warps.

[0122] The InstructionShape parameter describes the shape of a SIMT (Single Instruction, Multiple Threads) instruction, which determines how threads collaborate during matrix multiplication. In modern GPUs, matrix multiplication and accumulation operations are typically performed using the MMA (Matrix Multiply-Accumulate) unit. The InstructionShape parameter defines the size of the multiplication operation performed by each thread in the MMA unit. For example, InstructionShape(8,8,16) means that each thread will perform an 8x8x16 multiplication operation, meaning each thread will process 8 rows of matrix A and 8 columns of matrix B, performing 16 accumulation operations.

[0123] The stage parameter primarily specifies the complexity level of the GEMM (General Matrix Multiply) kernel. More specifically, it involves the number of intermediate registers used in the operation and how data is reused between these registers. A higher stage value means higher register reuse, which can reduce the number of accesses to on-chip memory and thus improve computational efficiency. However, a high stage value may also increase computational latency because more computational steps are involved. Therefore, choosing the appropriate stage value is a trade-off between computational efficiency and latency.

[0124] The split_k parameter controls whether and how matrix multiplication is split into multiple smaller multiplication operations. In deep learning matrix multiplication, especially when the matrix size is very large, performing the multiplication directly in one go may not be feasible due to video memory limitations. Using split_k, the multiplication operation can be split into k smaller multiplications, each processing a portion of the matrix. This has the advantage of reducing the required video memory while improving computational efficiency by reusing intermediate results. However, this may also introduce additional overhead, such as more memory reads and writes.

[0125] The above are all the CUTLASS parameters to be adjusted, a total of 11 variable parameters. In actual applications, developers need to adjust these parameters through experiments based on the specific hardware platform and problem scale to achieve optimal performance.

[0126] 3.2 Heuristic Search Method

[0127] It can be found that the complete parameter search space is very large. The following describes how this application uses a heuristic search method to narrow the search space, thereby reducing the time spent on parameter adjustment.

[0128] In general, it can be considered that the default parameter configuration of CUTLASS is close to the optimal solution. Taking this prior knowledge as inspiration, we only need to search within a small neighborhood of the default parameter combination to find the optimal solution.

[0129] Specifically, we first determine the shape of the operator to be optimized. Using CUTLASS configuration, we find the default parameter configuration for that operator. With this parameter combination as the center, we fine-tune each parameter based on its characteristics and empirical experience, forming a small neighborhood that serves as the optimized search space.

[0130] For the ThreadblockShape parameter, constraints are imposed based on empirical experience to narrow the search space. For example, the first dimension is typically set to {256, 128, 64}, the second dimension is typically set to {128, 64}, and the third dimension is typically set to {64, 32}. Similarly, constraints are imposed on the remaining parameters based on prior experience. For example, the WarpShape parameter, which is strongly correlated with the ThreadblockShape parameter, is typically set to 1 / 2 or 1 / 4 of the first dimension of ThreadblockShape, the second dimension is typically set to 1 / 2 of the second dimension of ThreadblockShape, and the third dimension is typically set to the same value as the third dimension of ThreadblockShape. The InstructionShape parameter is typically set to (16, 8, 16); the stage parameter is typically set to 3; and the split_k parameter is typically set to {4, 2, 1}. This method reduces the number of parameter combinations in the search space to approximately 40, significantly reducing the search time.

[0131] 4) Automated parameter adjustment

[0132] In the previous step, the parameter search space is determined. The next step is to use the automated script to cyclically debug each parameter combination in the search space. The specific logical flow inside the automated parameter tuning script is as follows: Figure 1 The details are as follows:

[0133] 4.1 First, determine whether the traversal of the search space has ended. If so, end the loop and jump to 4.5; otherwise, continue traversing the search space, extract a set of parameter combinations that have not been debugged, and proceed to the next step;

[0134] 4.2 First, define the above parameter values as environment variables through the shell script to control the compilation of the project; then in the project compilation setting file (such as setup.py, cmake), take the parameter variables through the environment variables, and then define the parameters as global macros through the compilation options;

[0135] 4.3 Pass these macros as variable parameters in the function at the location to be optimized in the source file. This will automatically traverse the environment variable values in the script and control the corresponding parameters of the source file during compilation. Continue to the next step.

[0136] 4.4 Try to compile and run the project. If both pass, measure the operator timing for the parameter combination, take the average of multiple measurements, and record the result. If not, capture the error and jump back to 4.1 to execute the next loop.

[0137] 4.5 Determine the optimal parameter solution based on the operator time-consuming records, and retain the replacement solution for the operator with more obvious optimization effect.

[0138] 5) Test performance improvement

[0139] After completing the replacement optimization of a single shape operator and after completing the optimization of all operators, it is necessary to test the performance improvement to verify the effectiveness of the above steps.

[0140] The following describes an example of applying the solution of this application in a specific scenario.

[0141] In this application example, the project to be optimized is a Wenshengtu project based on various diffusion models, and the CUTLASS operator fusion has been completed through the Stable Fast inference acceleration framework. The optimization requirement is to complete the parameter tuning of the operator fusion for at least two commonly used diffusion models on different GPU architectures (including V100 and A100, etc.) for several commonly used output image sizes, so as to replace the default parameter configuration to achieve better performance. As mentioned above, the existing manual parameter adjustment method consumes huge manpower and time costs, which is not conducive to mass engineering production. Therefore, this application can be used to reduce the manpower and time costs of the operator parameter adjustment process.

[0142] 1) Preparation: First, determine the debugging target for a single experiment, namely the diffusion model type and GPU architecture. Deploy the diffusion model accelerated by the Stable Fast framework to the specified GPU. Then, determine the output image size, and complete the preparation.

[0143] 2) Determine operator shape: In the code section where Stable Fast takes over the convolution operator, print and record the shape parameters of all used convolution operators. Count all operators of different shapes and their call counts, prioritizing operators with the highest number of calls.

[0144] 3) Heuristic Parameter Search: For a convolution operator of a specific shape, we use CUTLASS configuration to find the default parameter configuration for that operator. Using this parameter combination as the center, we fine-tune each parameter based on its characteristics and the experimental experience described in Section 3.2, creating the optimized search space. Automated Parameter Tuning: We write automated scripts for parameter tuning; the script logic is not detailed here.

[0145] 4) Test overall performance and record improvements.

[0146] 5) Effect evaluation: By applying the technical solution of this application, the parameter adjustment time for a single output size is reduced to about 3 days; and compared with the existing manual parameter adjustment solution, the use of automated scripts replaces a large number of manual operations, greatly reducing the manpower and time costs of the operator parameter adjustment process, thus achieving the purpose of the invention.

[0147] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for processing the shape parameters of the convolution operator of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.

[0148] This application also provides a convolution operator shape parameter processing device, please refer to Figure 4 , the convolution operator shape parameter processing device includes:

[0149] A first determining module 10 is used to determine shape parameters of each convolution operator in the image processing project to be optimized;

[0150] a second determining module 20, configured to determine an initial parameter value combination of each convolution operator shape parameter, and determine a parameter search space of each convolution operator shape parameter based on the initial parameter value combination;

[0151] A third determining module 30 is configured to determine multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on a parameter search space of each convolution operator shape parameter, run each group of the candidate parameter value combinations in the image processing project to be optimized, and determine an operator execution time of the convolution operator under each group of the candidate parameter value combinations;

[0152] The assignment module 40 is configured to assign the candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations to the shape parameters of each convolution operator.

[0153] Optionally, the first determining module 10 is configured to:

[0154] Deploying the graphics processing project to be optimized on an image processor, and performing operator fusion on the image processing project to be optimized to obtain a fusion operator;

[0155] Determine the image input size and the image output size of the image processing project to be optimized, determine a convolution operator from each of the fusion operators, and determine a convolution operator shape parameter of the convolution operator based on the image input size and the image output size.

[0156] Optionally, the second determining module 20 is configured to:

[0157] Determining initial parameter values corresponding to the shape parameters of each convolution operator based on the image input size and the image output size;

[0158] The initial parameter values of the shape parameters of the convolution operators are combined to obtain an initial parameter value combination.

[0159] Optionally, the second determining module 20 is configured to:

[0160] Obtaining the preset neighborhood range corresponding to each of the convolution operator shape parameters;

[0161] For any benchmark operator parameter of each convolution operator shape parameter, the parameter search space of the benchmark operator parameter is obtained with the initial parameter value corresponding to the benchmark operator parameter in the initial parameter value combination as the center and the preset neighborhood range corresponding to the benchmark operator parameter as the value range.

[0162] Optionally, the apparatus further includes a fourth determining module, configured to:

[0163] Determining the number of calls of each of the convolution operator shape parameters;

[0164] The third determining module 30 is configured to:

[0165] The parameter search space of each convolution operator shape parameter is traversed in descending order of the number of calls to obtain multiple groups of candidate parameter value combinations of each convolution operator shape parameter.

[0166] Optionally, the third determining module 30 is configured to:

[0167] For any target parameter value combination in each set of candidate parameter value combinations, defining the target parameter value combination as an environment variable through a Shell script, retrieving the parameter variable through the environment variable in a compilation setting file of the image processing project to be optimized, and defining the parameter variable as a global macro through a compilation option;

[0168] At the to-be-optimized position of the source file of the image processing project to be optimized, the global macro is passed as a variable parameter in a function to obtain a target file;

[0169] Compile and run the image processing project to be optimized based on the target file, and determine the time consumed in compiling and running the image processing project to be optimized based on the target file, and use the time consumed in compiling and running as the operator execution time of the convolution operator under the target parameter value combination.

[0170] The convolution operator shape parameter processing device provided in this application adopts the convolution operator shape parameter processing method in the above-mentioned embodiment, which can solve the technical problems of time-consuming and inefficient manual parameter adjustment. Compared with the existing technology, the beneficial effects of the convolution operator shape parameter processing device provided in this application are the same as the beneficial effects of the convolution operator shape parameter processing method provided in the above-mentioned embodiment, and the other technical features of the convolution operator shape parameter processing device are the same as those disclosed in the above-mentioned embodiment method, and are not further described here.

[0171] The present application provides a convolution operator shape parameter processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the convolution operator shape parameter processing method in the above-mentioned embodiment one.

[0172] Reference below Figure 5 , which shows a schematic structural diagram of a convolution operator shape parameter processing device suitable for implementing an embodiment of the present application. The convolution operator shape parameter processing device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The convolution operator shape parameter processing device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.

[0173] like Figure 5As shown, the convolution operator shape parameter processing device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. Various programs and data required for the operation of the convolution operator shape parameter processing device are also stored in RAM 1004. The processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the convolution operator shape parameter processing device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a convolution operator shape parameter processing device with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or have instead.

[0174] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0175] The convolution operator shape parameter processing device provided in this application adopts the convolution operator shape parameter processing method in the above-mentioned embodiment, which can solve the technical problems of time-consuming and inefficient manual parameter adjustment. Compared with the existing technology, the beneficial effects of the convolution operator shape parameter processing device provided in this application are the same as the beneficial effects of the convolution operator shape parameter processing method provided in the above-mentioned embodiment, and the other technical features of the convolution operator shape parameter processing device are the same as those disclosed in the method of the previous embodiment, and are not further described here.

[0176] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0177] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0178] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, and the computer-readable program instructions are used to execute the convolution operator shape parameter processing method in the above-mentioned embodiment.

[0179] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0180] The above-mentioned computer-readable storage medium may be included in the convolution operator shape parameter processing device; or it may exist independently without being assembled into the convolution operator shape parameter processing device.

[0181] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the convolution operator shape parameter processing device, the convolution operator shape parameter processing device is enabled to: determine each convolution operator shape parameter of the convolution operator in the image processing project to be optimized; determine the initial parameter value combination of each convolution operator shape parameter, and determine the parameter search space of each convolution operator shape parameter based on the initial parameter value combination; determine multiple groups of candidate parameter value combinations of each convolution operator shape parameter based on the parameter search space of each convolution operator shape parameter, run each group of the candidate parameter value combination in the image processing project to be optimized, and determine the operator execution time of the convolution operator under each group of the candidate parameter value combination; assign the candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations to each convolution operator shape parameter.

[0182] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0183] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0184] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0185] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., a computer program) for executing the above-mentioned convolution operator shape parameter processing method. This computer-readable storage medium can solve the technical problems of time-consuming and inefficient manual parameter adjustment. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the convolution operator shape parameter processing method provided in the above-mentioned embodiment, and are not further described here.

[0186] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned convolution operator shape parameter processing method when executed by a processor.

[0187] The computer program product provided in this application can solve the technical problems of time-consuming and inefficient manual parameter adjustment. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the convolution operator shape parameter processing method provided in the above embodiment, and will not be repeated here.

[0188] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for processing shape parameters of a convolution operator, characterized in that: The convolution operator shape parameter processing method includes: Deploying the image processing project to be optimized on an image processor, performing operator fusion on the image processing project to be optimized to obtain a fusion operator, determining a convolution operator from each of the fusion operators, and determining each convolution operator shape parameter of the convolution operator, wherein each convolution operator shape parameter includes a convolution kernel size, a step size, and a padding; Determine an initial parameter value combination of each convolution operator shape parameter, and obtain a preset neighborhood range corresponding to each convolution operator shape parameter. For any benchmark operator parameter of each convolution operator shape parameter, take the initial parameter value corresponding to the benchmark operator parameter in the initial parameter value combination as the center, and take the preset neighborhood range corresponding to the benchmark operator parameter as the value range to obtain a parameter search space of the benchmark operator parameter; Determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on a parameter search space of each convolution operator shape parameter; for any target parameter value combination in each group of the candidate parameter value combinations, defining the target parameter value combination as an environment variable through a shell script; retrieving the parameter variable through the environment variable in a compilation setting file of the image processing project to be optimized; and defining the parameter variable as a global macro through a compilation option; At the to-be-optimized position of the source file of the image processing project to be optimized, the global macro is passed as a variable parameter in a function to obtain a target file; Compiling and running the image processing project to be optimized based on the target file, determining a time consumed for compiling and running the image processing project to be optimized based on the target file, and using the time consumed for compiling and running as an operator execution time consumed for the convolution operator under the target parameter value combination; The candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations is assigned to each convolution operator shape parameter.

2. The convolution operator shape parameter processing method according to claim 1, wherein: The step of determining a convolution operator shape parameter of the convolution operator comprises: An image input size and an image output size of the image processing project to be optimized are determined, and a convolution operator shape parameter of the convolution operator is determined based on the image input size and the image output size.

3. The convolution operator shape parameter processing method according to claim 2, wherein: The step of determining the initial parameter value combination of each convolution operator shape parameter comprises: Determining initial parameter values corresponding to the shape parameters of each convolution operator based on the image input size and the image output size; The initial parameter values of the shape parameters of the convolution operators are combined to obtain an initial parameter value combination.

4. The convolution operator shape parameter processing method according to claim 1, wherein: Before the step of determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on the respective parameter search spaces of the convolution operator shape parameters, the method further includes: Determining the number of calls of each of the convolution operator shape parameters; The step of determining multiple groups of candidate parameter value combinations for each convolution operator shape parameter based on the respective parameter search spaces of the convolution operator shape parameters comprises: The parameter search space of each convolution operator shape parameter is traversed in descending order of the number of calls to obtain multiple groups of candidate parameter value combinations of each convolution operator shape parameter.

5. A convolution operator shape parameter processing device, characterized in that: The convolution operator shape parameter processing device includes: a first determination module, configured to deploy the image processing project to be optimized on the image processor, perform operator fusion on the image processing project to be optimized to obtain a fusion operator, determine a convolution operator from each of the fusion operators, and determine each convolution operator shape parameter of the convolution operator, wherein each convolution operator shape parameter includes a convolution kernel size, a step size, and a padding; A second determination module is configured to determine an initial parameter value combination of each convolution operator shape parameter, obtain a preset neighborhood range corresponding to each convolution operator shape parameter, and obtain a parameter search space for any benchmark operator parameter of each convolution operator shape parameter, with the initial parameter value corresponding to the benchmark operator parameter in the initial parameter value combination as the center and the preset neighborhood range corresponding to the benchmark operator parameter as the value range; a third determination module, configured to determine, based on the parameter search spaces of the respective convolution operator shape parameters, a plurality of candidate parameter value combinations for the respective convolution operator shape parameters; for any target parameter value combination in each of the candidate parameter value combinations, defining the target parameter value combination as an environment variable through a Shell script; taking out the parameter variable through the environment variable in the compilation setting file of the image processing project to be optimized; defining the parameter variable as a global macro through a compilation option; passing the global macro as a variable parameter in a function at a to-be-optimized position in the source file of the image processing project to be optimized to obtain a target file; compiling and running the image processing project to be optimized based on the target file, and determining a time consumed for compiling and running the image processing project to be optimized based on the target file; and using the time consumed for compilation and running as the operator execution time consumed for the convolution operator under the target parameter value combination; An assignment module is used to assign the candidate parameter value combination with the shortest operator execution time in each group of the candidate parameter value combinations to the shape parameters of each convolution operator.

6. A convolution operator shape parameter processing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the convolution operator shape parameter processing method according to any one of claims 1 to 4.

7. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the convolution operator shape parameter processing method according to any one of claims 1 to 4 are implemented.

8. A computer program product, characterized in that The computer program product comprises a computer program, which implements the steps of the convolution operator shape parameter processing method according to any one of claims 1 to 4 when executed by a processor.