Data updating method and device and electronic equipment

By reducing the OPSET version of the ONNX model, the problem of excessive OPSET version causing chip unsupportation is solved, and the success rate of the model deployment on the chip platform is improved.

CN119848061AActive Publication Date: 2025-04-18ZHEJIANG DAHUA TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510307982.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-04-18
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

When the OPSET version of the ONNX model is too high, the chip is not supported, so the ONNX operator cannot be converted into a chip-supported operator, and the actual deployment of the ONNX model cannot be realized.

Method used

By determining the minimum historical OPSET version of each operator in the original model and using it as the target OPSET version, replacing the original OPSET version of the original model, thereby reducing the OPSET version and increasing the conversion success rate of the ONNX model on the chip platform.

Benefits of technology

It improves the deployment success rate of ONNX model on the chip platform, and solves the problem of model conversion failure caused by excessive OPSET version.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848061A_ABST
    Figure CN119848061A_ABST
Patent Text Reader

Abstract

The invention provides a data updating method and device and electronic equipment, and relates to the technical field of data processing. In the application, firstly, a historical operator set OPSET version set of each operator contained in an original model is determined, then, a minimum historical OPSET version of each operator is screened out from the historical OPSET version set of each operator, and finally, a target OPSET version is selected from the minimum historical OPSET versions of each operator. According to the method, the original OPSET version of the original model is replaced with the target OPSET version, the conversion success rate of the ONNX model on a chip platform can be increased by reducing the OPSET version of the original model, and the deployment success rate of the model on the chip platform is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data updating method, device and electronic device. Background Art

[0002] The Open Neural Network Exchange (ONNX) format is an open file format designed for machine learning and is used to store trained models.

[0003] Based on ONNX, different deep learning training frameworks (for example, Tensorflow, Pytorch, Keras, MXNet, Caffe, MindSpore, etc.) can store model data in the same format and interact with each other, promoting interoperability between different deep learning frameworks.

[0004] After users use any deep learning training framework to train the target model, they will consider actually deploying the target model. When deploying the target model, the traditional way is to export the target model trained by the deep learning training framework as a model in ONNX format. When exporting the target model as a model in ONNX format, you need to specify an operator set OPSET version. The OPSET version determines the set of operators that can be used in the model. There may be compatibility issues between different OPSET versions. Therefore, when exporting the model, you need to ensure that the selected OPSET version is compatible with the OPSET version of the ONNX model currently in use.

[0005] Currently, the ONNX model can be sent to the model conversion compiler, which will convert the ONNX operators in the ONNX model into operators supported by the chip based on the OPSET information, operator properties, number of inputs, and other information in the ONNX model, thereby completing the actual deployment of the ONNX model.

[0006] However, when the OPSET version of the ONNX model to be deployed is too high, the model conversion compiler will be unable to convert the ONNX operator into an operator supported by the chip, and the actual deployment of the ONNX model will not be possible. Summary of the invention

[0007] The present invention application provides a data update method, device and electronic device to solve the problem that the ONNX model OPSET version is too high, resulting in the chip not supporting it and thus unable to convert, and improve the success rate of model deployment on the chip platform. The specific technical solution is as follows: In a first aspect, the present application provides a data updating method, comprising: Determine the historical operator set OPSET version set for each operator included in the original model; Filter out the lowest historical OPSET version of each operator from the historical OPSET version set of each operator; A target OPSET version is selected from the lowest historical OPSET version of each operator, and the original OPSET version of the original model is replaced with the target OPSET version.

[0008] Based on the above method, by calculating the lowest historical OPSET version of each operator of the original model, and determining the lowest OPSET version (target OPSET version) of the original model according to the lowest historical OPSET version of each operator, that is, lowering the OPSET version of the original model, the conversion success rate of the ONNX model on the chip platform can be increased, and the deployment success rate of the model on the chip platform can be improved.

[0009] In a possible implementation, the step of selecting the lowest historical OPSET version of each operator from the historical OPSET version set of each operator includes: Determine, from the historical OPSET version set, a first historical OPSET version with the smallest difference from the original OPSET version, and determine each historical OPSET version whose historical OPSET version is lower than or equal to the first historical OPSET version; Compare the historical OPSET versions with the first historical OPSET version to select the historical OPSET versions that meet the operator OPSET version selection condition; The lowest historical OPSET version among the historical OPSET versions to be selected is selected.

[0010] Based on the above method, the lowest historical OPSET version of each operator can be screened out from the historical OPSET version set of each operator to prepare data for the subsequent downgrading of the OPSET version of the original model.

