Data preprocessing method and device, medium, GPU chip, electronic component and electronic equipment
By adjusting the default parameters of the target operator according to the hardware performance parameters and optimizing the preprocessing operation, the problem of low preprocessing efficiency of the AI inference framework on different hardware platforms is solved, and more efficient AI acceleration is achieved.
Patent Information
- Application Number
- CN202410757965.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-10
AI Technical Summary
In the existing technology, the preprocessing efficiency of the AI reasoning framework on different hardware platforms is low, causing the preprocessing of original data to become a bottleneck for AI reasoning tasks, and the performance of each operator in the operator library cannot be fully utilized.
By obtaining the target hardware performance parameters, matching the pre-saved operator optimal parameter mapping table, adjusting the default parameters of the target operator, and optimizing the operator's work group size, local memory size and vectorization dimension to adapt to the current hardware environment. Improve preprocessing efficiency.
It improves the processing efficiency of data in the pre-processing stage of the AI model, improves the AI acceleration efficiency, and ensures that the operator performance is optimal under the current hardware environment.
Smart Images

Figure CN118626262A
Abstract
Description
Technical Field
[0001] The present disclosure relates to AI (Artificial Intelligence) reasoning technology, and in particular to a data preprocessing method, device, medium, GPU chip, electronic component and electronic device. Background Art
[0002] In the prior art, AI acceleration is generally achieved by running AI reasoning frameworks on GPUs (Graphic Processing Units). For AI reasoning frameworks, since the data types and data volumes of the acquired raw data may not be exactly the same, the raw data cannot be directly applied to the model for AI reasoning. The raw data needs to be preprocessed, such as normalization, resizing, image channel change data enhancement, etc., and the same raw data may involve multiple different preprocessing operations.
[0003] Existing preprocessing tools generally include Opencv, Torchvision, Transformer, etc. When calling the operators in the operator library to preprocess the raw data, the preprocessing operations are performed according to the operator parameters set for each operator when the operator library is developed. However, due to different hardware platforms, such as different hardware components of GPUs, the hardware performance of different hardware platforms is also different. Therefore, if the operator is called to perform preprocessing operations on raw data on different hardware platforms according to the operator parameter setting method in the prior art, the performance of the operator cannot be optimized, which affects the preprocessing efficiency of the raw data. Therefore, when the computational efficiency of the model becomes higher and higher, the preprocessing of raw data will become the bottleneck of the entire AI reasoning task. Summary of the invention
[0004] The purpose of the present disclosure is to provide a data preprocessing method, device, medium, GPU chip, electronic component and electronic device, which can fully utilize the performance of each operator in the operator library, improve the processing efficiency of the preprocessing stage before the data is input into the AI model, and thus improve the AI acceleration efficiency.
[0005] According to one aspect of the present disclosure, a data preprocessing method is provided, including: obtaining original data to be preprocessed and an operator type corresponding to the preprocessing operation; the operator corresponding to the operator type in an operator library is a target operator; according to an optimal operator parameter combination adapted to a target hardware performance parameter of a hardware platform currently running the target operator, default parameters of the target operator are adjusted; and the target operator after running the adjusted parameters performs the preprocessing operation on the original data.
[0006] In a feasible implementation of the present disclosure, before adjusting the default parameters of the target operator, the method further includes: obtaining the target hardware performance parameters, and matching a pre-saved operator optimal parameter mapping table based on the target hardware performance parameters to obtain and save an optimal operator parameter combination adapted to the target hardware performance parameters; the operator optimal parameter mapping table stores the optimal operator parameter combinations corresponding to each operator under different hardware performance parameter environments.
[0007] In a feasible implementation of the present disclosure, the optimal operator parameter combination includes at least one of the following: the workgroup size of the operator, the local memory size of the operator, and the vectorization dimension of the operator.
[0008] In a feasible implementation of the present disclosure, obtaining the operator type corresponding to the preprocessing operation includes: obtaining a model file of a target AI model used to perform an inference task based on the original data; parsing the model file to obtain the operator type specified by the parsing result of the model file, and the operator type specified by the parsing result of the model file is the operator type corresponding to the preprocessing operation.
[0009] In a feasible implementation of the present disclosure, the hardware platform is used to connect to a multimodal AI model, and the operator library also includes a format conversion operator for format conversion of data; the obtaining of the operator type corresponding to the preprocessing operation includes: determining a target AI model for performing the reasoning task based on the original data from the multimodal AI model according to the model type specified by the user for performing the reasoning task, and obtaining a model file corresponding to the target AI model; parsing the model file to obtain the operator type specified by the parsing result of the model file; judging whether the data type of the original data is consistent with the target data type required to be input to the target AI model according to the parsing result of the model file; in the event of inconsistency, the operator type of the format conversion operator and the operator type specified by the parsing result of the model file are used together as the operator type corresponding to the preprocessing operation.
[0010] In a feasible implementation of the present disclosure, the method further includes: determining whether there exists a fusion operator in the operator library that is fully compatible with the combination operator corresponding to the preprocessing operation; the combination operator is at least two operators among the operators corresponding to the operator type corresponding to the preprocessing operation; if so, replacing the combination operator with the fusion operator as the target operator or one of the target operators.
[0011] In a feasible implementation of the present disclosure, the operators in the operator library are developed based on the Opencl language, and the hardware platform is a GPU.
[0012] According to another aspect of the present disclosure, a data preprocessing device is also provided, including: an acquisition module, an adjustment module and an operation module.
[0013] An acquisition module is used to acquire the original data to be preprocessed and the operator type corresponding to the preprocessing operation; the operator corresponding to the operator type in the operator library is the target operator;
[0014] An adjustment module, configured to adjust the default parameters of the target operator according to an optimal operator parameter combination adapted to the target hardware performance parameters of the hardware platform currently running the target operator;
[0015] An operation module is used to run the target operator after adjusting parameters to perform the preprocessing operation on the original data.
[0016] In a feasible implementation method of the present disclosure, the acquisition module is also used to acquire the target hardware performance parameters, and match a pre-saved operator optimal parameter mapping table based on the target hardware performance parameters to obtain and save an optimal operator parameter combination adapted to the target hardware performance parameters; the operator optimal parameter mapping table stores the optimal operator parameter combination corresponding to each operator under different hardware performance parameter environments.
[0017] In a feasible implementation of the present disclosure, the optimal operator parameter combination includes at least one of the following: the workgroup size of the operator, the local memory size of the operator, and the vectorization dimension of the operator.
[0018] In a feasible implementation method of the present disclosure, the acquisition module is specifically used to obtain a model file of a target AI model used to perform an inference task based on the original data; parse the model file to obtain an operator type specified by a parsing result of the model file, and the operator type specified by the parsing result of the model file is the operator type corresponding to the preprocessing operation.
[0019] In a feasible implementation of the present disclosure, the hardware platform is used to connect to a multimodal AI model, and the operator library also includes a format conversion operator for converting the format of data; the acquisition module is specifically used to determine, from the multimodal AI model, a target AI model for performing the reasoning task based on the original data according to the model type specified by the user for performing the reasoning task, and obtain a model file corresponding to the target AI model; parse the model file to obtain the operator type specified by the parsing result of the model file; determine, based on the parsing result of the model file, whether the data type of the original data is consistent with the target data type required to be input by the target AI model; in the event of inconsistency, use the operator type of the format conversion operator and the operator type specified by the parsing result of the model file together as the operator type corresponding to the preprocessing operation.
[0020] In a feasible implementation of the present disclosure, the device also includes a judgment module, which is used to judge whether there is a fusion operator in the operator library that is fully adapted to the combination operator corresponding to the preprocessing operation; the combination operator is at least two operators among the operators corresponding to the operator type corresponding to the preprocessing operation; if so, the combination operator is replaced by the fusion operator as the target operator or one of the target operators.
[0021] In a feasible implementation of the present disclosure, the operators in the operator library are developed based on the Opencl language, and the hardware platform is a GPU.
[0022] According to another aspect of the present disclosure, a computer-readable storage medium is further provided, on which a data preprocessing program is stored, and when the data preprocessing program is executed, any of the above-mentioned data preprocessing methods is implemented.
[0023] According to another aspect of the present disclosure, a GPU chip is provided, including a GPU and a memory, wherein a data preprocessing program is stored in the memory, and when the data preprocessing program is executed by the GPU, any of the above-mentioned data preprocessing methods is implemented.
[0024] According to another aspect of the present disclosure, an electronic component is provided, including the GPU chip. In some usage scenarios, the electronic component is a graphics card; in other usage scenarios, the electronic component is a CPU motherboard.
[0025] According to another aspect of the present disclosure, an electronic device includes the above-mentioned electronic component. In some usage scenarios, the product form of the electronic device is a portable electronic device, such as a smart phone, a tablet computer, a VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, a game console, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flowchart of a data preprocessing method according to an embodiment of the present disclosure;
[0027] Figure 2 It is a structural block diagram of a data preprocessing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] Before introducing the embodiments of the present disclosure, it should be noted that:
[0029] Some embodiments of the present disclosure are described as processing flows. Although the various operation steps of the flow may be given sequential step numbers, the operation steps therein may be implemented in parallel, concurrently or simultaneously.
[0030] In the embodiments of the present disclosure, the terms "first", "second", etc. may be used to describe various features, but these features should not be limited by these terms. These terms are used only to distinguish one feature from another.
[0031] The term “and / or” may be used in embodiments of the present disclosure. “And / or” includes any and all combinations of one or more of the listed associated features.
[0032] It should be understood that when describing the connection or communication relationship between two components, unless it is explicitly stated that the two components are directly connected or directly communicating, the connection or communication between the two components can be understood as direct connection or communication, or as indirect connection or communication through an intermediate component.
[0033] In order to make the technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the exemplary embodiments of the present disclosure are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0034] When the prior art calls the operators in the operator library to preprocess the raw data, the preprocessing operation is performed according to the operator parameters set for each operator when the operator library is developed. However, due to different hardware platforms, such as different hardware components of GPUs, the hardware performance of different hardware platforms is also different. Therefore, if the operator is called to perform preprocessing operations on the raw data on different hardware platforms according to the operator parameter setting method in the prior art, the performance of the operator cannot be optimized, which affects the preprocessing efficiency of the raw data. Therefore, when the computational efficiency of the model becomes higher and higher, the preprocessing of the raw data will become the bottleneck of the entire AI reasoning task.
[0035] In order to solve the above problems, the purpose of the present disclosure is to provide a data preprocessing solution. The data preprocessing solution provided by the present disclosure will be introduced below.
[0036] Please refer to Figure 1 , an embodiment of the present disclosure provides a data preprocessing method, comprising the following steps.
[0037] S110: Acquire original data to be preprocessed and an operator type corresponding to the preprocessing operation.
[0038] Among them, the operator corresponding to the operator type in the operator library is the target operator.
[0039] S120: Adjusting default parameters of the target operator according to an optimal operator parameter combination adapted to target hardware performance parameters of a hardware platform currently running the target operator.
[0040] S130: running the target operator after adjusting parameters to perform the preprocessing operation on the original data.
[0041] It can be seen that in the embodiments of the present disclosure, when it is necessary to preprocess the original data based on the target operator, the preprocessing operation is no longer performed based on the default parameters of the target operator. Instead, the default parameters of the target operator are tuned according to the optimal operator parameter combination corresponding to the target hardware performance parameters of the hardware platform currently running the target operator, thereby ensuring that the target operator with adjusted parameters can ultimately be used to perform preprocessing operations on the original data, so that the performance of the target operator is optimized as much as possible under the current hardware environment, thereby improving the preprocessing efficiency of the original data and thereby improving the AI acceleration efficiency.
[0042] The above process will be described in detail below.
[0043] S110: Acquire original data to be preprocessed and an operator type corresponding to the preprocessing operation.
[0044] The raw data for preprocessing is the data that needs to be input into the AI model for AI reasoning in this AI reasoning task, which can be image data, voice data, text data, etc. Generally speaking, the raw data is directly or indirectly provided by the upper-layer application to the hardware platform running this method.
[0045] Optionally, the hardware platform may be a CPU, a GPU, or other processors with data processing capabilities, such as a VPU (Video Processing Unit).
[0046] Of course, for the implementation of the GPU as the hardware platform, the data pre-processed by the GPU can be directly decoded, calculated, and AI reasoned in the GPU. Compared with the method of performing pre-processing operations on the CPU, after the pre-processing operation is performed on the GPU, it is no longer necessary to transfer the pre-processed data between the CPU and the GPU, which greatly improves the efficiency of AI reasoning.
[0047] The operator used to perform preprocessing operations on the raw data before it is input into the AI model is the target operator corresponding to this preprocessing operation.
[0048] Among them, the preprocessing operation includes at least one of the following: data normalization, image scaling, cropping, rotation, inversion, padding, noise addition, denoising, equalization, resampling, vectorization, grayscale transformation, linear transformation, radial transformation, enhancement, etc.
[0049] In the disclosed embodiment, the operator library including various operators is deployed on the hardware platform, and after the hardware platform receives (or obtains) the raw data, the target operator pointed to by the operator type corresponding to the current preprocessing operation in the operator library is called to perform the preprocessing operation on the raw data. In other words, the target operator is determined according to the operator type required for the current preprocessing operation, and the operator types required for different preprocessing operations are not necessarily the same.
[0050] It is worth pointing out that when deploying the corresponding inference framework for the hardware platform, the model file of the AI model corresponding to the inference framework can be stored on the hardware platform or in the cloud so that the hardware platform can directly access or obtain it when necessary.
[0051] For AI models, their model files are generally yaml files, and the yaml file of the AI model will provide corresponding indications for information such as the target data type (i.e., data format) required by the AI model, the operator type corresponding to the preprocessing operations required for the input data of the AI model, and so on.
[0052] Based on this, when determining the operator type corresponding to this preprocessing operation, in some implementations, the model file of the target AI model that needs to perform the reasoning task based on the original data can be obtained, such as a yaml file, and the number of AI models docked to a hardware platform under normal circumstances is 1. After obtaining the model file, the operator type specified by the parsing result of the model file is obtained by parsing it. The operator type specified by the parsing result is the operator type corresponding to this preprocessing operation.
[0053] For example, by parsing the YAML file, we know that the operator type required by the AI model connected to the hardware platform is scale+normalize+toTensor.
[0054] In other embodiments, a hardware platform can be connected to a multimodal AI model, that is, multiple different AI models, and the operator library deployed on the hardware platform also includes a format conversion operator for converting the data format. Accordingly, when the hardware platform performs an AI reasoning task, the user needs to specify the target AI model for performing this AI reasoning task. In this case, when obtaining the operator type corresponding to the preprocessing operation, the target AI model that needs to perform the reasoning task based on the original data can be determined from the multimodal AI model according to the model type specified by the user for performing the reasoning task, and the model file corresponding to the target AI model can be obtained.
[0055] After obtaining the model file, the operator type specified by the parsing result of the model file is obtained by parsing it. In addition, it is also necessary to determine whether the data type of the original data is consistent with the target data type of the input data required by the target AI model based on the parsing result of the model file; if not, the operator type of the format conversion operator in the operator library and the operator type specified by the parsing result of the model file are used together as the operator type corresponding to this preprocessing operation.
[0056] For example, by parsing the yaml file, we know that the operator type required by the AI model connected to the hardware platform is scale+normalize+toTensor. In addition, the data type of the original data input this time is image, and the target data type required by the target AI model specified by the user is text. The image vector needs to be converted into a word vector through the format conversion operator before being input into the target AI model. In this case, the operator types of scale+normalize+toTensor and the format conversion operator are used as the operator types corresponding to this preprocessing operation.
[0057] S120: Adjusting default parameters of the target operator according to an optimal operator parameter combination adapted to target hardware performance parameters of a hardware platform currently running the target operator.
[0058] It is worth pointing out that in the embodiment of the present disclosure, an operator optimal parameter mapping table is pre-stored on the hardware platform or in the cloud, so that the hardware platform can directly / indirectly obtain the operator optimal parameter mapping table.
[0059] The operator optimal parameter mapping table stores the optimal operator parameter combinations corresponding to each operator under different hardware performance parameter environments. The hardware performance parameters may include at least one of the number of hardware computing groups, the number of parallel thread bundles, and the hardware model of the hardware platform. The optimal operator parameter combination may include at least one of the following: the operator workgroup size, the operator local memory size, the operator vectorization dimension, etc.
[0060] As for the optimal operator parameter combination corresponding to each operator in different hardware performance parameter environments, in some implementations, the performance of each operator in the operator library when corresponding to different operator parameter combinations are set in different hardware performance parameter environments can be tested in advance in an exhaustive manner by manual evaluation, and all possible operator parameter combinations of the operator can be traversed to determine the optimal operator parameter combination of the operator in each different hardware performance parameter environment, and record it to form a corresponding optimal parameter mapping table.
[0061] In other implementations, the optimal operator parameter combination of each operator under different hardware performance parameter environments may also be determined by integrating big data, and recorded to form a corresponding optimal parameter mapping table.
[0062] After the hardware platform obtains its own target hardware performance parameters, it can match the operator optimal parameter mapping table obtained this time or saved in advance based on the target hardware performance parameters to obtain and save the optimal operator parameter combination that is adapted to its own target hardware performance parameters, so as to subsequently adjust the default parameters of the target operator based on the optimal operator parameter combination.
[0063] In addition, in the prior art, when multiple operators are required to perform preprocessing operations, the corresponding operators are called in a certain order to perform corresponding preprocessing operations on the original data one by one. In this process, multiple data reading and output, i.e., data I / O, may be involved. Since data I / O takes a long time, multiple data I / O in the prior art also has a great impact on the efficiency of preprocessing.
[0064] In some embodiments of the present disclosure, in order to further improve the preprocessing efficiency, corresponding fusion operators may be generated separately for multiple operators in the operator library in advance, and an optimal parameter mapping table for each fusion operator may be preconfigured.
[0065] Specifically, a computation graph can be formed by defining the operation sequence between multiple operators and the operator parameter combinations of the corresponding operators into a data structure, and a fusion operator can be developed based on the computation graph.
[0066] Accordingly, on the basis of the existence of fusion operators, when the operator type corresponding to the current preprocessing operation is determined based on the model file, and the operator type is not unique, it can also be determined whether there is a fusion operator in the operator library that is fully compatible with the combined operator corresponding to the preprocessing operation to be executed this time. The combined operator is at least two operators among the operators pointed to by the operator type corresponding to the preprocessing operation to be executed this time.
[0067] For example, the operator types corresponding to the preprocessing operations to be performed this time include A+B+C, and correspondingly, the combination operators include: A+B, A+C, B+C, A+B+C. A fusion operator that is fully compatible with the combination operator means that the fusion operator is the same as any combination operator.
[0068] If the judgment is yes, the adapted combination operator is replaced by a fusion operator as the target operator or one of the target operators.
[0069] For example, the operator types corresponding to the preprocessing operation to be performed this time include A+B+C, and there is currently a fused operator A+B+C, then the fused operator A+B+C is directly used as the target operator.
[0070] For another example, the operator types corresponding to the preprocessing operation to be performed this time include A+B+C, and there is currently a fused operator A+B, then the fused operator A+B and operator C are used as target operators.
[0071] Among them, using a fusion operator instead of a common operator can fuse multiple preprocessing operations of multiple operators into one operator for execution, reducing the IO transmission time of data between different operators, thereby improving the preprocessing efficiency.
[0072] S130: running the target operator after adjusting parameters to perform the preprocessing operation on the original data.
[0073] In some embodiments, the operator library involved in the present disclosure and the operators included therein are developed based on the Opencl language and can be connected to a non-cuda operating environment. Accordingly, when the hardware platform is a GPU, the operator library involved in the present disclosure can be deployed on a GPU corresponding to a non-cuda operating environment, and the GPU corresponding to the non-cuda operating environment can implement all the pre-processing operations on the raw data involved in the above content based on the operator library.
[0074] In addition, please refer to Figure 2 The embodiment of the present disclosure further provides a data preprocessing device 400 , including an acquisition module 410 , an adjustment module 420 and an operation module 430 .
[0075] The acquisition module 410 is used to acquire the original data to be preprocessed and the operator type corresponding to the preprocessing operation.
[0076] The operator in the operator library corresponding to the operator type is the target operator.
[0077] The adjustment module 420 is used to adjust the default parameters of the target operator according to the optimal operator parameter combination adapted to the target hardware performance parameters of the hardware platform currently running the target operator.
[0078] The running module 430 is used to run the target operator after adjusting the parameters to perform the preprocessing operation on the original data.
[0079] In a feasible implementation of the present disclosure, the acquisition module 410 is also used to acquire the target hardware performance parameters, and match the pre-saved operator optimal parameter mapping table based on the target hardware performance parameters to obtain and save the optimal operator parameter combination adapted to the target hardware performance parameters; the operator optimal parameter mapping table stores the optimal operator parameter combination corresponding to each operator under different hardware performance parameter environments.
[0080] In a feasible implementation of the present disclosure, the optimal operator parameter combination includes at least one of the following: the workgroup size of the operator, the local memory size of the operator, and the vectorization dimension of the operator.
[0081] In a feasible implementation of the present disclosure, the acquisition module 410 is specifically used to obtain a model file of a target AI model used to perform an inference task based on the original data; parse the model file to obtain an operator type specified by a parsing result of the model file, and the operator type specified by the parsing result of the model file is the operator type corresponding to the preprocessing operation.
[0082] In a feasible implementation of the present disclosure, the hardware platform is used to connect to a multimodal AI model, and the operator library also includes a format conversion operator for converting the format of data; the acquisition module 410 is specifically used to determine, from the multimodal AI model, a target AI model for performing the reasoning task based on the original data according to the model type specified by the user for performing the reasoning task, and obtain a model file corresponding to the target AI model; parse the model file to obtain the operator type specified by the parsing result of the model file; determine, based on the parsing result of the model file, whether the data type of the original data is consistent with the target data type required to be input to the target AI model; in the event of inconsistency, use the operator type of the format conversion operator and the operator type specified by the parsing result of the model file together as the operator type corresponding to the preprocessing operation.
[0083] In a feasible implementation of the present disclosure, the device also includes a judgment module, which is used to judge whether there is a fusion operator in the operator library that is fully adapted to the combination operator corresponding to the preprocessing operation; the combination operator is at least two operators among the operators corresponding to the operator type corresponding to the preprocessing operation; if so, the combination operator is replaced by the fusion operator as the target operator or one of the target operators.
[0084] In a feasible implementation of the present disclosure, the operators in the operator library are developed based on the Opencl language, and the hardware platform is a GPU.
[0085] In addition, the embodiment of the present disclosure further provides a computer-readable storage medium, on which a data preprocessing program is stored, and when the data preprocessing program is executed, any of the above-mentioned data preprocessing methods is implemented. As for the specific execution process, reference can be made to the above-mentioned method embodiments, which will not be repeated here.
[0086] In addition, the embodiment of the present disclosure further provides a GPU chip, including a GPU and a memory, wherein a data preprocessing program is stored on the memory, and when the data preprocessing program is executed by the GPU, any of the above-mentioned data preprocessing methods is implemented. As for the specific execution process, reference can be made to the above-mentioned method embodiments, which will not be repeated here.
[0087] In addition, an embodiment of the present disclosure also provides an electronic component, including the above-mentioned GPU chip.
[0088] In some usage scenarios, the product form of the electronic component is a graphics card; in other usage scenarios, the product form of the electronic component is a CPU motherboard.
[0089] In addition, the embodiments of the present disclosure also provide an electronic device, including the above-mentioned electronic components. In some usage scenarios, the product form of the electronic device is a portable electronic device, such as a smart phone, a tablet computer, a VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, a game console, a workstation, a server, etc.
[0090] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.
[0091] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
[0092] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0093] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure rather than to limit its protection scope. Although the present disclosure has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present disclosure, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the disclosed claims to be approved.
Claims
1. A data preprocessing method, comprising: Obtaining raw data to be preprocessed and an operator type corresponding to the preprocessing operation; The operator in the operator library corresponding to the operator type is the target operator; adjusting the default parameters of the target operator according to an optimal operator parameter combination adapted to the target hardware performance parameters of the hardware platform currently running the target operator; The target operator after running the adjustment parameters performs the preprocessing operation on the original data.
2. The data preprocessing method according to claim 1, before adjusting the default parameters of the target operator, the method further comprises: The target hardware performance parameters are obtained, and a pre-saved operator optimal parameter mapping table is matched based on the target hardware performance parameters to obtain and save an optimal operator parameter combination that is adapted to the target hardware performance parameters; the operator optimal parameter mapping table stores the optimal operator parameter combinations corresponding to each operator under different hardware performance parameter environments.
3. According to the data preprocessing method of claim 1, the optimal operator parameter combination includes at least one of the following: the workgroup size of the operator, the local memory size of the operator, and the vectorization dimension of the operator.
4. According to the data preprocessing method of claim 1, the obtaining the operator type corresponding to the preprocessing operation comprises: Obtain a model file of a target AI model for performing an inference task based on the raw data; The model file is parsed to obtain an operator type specified by a parsing result of the model file, wherein the operator type specified by the parsing result of the model file is an operator type corresponding to the preprocessing operation.
5. According to the data preprocessing method of claim 1, the hardware platform is used to connect to a multimodal AI model, and the operator library also includes a format conversion operator for format conversion of data; the obtaining of the operator type corresponding to the preprocessing operation includes: According to the model type specified by the user for performing the reasoning task, determining a target AI model for performing the reasoning task based on the original data from the multimodal AI model, and acquiring a model file corresponding to the target AI model; Parsing the model file to obtain an operator type specified by a parsing result of the model file; According to the parsing result of the model file, determine whether the data type of the original data is consistent with the target data type required to be input to the target AI model; In case of inconsistency, the operator type of the format conversion operator and the operator type specified by the parsing result of the model file are taken together as the operator type corresponding to the preprocessing operation.
6. The data preprocessing method according to claim 1, further comprising: Determine whether there is a fusion operator in the operator library that is fully compatible with the combination operator corresponding to the preprocessing operation; The combination operator is at least two operators among the operators corresponding to the operator type corresponding to the preprocessing operation; If yes, the combination operator is replaced by the fusion operator as the target operator or one of the target operators.
7. According to any one of claims 1-6, the operators in the operator library are developed based on Opencl language, and the hardware platform is GPU.
8. A data preprocessing device, comprising: An acquisition module, used to acquire raw data to be preprocessed and the operator type corresponding to the preprocessing operation; The operator in the operator library corresponding to the operator type is the target operator; An adjustment module, configured to adjust the default parameters of the target operator according to an optimal operator parameter combination adapted to the target hardware performance parameters of the hardware platform currently running the target operator; An operation module is used to run the target operator after adjusting parameters to perform the preprocessing operation on the original data.
9. A computer-readable storage medium having a data preprocessing program stored thereon, wherein the data preprocessing program, when executed, implements the data preprocessing method according to any one of claims 1 to 7.
10. A GPU chip, comprising a GPU and a memory, wherein a data preprocessing program is stored in the memory, and when the data preprocessing program is executed by the GPU, the data preprocessing method according to any one of claims 1 to 7 is implemented.
11. An electronic component, comprising the GPU chip according to claim 10.
12. An electronic device comprising the electronic component according to claim 11.
Citation Information
Cited By
Target detection method and device, equipment and medium
CN121214182A