[0011] In a possible implementation, the step of selecting the lowest historical OPSET version of each operator from the historical OPSET version set of each operator includes: In the historical OPSET version set, a base OPSET version is selected to obtain a remaining historical OPSET version set, wherein the base OPSET version represents the highest historical OPSET version of the operator available in the historical OPSET version set; Compare each remaining historical OPSET version in the remaining historical OPSET version set with the benchmark OPSET version, and select each remaining historical OPSET version that meets the operator OPSET version selection condition; And determine the lowest historical OPSET version from the remaining historical OPSET versions; wherein the operator OPSET version selection condition is: The operator functions of the remaining historical OPSET versions are compatible with the operator functions of the baseline OPSET version; The number and definition of operator inputs of the remaining historical OPSET versions are compatible with the number and definition of operator inputs of the baseline OPSET version; The operator attributes of the remaining historical OPSET versions are compatible with the operator attributes of the baseline OPSET version; The operator output number and definition of the remaining historical OPSET version are compatible with the operator output number and definition of the baseline OPSET version.

[0012] Based on the above method, the lowest historical OPSET version of each operator can be screened out from the historical OPSET version set of each operator to prepare data for the subsequent downgrading of the OPSET version of the original model.

[0013] In a possible implementation, selecting the target OPSET version from the lowest historical OPSET version of each operator includes: Determine the version number of the lowest historical OPSET version for each operator; The lowest historical OPSET version of each operator is sorted based on the version number, and the lowest historical OPSET version with the largest version number is selected as the target OPSET version.

[0014] Based on the above method, the target OPSET version can be selected from the lowest historical OPSET version of each operator to replace the original OPSET version of the original model, thereby improving the success rate of model deployment on the chip platform.

[0015] In a second aspect, the present application provides a data updating device, comprising: A data acquisition module is used to determine the version set of the historical operator set OPSET for each operator included in the original model; A data screening module, used to screen out the lowest historical OPSET version of each operator from the historical OPSET version set of each operator; The data updating module is used to select a target OPSET version from the lowest historical OPSET version of each operator, and replace the original OPSET version of the original model with the target OPSET version.

[0016] In a possible implementation, the data screening module is specifically used for: Determine, from the historical OPSET version set, a first historical OPSET version with the smallest difference from the original OPSET version, and determine each historical OPSET version whose historical OPSET version is lower than or equal to the first historical OPSET version; Compare the historical OPSET versions with the first historical OPSET version to select the historical OPSET versions that meet the operator OPSET version selection condition; The lowest historical OPSET version among the historical OPSET versions to be selected is selected.

[0017] In a possible implementation, the data screening module is further used for: In the historical OPSET version set, a base OPSET version is selected to obtain a remaining historical OPSET version set, wherein the base OPSET version represents the highest historical OPSET version of the operator available in the historical OPSET version set; Compare each remaining historical OPSET version in the remaining historical OPSET version set with the benchmark OPSET version, and select each remaining historical OPSET version that meets the operator OPSET version selection condition; And determine the lowest historical OPSET version from the remaining historical OPSET versions; wherein the operator OPSET version selection condition is: The operator functions of the remaining historical OPSET versions are compatible with the operator functions of the baseline OPSET version; The number and definition of operator inputs of the remaining historical OPSET versions are compatible with the number and definition of operator inputs of the baseline OPSET version; The operator attributes of the remaining historical OPSET versions are compatible with the operator attributes of the baseline OPSET version; The operator output number and definition of the remaining historical OPSET version are compatible with the operator output number and definition of the baseline OPSET version.

[0018] In a possible implementation, the data updating module is specifically used for: Determine the version number of the lowest historical OPSET version for each operator; The lowest historical OPSET version of each operator is sorted based on the version number, and the lowest historical OPSET version with the largest version number is selected as the target OPSET version.

[0019] In a third aspect, the present application provides an electronic device, including: Memory, used to store computer programs; The processor is used to implement the steps of the above-mentioned data updating method when executing the computer program stored in the memory.

[0020] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned data updating method are implemented.

[0021] For each aspect from the second to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of the OPSET version of the original model provided in the embodiment of the present application; Figure 2 A flowchart of a data updating method provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of the original model provided in the embodiment of the present application; Figure 4 One of the flow charts of the method for screening the lowest historical OPSET version provided in the embodiment of the present application; Figure 5 A second flowchart of the method for screening the lowest historical OPSET version provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of a data updating device provided in an embodiment of the present application; Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0024] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0025] The Open Neural Network Interchange Format is an open file format designed for machine learning and used to store trained models.

[0026] Based on ONNX, different deep learning training frameworks can store model data in the same format and interact with each other, promoting interoperability between different deep learning frameworks.

[0027] After users use any deep learning training framework to train the target model, they will consider actually deploying the target model. When deploying the target model, the traditional way is to export the target model trained by the deep learning training framework as a model in ONNX format. With the development of ONNX, different versions of operator sets (OPSET) are introduced, and each OPSET version contains different operators and functions.

[0028] When exporting the target model to an ONNX format model, you need to specify an OPSET version. The OPSET version determines the set of operators that can be used in the model. There may be compatibility issues between different OPSET versions. Therefore, when exporting the model, you need to ensure that the selected OPSET version is compatible with the OPSET version of the ONNX model currently in use.

[0029] Currently, the ONNX model can be sent to the model conversion compiler, which will convert the ONNX operators in the ONNX model into operators supported by the chip based on the OPSET information, operator properties, number of inputs, and other information in the ONNX model, thereby completing the actual deployment of the ONNX model.

[0030] However, when the OPSET version of the ONNX model to be deployed is too high, the model conversion compiler will be unable to convert the ONNX operator into an operator supported by the chip, and the actual deployment of the ONNX model will not be possible.

[0031] In view of this, in order to solve the problem that the chip does not support the ONNX model because the OPSET version is too high and cannot be converted, and to improve the success rate of model deployment on the chip platform, the present application provides a data update method, which specifically includes: first determining the historical operator set OPSET version set of each operator contained in the original model, and then screening out the lowest historical OPSET version of each operator from the historical OPSET version set of each operator, and finally selecting the target OPSET version from the lowest historical OPSET version of each operator, and replacing the original OPSET version of the original model with the target OPSET version.

[0032] This application calculates the lowest historical OPSET version of each operator of the original model, and determines the lowest OPSET version (target OPSET version) of the original model based on the lowest historical OPSET version of each operator, that is, lowers the OPSET version of the original model. This can increase the conversion success rate of the ONNX model on the chip platform and improve the deployment success rate of the model on the chip platform.

[0033] In order to facilitate the understanding of this solution, the following is an explanation of the relevant technical terms involved in this solution: Attributes: In ONNX, attributes are parameters specific to operators that describe the behavior and characteristics of these operators. Attributes can be required or optional parameters of operators, depending on the definition of the operator; in addition, attributes are often used to control the specific implementation of operators, for example, the stride and padding parameters set in convolution operations.

[0034] Layer input: In ONNX, input refers to the data passed to the layer. These inputs may come from the previous layer of the model, directly from the input data of the entire network, or may belong to weight data (for example, the weight of the convolution kernel and bias in the convolutional neural network).

[0035] In the embodiment of the present application, an operator in the ONNX model consists of the following parts: 1. Operator type: indicates the operator function, for example, the convolution operator (CONV).

[0036] 2. Attributes: Some parameters that describe how the operator is calculated, such as stride, padding, and other parameters.

[0037] 3. Input: Input can be divided into dynamic input and static input. Dynamic input means that this input comes from the output of other operators (that is, the input has a connection relationship with other operators), and the data is the result calculated when the previously connected layer is running, and the result is changing; static input means that the input has no connection relationship with other operators, but is a fixed value (weight), which is similar to the function of the attributes described above.

[0038] 4. Output: The output result after the operator completes the calculation when running, and the output result is dynamically transformed.

[0039] 5. OPSET: OPSET can be divided into model OPSET version and operator OPSET version. If a model OPSET version is specified in the ONNX model, the operator OPSET version corresponding to the model OPSET version is the operator version corresponding to the maximum OPSET value in the list of supported versions that meets the matching rules of the operator version. In addition, for different operator versions, the same operator type can have different input quantities, modify attribute definitions, and add or delete attributes. Therefore, the actual function of an operator must be determined based on the operator attributes and inputs when the operator OPSET version is determined.

[0040] The matching rules for operator versions are as follows: See attached Figure 1 As shown, assuming that the OPSET version of the original model is ai.onnx v14, if there are SOFTMAX operators 13, CONV operators 11, and MAXPOOL operators 12 in the model, then the operator version 13 that is less than or equal to version 14 and closest to this value will be matched as the OPSET version of the operator.

[0041] The inventive concept of the present application is described below: Taking the SOFTMAX operator as an example, assume that the operator has a total of 3 OPSET versions, version 1, 11 and 13.

[0042] The features supported in version 1 include: a single dynamic input, a single dynamic output, and support for a positive attribute axis, which indicates that all dimensions starting from axis are mixed and then the overall SOFTMAX calculation is performed.

[0043] Version 11 adds support for negative axis (the original positive axis is still valid). For example, -1 represents the last dimension. The calculation method has not changed compared to version 1.

[0044] In version 13, the axis range has not changed compared to version 1, but the operator definition (function) has changed, which means that SOFTMAX calculation is performed only on the dimension of the axis.

[0045] Based on the OPSET version description of the above historical operators, it can be seen that the functions of SOFTMAX operator version 11 and version 13 are incompatible, and the two versions cannot be directly replaced. However, the operator of version 11 is actually exactly the same as version 1 when non-negative numbers are filled in. Therefore, there is a possibility to change the operator OPSET version to achieve the same functional effect.

[0046] Reference Figure 2 As shown, it is a flow chart of a data updating method provided in an embodiment of the present application, the method comprising: S1, determine the historical operator set OPSET version set of each operator contained in the original model.

[0047] In the embodiments of this application, see the attached Figure 3 As shown, it is a schematic diagram of the structure of the original model. First, the original operator set OPSET version of the original model can be determined. For example, the original operator set OPSET version can be ai.onnxv15; then each operator contained in the original model and each respective historical operator set OPSET version set are determined. For example, the original model can include a sigmoid operator, a Relu operator, and a Clip operator. In order to facilitate the subsequent description of this solution, it is assumed that the respective historical OPSET version set of each operator is as follows: Sigmoid operator: Version 1: with consumed_inputs attribute; Version 6: Remove consumed_inputs attribute; Version 13: Same properties as version 6.

[0048] Relu operator: Version 1: with consumed_inputs attribute; Version 6: Remove consumed_inputs attribute; Version 13: Same properties as version 6.

[0049] Clip operator: Version 1: with 3 attributes, consumed_inputs, min and max attributes; Version 6: Removed the consumed_inputs attribute; Version 11: The attributes min and max are deleted and replaced with inputs. The number of inputs increases from 1 to 3, namely the original input, min input, and max input. Versions 13 and 12: Same as version 11.

[0050] It should be pointed out that each operator contained in the above original model and each operator's respective historical operator set OPSET version set are only used for illustration and do not constitute a limitation to the solution of the present application.

[0051] Through the above method, the original OPSET version of the original model (such as ai.onnx v15) can be determined, as well as each operator included in the original model and the historical OPSET version set of each operator.

[0052] S2, filter out the lowest historical OPSET version of each operator from the historical OPSET version set of each operator.

[0053] In the embodiments of this application, see the attached Figure 4 As shown, screening the lowest historical OPSET version of each operator of the original model may include the following steps: S401, determining a first historical OPSET version having the smallest difference with the original OPSET version from the historical OPSET version set, and determining each historical OPSET version whose operator version is lower than or equal to the first historical OPSET version; S402, comparing each historical OPSET version with the first historical OPSET version, and selecting each candidate historical OPSET version that meets the operator OPSET version selection condition; S403, screening out the lowest historical OPSET version among the historical OPSET versions to be selected.

[0054] In step S401, the original OPSET version of the original model is ai.onnx v15 (hereinafter referred to as original OPSET version 15), and for each sigmoid operator in the original model, the historical OPSET versions included in the sigmoid operator are: historical OPSET version 1, historical OPSET version 6, and historical OPSET version 13. When determining the first historical OPSET version with the smallest difference from the original OPSET version from the historical OPSET version set, specifically, historical OPSET version 13 can be selected as the first historical OPSET version, and the first historical OPSET version can be used as the subsequent determination criterion.

[0055] In the present application, while determining the first historical OPSET version, various historical OPSET versions whose historical OPSET versions are lower than or equal to the first historical OPSET version can also be determined, for example, historical OPSET version 1 and historical OPSET version 6.

[0056] In step S402, each historical OPSET version may be compared with the first historical OPSET version to select each candidate historical OPSET version that meets the operator OPSET version selection condition. Specifically, a historical OPSET version may be selected from each historical OPSET version in reverse order or order of the version number size to be compared with the first historical OPSET version to select each candidate historical OPSET version that meets the operator OPSET version selection condition. The present application does not impose any specific restrictions on the selection method of the historical OPSET version.

[0057] In the embodiment of the present application, when screening various historical OPSET versions to be selected that meet the operator OPSET version selection condition, the operator OPSET version selection condition is as follows: For any candidate historical OPSET version among the historical OPSET versions, for example, historical OPSET version 1.

[0058] First, it can be determined whether the operator function of the historical OPSET version to be selected is compatible with the operator function of the first historical OPSET version (historical OPSET version 13). If they are compatible, it means that the first condition for selecting the operator OPSET version is satisfied. If not, it jumps to the next historical OPSET version to be selected in each historical OPSET version (for example, historical OPSET version 6). Then it is determined whether the operator input number and definition of the historical OPSET version to be selected are compatible with the operator input number and definition of the first historical OPSET version. If they are compatible, it means that the second condition for selecting the operator OPSET version is satisfied. If not, it jumps to the next historical OPSET version in each historical OPSET version. a historical OPSET version to be selected; then determine whether the operator attributes of the historical OPSET version to be selected are compatible with the operator attributes of the first historical OPSET version. If they are compatible, it means that the third condition for selecting the operator OPSET version is satisfied. If not, jump to the next historical OPSET version to be selected in each historical OPSET version; finally, determine whether the operator output number and definition of the historical OPSET version to be selected are compatible with the operator output number and definition of the first historical OPSET version. If they are compatible, it means that the fourth condition for selecting the operator OPSET version is satisfied. If not, jump to the next historical OPSET version to be selected in each historical OPSET version.

[0059] When the historical OPSET version to be selected satisfies the first condition, the second condition, the third condition and the fourth condition for selecting the operator OPSET version, it can be determined that the historical OPSET version to be selected satisfies the operator OPSET version selection conditions. This application does not impose any specific restrictions on the number of operator OPSET version selection conditions and the comparison order between the historical OPSET version to be selected and the first historical OPSET version.

[0060] In step S403, refer to the attached Figure 5 Combined with the above examples, historical OPSET versions 1 and 13 have the same functions, which meet the operator function compatibility requirements; the number of operator inputs of historical OPSET versions 1 and 13 is the same, and the definition has not changed, which meets the compatibility requirements; the operator attributes of historical OPSET versions 1 and 13 are incompatible, and historical OPSET version 1 contains the consumed_inputs attribute. Therefore, historical OPSET version 1 does not meet the operator OPSET version selection conditions.

[0061] Furthermore, historical OPSET version 6 is taken as a candidate historical OPSET version for comparison with the first historical OPSET version. The operator functions of historical OPSET version 6 and 13 are the same, which meets the compatibility requirements; the number of operator inputs of historical OPSET version 6 and 13 is the same, and the definition has not changed, which meets the compatibility requirements; the operator attributes of historical OPSET version 6 and 13 are completely consistent, which meets the compatibility requirements; the number of operator outputs of historical OPSET version 6 and 13 is the same, and the definition has not changed, which meets the compatibility requirements. Therefore, historical OPSET version 6 meets the operator OPSET version selection conditions, and historical OPSET version 6 can be used as the minimum historical OPSET version of the sigmoid operator.

[0062] Based on the above method, the lowest historical OPSET version of the sigmoid operator in the original model can be determined.

[0063] In an embodiment of the present application, after determining the lowest historical OPSET version of the sigmoid operator, based on the above-mentioned operator OPSET version selection condition which is the same as that of the sigmoid operator, the remaining Relu operators and Clip operators in the original model can be traversed.

[0064] The process of determining the lowest historical OPSET version of the Relu operator is as follows: The Relu operator has three OPSET versions: historical OPSET versions 1, 6, and 13; the operator version 13, which is closest to the original OPSET version 15, is used as the (first historical OPSET version) judgment benchmark: Starting from historical OPSET version 1 (historical OPSET version 1 is the candidate historical OPSET version), it is determined that historical OPSET version 1 and 13 have the same functions and meet the compatibility requirements; then the number of operator inputs is determined. The number of operator inputs is the same and the definition has not changed, which meets the compatibility requirements; then the operator attributes are determined. The operator attributes of historical OPSET version 1 and 13 are incompatible. Historical OPSET version 1 contains the consumed_inputs attribute. Therefore, historical OPSET version 1 does not meet the operator OPSET version selection conditions.

[0065] Start by determining version 6 (historical OPSET version 6 is selected as the historical OPSET version to be selected). Version 6 and 13 operators have the same functions and meet the compatibility requirements. Next, determine the number of operator inputs. The number of operators is the same, and the definition has not changed, which meets the compatibility requirements. Next, determine the operator attributes. The operator attribute requirements are completely consistent, which meets the compatibility requirements. Next, determine the number of operator outputs. The number is the same, and the definition has not changed, which meets the compatibility requirements. Therefore, historical OPSET version 6 meets the operator OPSET version selection conditions, and historical OPSET version 6 can be used as the minimum historical OPSET version of the Relu operator.

[0066] Based on the above method, the lowest historical OPSET version of the Relu operator in the original model can be determined.

[0067] The process of determining the lowest historical OPSET version of the Clip operator is as follows: The Clip operator has five OPSET versions: historical OPSET versions 1, 6, 11, 12, and 13; the operator version 13, which is closest to the original OPSET version 15, is used as the (first historical OPSET version) judgment benchmark: Starting from historical OPSET version 1 (historical OPSET version 1 is the candidate historical OPSET version), it is determined that historical OPSET version 1 and 13 have the same functions and meet the compatibility requirements; then the number of operator inputs is determined. The number of operator inputs is the same and the definition has not changed, which meets the compatibility requirements; then the operator attributes are determined. The operator attributes of historical OPSET version 1 and 13 are incompatible. Historical OPSET version 1 contains the consumed_inputs attribute. Therefore, historical OPSET version 1 does not meet the operator OPSET version selection conditions.

[0068] Start judging version 6 (historical OPSET version 6 is selected as the historical OPSET version to be selected). Version 6 and 13 operators have the same functions and meet the compatibility requirements. Next, judge the number of operator inputs. The number of operator inputs of historical OPSET version 6 is 1, while the number of inputs of historical OPSET version 13 is 3. Therefore, historical OPSET version 6 does not meet the operator OPSET version selection conditions. Start to determine version 11 (historical OPSET version 11 is selected as the historical OPSET version). The functions of operators in versions 11 and 13 are the same, which meets the compatibility requirements. Next, determine the number of operator inputs. The number of operators is the same, and the definition has not changed, which meets the compatibility requirements. Next, determine the operator attributes. The operator attribute requirements are completely consistent, which meets the compatibility requirements. Next, determine the number of operator outputs. The number is the same, and the definition has not changed, which meets the compatibility requirements. Therefore, historical OPSET version 11 meets the operator OPSET version selection conditions, and historical OPSET version 11 can be used as the minimum historical OPSET version of the Clip operator.

[0069] Through the above method, the lowest historical OPSET version of the Clip operator in the original model can be determined.

[0070] In an embodiment of the present application, when traversing the lowest historical OPSET version of the second Sigmoid operator, the above-mentioned method of traversing the lowest historical OPSET version of the first Sigmoid operator can be referred to, which will not be repeated here.

[0071] Through the above method, the lowest historical OPSET version of each operator of the original model can be screened out.

[0072] In a possible implementation, when screening out the lowest historical OPSET version of each operator, the following method can also be used: First, a benchmark OPSET version is selected from the historical OPSET version set to obtain the remaining historical OPSET version set, wherein the benchmark OPSET version represents the highest historical OPSET version of the operator available in the historical OPSET version set. The benchmark OPSET version can be selected in the same manner as the first historical OPSET version, which will not be described in detail here. Then, each remaining historical OPSET version in the remaining historical OPSET version set is compared with the benchmark OPSET version to select the remaining historical OPSET versions that meet the operator OPSET version selection condition. The operator OPSET version selection condition and comparison method are the same as above and will not be repeated here. Finally, the lowest historical OPSET version is determined from the remaining historical OPSET versions; the operator OPSET version selection condition is: The operator functions of the remaining historical OPSET versions are compatible with the operator functions of the baseline OPSET version; The operator input numbers and definitions of the remaining historical OPSET versions are compatible with the operator input numbers and definitions of the baseline OPSET version; The operator properties of the remaining historical OPSET versions are compatible with the operator properties of the baseline OPSET version; The operator output numbers and definitions of the remaining historical OPSET versions are compatible with the operator output numbers and definitions of the baseline OPSET version.

[0073] Through the above method, the lowest historical OPSET version of each operator of the original model can be screened out.

[0074] S3, select the target OPSET version from the lowest historical OPSET version of each operator, and replace the original OPSET version of the original model with the target OPSET version.

[0075] In an embodiment of the present application, when selecting the target OPSET version from the lowest historical OPSET version of each operator, specifically, the version number of the lowest historical OPSET version of each operator can be first determined, for example, Sigmoid (6) -> Relu (6) -> Clip (11) -> Sigmoid (6); then the lowest historical OPSET version of each operator is sorted according to the version number, and finally the lowest historical OPSET version with the largest version number is selected as the target OPSET version, for example, OPSET version 11.

[0076] In summary, by calculating the lowest historical OPSET version of each operator of the original model and determining the lowest OPSET version of the original model based on the lowest historical OPSET version of each operator, this method of reducing the OPSET version of the original model can increase the conversion success rate of the ONNX model on the chip platform and improve the success rate of model deployment on the chip platform.

[0077] Based on the method provided in the above embodiment, the embodiment of the present application also provides a data updating device, such as Figure 6 The figure is a schematic diagram of the structure of a data updating device in an embodiment of the present application, the device comprising: A data acquisition module 601 is used to determine a set of historical operator sets OPSET versions of each operator included in the original model; The data screening module 602 is used to screen out the lowest historical OPSET version of each operator from the historical OPSET version set of each operator.

[0078] The data updating module 603 is used to select a target OPSET version from the lowest historical OPSET version of each operator, and replace the original OPSET version of the original model with the target OPSET version.

[0079] In a possible implementation, the data screening module 602 is specifically used for: Determine, from the historical OPSET version set, a first historical OPSET version with the smallest difference from the original OPSET version, and determine each historical OPSET version whose historical OPSET version is lower than or equal to the first historical OPSET version; Compare the historical OPSET versions with the first historical OPSET version to select the historical OPSET versions that meet the operator OPSET version selection condition; The lowest historical OPSET version among the historical OPSET versions to be selected is selected.

[0080] In a possible implementation, the data screening module 602 is further used to: In the historical OPSET version set, a base OPSET version is selected to obtain a remaining historical OPSET version set, wherein the base OPSET version represents the highest historical OPSET version of the operator available in the historical OPSET version set; Compare each remaining historical OPSET version in the remaining historical OPSET version set with the benchmark OPSET version, and select each remaining historical OPSET version that meets the operator OPSET version selection condition; And determine the lowest historical OPSET version from the remaining historical OPSET versions; wherein the operator OPSET version selection condition is: The operator functions of the remaining historical OPSET versions are compatible with the operator functions of the baseline OPSET version; The number and definition of operator inputs of the remaining historical OPSET versions are compatible with the number and definition of operator inputs of the baseline OPSET version; The operator attributes of the remaining historical OPSET versions are compatible with the operator attributes of the baseline OPSET version; The operator output number and definition of the remaining historical OPSET version are compatible with the operator output number and definition of the baseline OPSET version.

[0081] In a possible implementation, the data updating module 603 is specifically used for: Determine the version number of the lowest historical OPSET version for each operator; The lowest historical OPSET version of each operator is sorted based on the version number, and the lowest historical OPSET version with the largest version number is selected as the target OPSET version.

[0082] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application, and the electronic device can realize the function of the aforementioned data updating device, referring to Figure 7 , the electronic device comprises: At least one processor 701, and a memory 702 connected to the at least one processor 701. The specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present application. Figure 7 In the example, the processor 701 and the memory 702 are connected via a bus 700. Figure 7 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 700 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 7 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 701 can also be called a controller, and there is no limitation on the name.

[0083] In the embodiment of the present application, the memory 702 stores instructions that can be executed by at least one processor 701. The at least one processor 701 can execute the data updating method discussed above by executing the instructions stored in the memory 702. The processor 701 can implement Figure 6 The functions of each module in the device shown.

[0084] Among them, the processor 701 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 702 and calling data stored in the memory 702, the various functions of the device and process data, the device can be monitored as a whole.

[0085] In one possible design, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0086] Processor 701 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the data update method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0087] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 702 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0088] By designing and programming the processor 701, the code corresponding to the data updating method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2 The steps of the data updating method of the embodiment shown are as follows: How to design and program the processor 701 is a technique well known to those skilled in the art and will not be described in detail here.

[0089] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the data updating method discussed above.

[0090] In some possible implementations, various aspects of the data update method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of the data update method according to various exemplary implementations of the present application described above in this specification.

[0091] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0092] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 generate 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.

[0093] 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.

[0094] 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 The steps for the functions specified in one or more boxes.

[0095] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data updating method, characterized in that: include: Determine the historical operator set OPSET version set for each operator included in the original model; Filter out the lowest historical OPSET version of each operator from the historical OPSET version set of each operator; A target OPSET version is selected from the lowest historical OPSET version of each operator, and the original OPSET version of the original model is replaced with the target OPSET version.

2. The method according to claim 1, characterized in that The step of selecting the lowest historical OPSET version of each operator from the historical OPSET version set of each operator includes: Determine, from the historical OPSET version set, a first historical OPSET version with the smallest difference from the original OPSET version, and determine each historical OPSET version whose historical OPSET version is lower than or equal to the first historical OPSET version; Compare the historical OPSET versions with the first historical OPSET version to select the historical OPSET versions that meet the operator OPSET version selection condition; The lowest historical OPSET version among the historical OPSET versions to be selected is selected.

3. The method according to claim 1, characterized in that The step of selecting the lowest historical OPSET version of each operator from the historical OPSET version set of each operator includes: In the historical OPSET version set, a base OPSET version is selected to obtain a remaining historical OPSET version set, wherein the base OPSET version represents the highest historical OPSET version of the operator available in the historical OPSET version set; Compare each remaining historical OPSET version in the remaining historical OPSET version set with the benchmark OPSET version, and select each remaining historical OPSET version that meets the operator OPSET version selection condition; Determine the lowest historical OPSET version from the remaining historical OPSET versions; wherein the operator OPSET version selection condition is: The operator functions of the remaining historical OPSET versions are compatible with the operator functions of the baseline OPSET version; The number and definition of operator inputs of the remaining historical OPSET versions are compatible with the number and definition of operator inputs of the baseline OPSET version; The operator attributes of the remaining historical OPSET versions are compatible with the operator attributes of the baseline OPSET version; The operator output number and definition of the remaining historical OPSET version are compatible with the operator output number and definition of the baseline OPSET version.

4. The method according to claim 1, characterized in that The step of selecting a target OPSET version from the lowest historical OPSET version of each operator includes: Determine the version number of the lowest historical OPSET version for each operator; The lowest historical OPSET version of each operator is sorted based on the version number, and the lowest historical OPSET version with the largest version number is selected as the target OPSET version.

5. A data updating device, characterized in that: include: A data acquisition module is used to determine the version set of the historical operator set OPSET for each operator included in the original model; A data screening module, used to screen out the lowest historical OPSET version of each operator from the historical OPSET version set of each operator; The data updating module is used to select a target OPSET version from the lowest historical OPSET version of each operator, and replace the original OPSET version of the original model with the target OPSET version.

6. The device according to claim 5, characterized in that The data screening module is specifically used for: Determine, from the historical OPSET version set, a first historical OPSET version with the smallest difference from the original OPSET version, and determine each historical OPSET version whose historical OPSET version is lower than or equal to the first historical OPSET version; Compare the historical OPSET versions with the first historical OPSET version to select the historical OPSET versions that meet the operator OPSET version selection condition; The lowest historical OPSET version among the historical OPSET versions to be selected is selected.

7. The device according to claim 6, characterized in that The data screening module is also used for: In the historical OPSET version set, a base OPSET version is selected to obtain a remaining historical OPSET version set, wherein the base OPSET version represents the highest historical OPSET version of the operator available in the historical OPSET version set; Compare each remaining historical OPSET version in the remaining historical OPSET version set with the benchmark OPSET version, and select each remaining historical OPSET version that meets the operator OPSET version selection condition; And determine the lowest historical OPSET version from the remaining historical OPSET versions; wherein the operator OPSET version selection condition is: The operator functions of the remaining historical OPSET versions are compatible with the operator functions of the baseline OPSET version; The number and definition of operator inputs of the remaining historical OPSET versions are compatible with the number and definition of operator inputs of the baseline OPSET version; The operator attributes of the remaining historical OPSET versions are compatible with the operator attributes of the baseline OPSET version; The operator output number and definition of the remaining historical OPSET version are compatible with the operator output number and definition of the baseline OPSET version.

8. The device according to claim 5, characterized in that The data updating module is specifically used for: Determine the version number of the lowest historical OPSET version for each operator; The lowest historical OPSET version of each operator is sorted based on the version number, and the lowest historical OPSET version with the largest version number is selected as the target OPSET version.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method steps of any one of claims 1 to 4 when executing the computer program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Rules driven software deployment agent

    CA3072907A1

  • Model deployment method, model deployment device, terminal equipment and readable storage medium

    CN113220457A

  • Model deployment method and device, model operation method and device, medium and electronic equipment

    CN115658083A

  • Deep learning model deployment method and device

    CN116739040A

  • Update program and program update device

    JP2009193418A