Conversion platform and method of artificial intelligence model, electronic equipment and storage medium
By automatically performing format conversion, performance analysis, and inference testing through an artificial intelligence model conversion platform, the deployment challenges of various AI models and devices in existing technologies have been solved, achieving efficient and reliable AI model deployment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING GUANGYA HONGDAO OPERATING SYSTEM CO LTD
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies cannot effectively perform AI model format conversion, performance analysis, and inference testing for various types of AI models and various types of devices used to deploy AI models, resulting in high deployment difficulty and low efficiency.
An artificial intelligence model conversion platform is provided, including a model upload module, a parameter configuration module, a model compilation module, a performance analysis module, and an inference testing module. By obtaining compilation parameters and the type of target device, it automatically performs format conversion, performance analysis, and inference testing, supporting multiple types of AI models and devices.
It improves the deployment efficiency and reliability of AI models on hardware platforms, simplifies the conversion and adaptation process, reduces deployment difficulty, and enhances the efficiency of format conversion, performance analysis, and inference testing.
Smart Images

Figure CN121879771A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, and in particular relates to an artificial intelligence model conversion platform, method, electronic device and storage medium. Background Technology
[0002] In related technologies, artificial intelligence (AI) models need to be converted into a format supported by the hardware platform before deployment to different hardware platforms. However, existing model conversion methods typically only convert visual models and specific types of devices used to deploy AI models. Therefore, how to achieve format conversion, performance analysis, and inference testing of AI models for multiple types of AI models and multiple types of devices used to deploy AI models has become a pressing technical challenge in this field. Summary of the Invention
[0003] This invention aims to address at least one of the technical problems existing in the prior art. To this end, this invention proposes an artificial intelligence model conversion platform, method, electronic device, and storage medium, capable of performing format conversion, performance analysis, and inference testing of AI models for various types of AI models and various types of devices used to deploy AI models.
[0004] Firstly, this application provides a platform for converting artificial intelligence models, the platform comprising: The model upload module is used to obtain the source AI model to be transformed in response to the first input; The parameter configuration module is used to obtain the compilation parameters of the source artificial intelligence model and the type of the target device for deploying the transformed target artificial intelligence model in response to the second input; The model compilation module is used to compile the source artificial intelligence model based on the type of the target device and the compilation parameters, and to obtain the target artificial intelligence model if the compilation is successful. The performance analysis module is used to perform performance analysis on the target artificial intelligence model based on the type of the target device. The inference testing module is used to perform inference testing on the target artificial intelligence model based on verification data, provided that the performance analysis results meet the first target condition.
[0005] According to the AI model conversion platform of this application, by obtaining the compilation parameters of the source AI model and the type of the target device, and by selecting different compilation parameters and target device types, it is possible to convert the format of AI models for various types of AI models and various types of devices or hardware platforms used to deploy AI models. This reduces the difficulty of deploying AI models on hardware platforms. Furthermore, by automatically performing performance analysis on the target AI model based on the type of the target device when compilation is successful, and by automatically performing inference testing on the target AI model when performance analysis is successful, compared with the methods in related technologies that require users to manually perform performance analysis and inference testing, it can greatly improve the efficiency of AI model format conversion, performance analysis, inference testing and deployment, improve the reliability of AI model deployment results, and make AI model conversion and adaptation simpler and more convenient.
[0006] According to one embodiment of this application, the platform further includes: A data processing module is used to acquire raw data in response to a third input; convert the raw data into verification data in Python dictionary format; the format of the raw data includes at least one of image format, audio format, text format and npy format.
[0007] According to one embodiment of this application, the platform further includes: The results display module is used to visualize the results of the performance analysis and the results of the inference test.
[0008] According to one embodiment of this application, the compilation parameters include at least one of the following: target format of the target artificial intelligence model, truncation tensor parameters, truncation input-output parameters, full quantization type, quantization type of weights, quantization input-output parameters, and quantization type of input and output; the truncation tensor parameters are used to indicate whether the tensors in the source artificial intelligence model are truncated to the target length; the truncation input-output parameters are used to indicate whether the input and output of the source artificial intelligence model are truncated to the target length; and the quantization input-output parameters are used to indicate whether the input and output of the source artificial intelligence model are quantized.
[0009] Secondly, this application provides a method for converting an artificial intelligence model, the method comprising: In response to the first input, obtain the source AI model to be transformed; In response to the second input, the compilation parameters of the source AI model and the type of the target device for deploying the transformed target AI model are obtained; Based on the type of the target device and the compilation parameters, the source artificial intelligence model is compiled, and if the compilation is successful, the target artificial intelligence model is obtained. Performance analysis of the target artificial intelligence model based on the type of the target device; If the performance analysis results meet the first objective condition, the target artificial intelligence model is subjected to inference testing based on the verification data.
[0010] According to the AI model conversion method of this application, by obtaining the compilation parameters of the source AI model and the type of the target device, and by selecting different compilation parameters and target device types, the format conversion of AI models can be achieved for various types of AI models and various types of devices or hardware platforms used to deploy AI models. This reduces the difficulty of deploying AI models on hardware platforms. Furthermore, by automatically performing performance analysis on the target AI model based on the type of the target device when compilation is successful, and by automatically performing inference testing on the target AI model when performance analysis is successful, compared with the related technologies that require users to manually perform performance analysis and inference testing, the efficiency of AI model format conversion, performance analysis, inference testing, and deployment can be greatly improved, the reliability of AI model deployment results can be enhanced, and the conversion and adaptation of AI models is simpler and more convenient.
[0011] According to one embodiment of this application, after the performance analysis of the target artificial intelligence model based on the type of the target device, the method further includes: If the performance analysis results do not meet the first target condition, analyze the performance analysis logs and output visualized analysis results.
[0012] According to one embodiment of this application, before performing inference testing on the target artificial intelligence model based on verification data, the method further includes: In response to a third input, raw data is acquired; the format of the raw data includes at least one of image format, audio format, text format, and npy format; The raw data is converted into the verification data in Python dictionary format.
[0013] According to one embodiment of this application, after performing inference testing on the target artificial intelligence model based on verification data, the method further includes: If the result of the inference test satisfies the second objective condition, the target artificial intelligence model is output in response to the fourth input.
[0014] According to one embodiment of this application, after performing inference testing on the target artificial intelligence model based on verification data, the method further includes: If the result of the inference test does not meet the second objective condition, analyze the log of the inference test and output a visualized analysis result.
[0015] According to the AI model conversion method of this application, by obtaining the compilation parameters of the source AI model, the compilation parameters can indicate the type of AI model and the type of target device, etc., so by selecting different compilation parameters, the format conversion of AI models can be realized for various types of AI models and various types of devices or hardware platforms used to deploy AI models, making the conversion and adaptation of AI models simpler and more convenient.
[0016] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the artificial intelligence model conversion method as described in the second aspect above.
[0017] Fourthly, this application provides a non-volatile computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the artificial intelligence model conversion method as described in the second aspect above.
[0018] Fifthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the artificial intelligence model conversion method as described in the second aspect above.
[0019] Sixthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the artificial intelligence model conversion method as described in the second aspect above.
[0020] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0021] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a schematic diagram of the structure of the artificial intelligence model conversion platform provided in the embodiments of this application; Figure 2 This is one of the flowcharts illustrating the conversion method of the artificial intelligence model provided in the embodiments of this application; Figure 3 This is a second schematic flowchart of the artificial intelligence model conversion method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0023] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0024] The following description, in conjunction with the accompanying drawings, details the artificial intelligence model conversion platform, artificial intelligence model conversion method, electronic device, and readable storage medium provided in this application embodiment through specific embodiments and application scenarios.
[0025] like Figure 1 As shown, the conversion platform for this artificial intelligence model includes: a model upload module 110, a parameter configuration module 120, a model compilation module 130, a performance analysis module 140, and an inference testing module 150.
[0026] In actual implementation, the AI model conversion platform may include components such as a model upload module 110, a parameter configuration module 120, a model compilation module 130, a performance analysis module 140, and an inference testing module 150.
[0027] The model upload module 110 is used to obtain the source artificial intelligence model to be converted in response to the first input.
[0028] In actual execution, the model upload module 110 can receive the user's first input and obtain the artificial intelligence model to be converted based on the user's first input. This artificial intelligence model is the source model before conversion and can therefore be called the source artificial intelligence model.
[0029] In some embodiments, the user's first input may be used to upload the source artificial intelligence model to an electronic device or a functional module or functional entity within the electronic device, which is the subject of the conversion method of the artificial intelligence model.
[0030] In some embodiments, the first input may be an input form including at least one of click input, drag operation, voice input, and drop-down menu selection operation. This application does not specifically limit the form of the first input.
[0031] In some embodiments, the model upload module 110 can respond to a first input by calling a first interface to obtain the source artificial intelligence model. The first interface can be an Application Programming Interface (API) for uploading model files. It is understood that the artificial intelligence model can be stored in the form of a model file. The model file can be used to store information such as the structure and weights of the artificial intelligence model. The structure of the artificial intelligence model can be represented as a model graph or a computation graph. By filling the weights into the corresponding positions in the model graph or computation graph, a complete representation of the artificial intelligence model can be obtained.
[0032] In some embodiments, the source AI model may be at least one of the following types of AI models: computer vision (CV) model, automatic speech recognition (ASR) model, large language model (LLM), and text-to-speech (TTS) model.
[0033] In some embodiments, the format of the model file of the source AI model can be regarded as the format of the source AI model. The format of the model file of the source AI model can be any one of the following: Open Neural Network Exchange (ONNX) format, AI Model Efficiency Toolkit (AIMET) format, and TFLite format.
[0034] The parameter configuration module 120 is used to obtain the compilation parameters of the source artificial intelligence model and the type of the target device for deploying the transformed target artificial intelligence model in response to the second input.
[0035] In actual execution, before compiling the source AI model and performing format conversion, compilation parameters and the type of the target device can be configured or selected. The configuration or selection of compilation parameters and the type of the target device can be achieved through user input. The parameter configuration module 120 can receive a second user input and, based on this second user input, obtain the compilation parameters of the source AI model and the type of the target device.
[0036] In some embodiments, compilation parameters are parameters required to compile the artificial intelligence model. The number of compilation parameters can be one or more. This application does not limit the specific compilation parameters.
[0037] In some embodiments, the target device is a device used to deploy the transformed target AI model. The target device is a hardware platform that runs the target AI model. The type of the target device can be its processor or system-on-chip (SoC). In some embodiments, the type of the target device may include sdm845, sdm670, sm8150, sm7150-ab, sm7250, sm8250-ab, sdm429, sm8350, sm6150-ac, sdm670, sm7150-ab, sm7250, sm7325, QCS6490-proxy, QCS8250-proxy, QCS8550-proxy, sm8450, and QCS84. There are at least dozens of types, including 50-proxy, sm8550, sa8650p-proxy, sa8775p-proxy, sa8255p-proxy, sm8650, sm8650, sm8750-ac, sc8280x, sc8380xp, sc8340xp, sm8750, sa8295p, Qualcomm-sa7255p, QCS9075-proxy, and QCS8275-proxy.
[0038] In some embodiments, the second input may be an input form including at least one of click input, drag operation, voice input, and drop-down menu selection operation. This application does not specifically limit the form of the second input.
[0039] In some embodiments, the parameter configuration module 120 may, in response to a second input, call a second interface to obtain the compilation parameters of the source artificial intelligence model and the type of the target device. In some embodiments, the second interface may be an application programming interface for obtaining compilation options (which may include options for various compilation parameters and options for the type of the target device).
[0040] It should be noted that the AI model format conversion in related technologies is performed by an AI model conversion platform, which cannot select the aforementioned compilation parameters. That is, the AI model conversion platform in related technologies can only compile according to pre-set compilation parameters and does not support the multiple compilation parameter settings in the embodiments of this application. Furthermore, the AI model conversion platforms in related technologies support a very limited number of target device types, typically only supporting a few specific types.
[0041] The model compilation module 130 is used to compile the source artificial intelligence model based on the type of the target device and the compilation parameters, and to obtain the target artificial intelligence model if the compilation is successful.
[0042] In actual execution, the model compilation module 130 can call the third interface to compile the source AI model based on the configured compilation parameters and the type of the target device, and perform the operation of converting the source AI model into the target AI model. In some embodiments, the third interface can be an application programming interface for initiating model compilation.
[0043] The source AI model is successfully compiled, thus obtaining the target AI model. In other words, the successful source AI model is converted into the target AI model, which can be deployed on the target device and run on the target device.
[0044] It should be noted that most AI model conversion platforms in the relevant technologies only perform format conversion for computer vision models, and can only support the conversion of AI models into a limited number of specific hardware platforms. There is still a lack of AI model conversion platforms that can well support the conversion of AI models of types such as ASR, LLM, or TTS into hardware platforms that can be deployed on user-selected hardware platforms.
[0045] The performance analysis module 140 is used to perform performance analysis on the target artificial intelligence model based on the type of the target device.
[0046] In actual execution, after the source AI model is successfully compiled, the performance analysis module 140 can automatically perform performance analysis on the target AI model to test whether the performance of the target AI model meets the requirements.
[0047] In some embodiments, the performance analysis module 140 performs performance analysis on the target artificial intelligence model based on the type of the target device, which can be used to obtain the performance of the target device running the target artificial intelligence model.
[0048] In some embodiments, the performance analysis module 140 can use the compiled target artificial intelligence model as input, call the fourth interface, and analyze the performance of the target device running the target artificial intelligence model. In some embodiments, the fourth interface can be an application programming interface for initiating performance analysis.
[0049] In some embodiments, the results of performance analysis may include at least one of the following performance parameters: total inference time, peak memory usage, number of inferences, average inference time, model loading time, operator execution distribution time, and average execution time, minimum execution time, maximum execution time, number of executions, and average cycle time for each operator. In other words, the performance of the target artificial intelligence model can be indicated using the aforementioned performance parameters.
[0050] In some embodiments, after obtaining the performance analysis results of the target artificial intelligence model, it can be determined whether the performance analysis results of the target artificial intelligence model meet the first objective condition. If they do, the performance analysis is successful; otherwise, the performance analysis fails.
[0051] In some embodiments, the first target condition can be set based on user needs, etc. The specific first target condition is not limited in the embodiments of this application. For example, the first target condition may include a model loading time less than a first time threshold, an average inference time less than a second time threshold, and peak memory usage less than a target threshold; or, the first target condition may include a maximum inference time less than a third time threshold, etc.
[0052] Understandably, performance analysis aims to analyze the performance and resource consumption of the compiled target AI model on the actual target device. For example: the target device type is QCS8550, the target artificial intelligence model type is ASR model (the same as the source artificial intelligence model), the parameters of the target artificial intelligence model include speech: float32[1, 300, 560], speech_lengths: int32[1], language: int32[1] and textnorm: int32[1], etc., the size of the target artificial intelligence model is 487MB, and through performance analysis, it can be obtained that the minimum inference time of the target artificial intelligence model running on the QCS8550 hardware platform is 69.9ms (this value is practically meaningful when the model is run multiple times), the average inference time is about 72.7ms, the peak memory usage is 513MB (when the maximum memory of QCS8550 is 24GB or 32GB), and there are 2546 levels running on the computing unit (i.e., neural network processor, Neural Processing Unit, NPU), which can greatly improve the computing speed of the target artificial intelligence model. The performance analysis data of the aforementioned target artificial intelligence model can be used to accurately and reasonably allocate computing resources when deploying multiple models on the target device in actual use, avoiding problems such as resource contention and unreasonable resource allocation.
[0053] The inference test module 150 is used to perform inference tests on the target artificial intelligence model based on verification data, provided that the results of the performance analysis meet the first target conditions.
[0054] In actual implementation, if the performance analysis is successful, the inference testing module 150 can automatically perform inference tests on the target AI model. Unlike performance analysis, inference testing uses validation data to verify the correctness of the target AI model's inference, thus determining whether the target AI model has experienced significant accuracy loss.
[0055] In some embodiments, the inference testing module 150 can use the compiled target AI model as input, call the fifth interface, and perform inference testing on the target AI model to test the accuracy of its inference. In some embodiments, the fifth interface can be an application programming interface for initiating the inference test. The accuracy of the target AI model's inference can be indicated by precision.
[0056] The artificial intelligence model conversion platform provided in this application, by obtaining the compilation parameters of the source artificial intelligence model and the type of the target device, can perform format conversion of artificial intelligence models for various types of artificial intelligence models and various types of devices or hardware platforms used to deploy artificial intelligence models by selecting different compilation parameters and target device types. This reduces the difficulty of deploying artificial intelligence models on hardware platforms. Furthermore, by automatically performing performance analysis on the target artificial intelligence model based on the type of the target device when compilation is successful, and by automatically performing inference tests on the target artificial intelligence model when performance analysis is successful, compared with the related technologies that require users to manually perform performance analysis and inference tests, this platform can greatly improve the efficiency of artificial intelligence model format conversion, performance analysis, inference testing, and deployment, and improve the reliability of artificial intelligence model deployment results. The conversion and adaptation of artificial intelligence models is simpler and more convenient.
[0057] According to one embodiment of this application, the platform further includes: a data processing module for acquiring raw data in response to a third input; converting the raw data into verification data in Python dictionary format; the format of the raw data includes at least one of image format, audio format, text format, and npy format.
[0058] In actual implementation, the conversion platform for this artificial intelligence model can also include a data processing module. This module can acquire raw data in formats such as image, audio, text, or .npy formats based on user input.
[0059] In some embodiments, the third input may be an input form including at least one of click input, drag operation, voice input, and drop-down menu selection operation. This application does not specifically limit the form of the third input.
[0060] In some embodiments, the data processing module may, in response to a third input, invoke a sixth interface to obtain raw data. The sixth interface may be an application programming interface (API) for uploading raw files.
[0061] In actual execution, the data processing module can also convert the raw data into validation data in Python dictionary format.
[0062] In some embodiments, after the data processing module obtains the raw data, it can perform format conversion on the raw data, converting the raw data into Python dictionary format, thereby obtaining verification data in Python dictionary format.
[0063] It should be noted that verification data is required when performing AI inference testing tasks. Typical verification data is in formats such as images, audio, text, or np.ndarray. However, the AI model conversion platform in related technologies supports Python dictionaries, for example: {"input_name": [np.ndarray]}, and the data type must be consistent with the type of the source AI model. In some embodiments, the custom method `get_model_inputs_info` can be used to obtain model information such as the source AI input name, input tensor, and dtype for various model types. Then, based on the data format of the uploaded raw data, the custom methods `handle_image`, `handle_npy`, `handle_txt`, or `handle_audio` are used to convert the image, np.ndarray, text, and audio formats into np.ndarray format verification data, which is then uploaded as input to the corresponding inference testing task of the AI model conversion platform in related technologies.
[0064] The artificial intelligence model conversion platform provided in this application converts raw data in formats such as image, audio, text, or npy into verification data in Python dictionary format. This enables the use of AI model conversion platforms in related technologies for inference testing. It can automatically process verification data without requiring users to manually perform data conversion and data type conversion. It can enable inference testing for various types of artificial intelligence models, improve the reliability of the deployment results of artificial intelligence models, and make the conversion and adaptation of artificial intelligence models simpler and more convenient.
[0065] According to one embodiment of this application, the platform further includes: a result display module, used to visualize the results of performance analysis and the results of inference testing.
[0066] In actual implementation, the transformation platform for this artificial intelligence model may also include a result display module.
[0067] In some embodiments, the results display module can visualize the process and results of performance analysis of the target artificial intelligence model.
[0068] In some embodiments, the results of performance analysis can be visualized and output in formats such as Hyper Text Markup Language (HTML) 5 or JSON.
[0069] In some embodiments, the results display module can visualize the process and results of reasoning tests on the target artificial intelligence model.
[0070] In some embodiments, the results of the inference test are visualized and output in formats such as Hyper Text Markup Language (HTML5) or JSON.
[0071] In some embodiments, the results of the inference test can be visualized by displaying the analysis results data in H5 format as a table. The H5 format analysis results data may include the size of the validation data, the name of the dataset containing the validation data, and its corresponding visualization data.
[0072] The artificial intelligence model conversion platform provided in the embodiments of this application can facilitate users to understand the specific situation of performance analysis and inference test by outputting visualized performance analysis results and inference test results. This can improve the efficiency of artificial intelligence model format conversion, inference test and deployment, improve the reliability and traceability of artificial intelligence model deployment results, and make the conversion and adaptation of artificial intelligence models simpler and more convenient.
[0073] According to one embodiment of this application, the compilation parameters include at least one of the following: target format of the target artificial intelligence model, truncation tensor parameters, truncation input-output parameters, full quantization type, quantization type of weights, quantization input-output parameters, and quantization type of input and output; the truncation tensor parameters are used to indicate whether the tensors in the source artificial intelligence model are truncated to the target length; the truncation input-output parameters are used to indicate whether the input and output of the source artificial intelligence model are truncated to the target length; and the quantization input-output parameters are used to indicate whether the input and output of the source artificial intelligence model are quantized.
[0074] In actual execution, compilation parameters may include at least one of the following: target device type, target format, truncation tensor parameters, truncation input / output parameters, full quantization type, weight quantization type, quantized input / output parameters, and input / output quantization type.
[0075] In some embodiments, the target format is the format of the target artificial intelligence model. The format of the model file of the target artificial intelligence model can be regarded as the format of the target artificial intelligence model. The format of the target artificial intelligence model can be any one of the QNN formats such as tflite, qnn_lib_aarch64_android, qnn_context_binary, qnn_dlc, onnx, and precompiled_qnn_onnx. Among them, the TFLite and ONNX formats can mainly run on the central processing unit (CPU) or graphics processing unit (GPU) resources of personal computers or servers; the qnn_lib_aarch64_android format can run on mobile devices with mobile phone chips; the qnn_context_binary and qnn_dlc formats can mainly run on devices equipped with edge chips.
[0076] In some embodiments, the truncation tensor parameter can be used to indicate whether tensors in the source AI model are truncated to the target length, that is, whether the length of tensors in the target AI model is converted to the target length. The value of the truncation tensor parameter can include true and false, which respectively indicate whether the tensors in the source AI model are truncated to the target length and whether the tensors in the source AI model are not truncated to the target length. The specific value of the target length is not limited in this embodiment. For example, the target length can be 32 bits or 16 bits, etc.
[0077] In some embodiments, the conditions for setting the truncation tensor parameter may include: when the target format parameter is set to TFLite and the source AI model has tensor types such as int64 and float64, the value of the truncation tensor parameter can be set to true. The main function of setting the value of the truncation tensor parameter to true is to treat int64 tensors in the source AI model as int32 type and float64 tensors as float32 type, that is, to truncate tensors of 64-bit length to the target length (32 bits), thereby reducing the computational precision of the target AI model and improving the computational speed.
[0078] In some embodiments, the truncation input / output parameter can be used to indicate whether the input and output of the source AI model are truncated to the target length, that is, whether the input and output of the target AI model are converted to the target length. The value of the truncation input / output parameter can include true and false, which indicate whether the input and output of the source AI model are truncated to the target length and whether the input and output of the source AI model are not truncated to the target length, respectively.
[0079] In some embodiments, the conditions for setting the truncation input / output parameter may include: when the target format parameter is set to TFLite, qnn_dlc, qnn_lib_aarch64_android, qnn_context_binary, or precompiled_qnn_onnx, and the input and output of the source AI model have a type with a length greater than the target length, the value of the truncation input / output parameter can be set to true. For example, if the data type of the input and output of the source AI model includes int64, setting the value of the truncation input / output parameter to true can convert the input and / or output of data type int64 in the source AI model to data type int32, that is, truncate the 64-bit input and / or output to the target length (32 bits), thereby reducing the AI model. By reducing the precision of the input and output of the target AI model, the inference efficiency of the target AI model can be improved.
[0080] In some embodiments, the full quantization type can be used to indicate the data type of the weights and biases in the target artificial intelligence model. Values for the full quantization type parameter can include int8 (both weights and biases are of data type int8), int16 (both weights and biases are of data type int16), w8a16 (weights are of data type int8, biases are of data type int16), w4a8 (weights are of data type int4, biases are of data type int8), and w4a16 (weights are of data type int4, biases are of data type int16), etc.
[0081] In some embodiments, the conditions for setting the full quantization type parameter may include: the source AI model is not in AIMET format, or the target type is not TFLite. By setting the full quantization type parameter, the size of the target AI model and the accuracy of parameters such as weights and biases in the model can be significantly reduced, thereby improving the inference speed of the target AI model. However, the overall accuracy of the target AI model will be lost.
[0082] In some embodiments, the weight quantization type parameter can be used to indicate which data type the unquantized weights in the target AI model should be quantized to. For example, the value of the weight quantization type parameter can be float16, which is used to quantize the unquantized weights in the target AI model to the specified type float16.
[0083] In some embodiments, the conditions for setting the weight quantization type parameter may include: the source AI model is not in AIMET format, or the target type is not TFLite. The weight quantization type parameter has the same effect as the full quantization type parameter, but it reduces the size of the target AI model and the accuracy of parameters such as weights and biases in the model by a smaller margin, thereby improving the inference speed of the target AI model by a smaller margin, and has certain limitations.
[0084] In some embodiments, the quantization input / output parameter can be used to indicate whether the input and output of the target AI model are quantized. The value of the quantization input / output parameter can include `true` and `false`, indicating whether the input and output of the target AI model are quantized and not quantized, respectively. By using the quantization input / output parameter, one can choose whether to quantize the input and output when performing model quantization during the compilation of the source AI model. In some embodiments, the default value of the quantization input / output parameter can be `false`, indicating that quantization is not performed.
[0085] In some embodiments, the input / output quantization type parameter can be used to indicate which data type the input and output of the target AI model should be quantized to. The input / output quantization type parameter is not used alone; it must be used in conjunction with the weight quantization type parameter.
[0086] In some embodiments, the values of the input / output quantization type parameters may include int8 and uint8 (unsigned integer), etc.
[0087] According to the AI model conversion platform provided in the embodiments of this application, by obtaining the compilation parameters of the source AI model, the compilation parameters can indicate the type of AI model and the type of target device, etc., thereby enabling the format conversion of AI models for various types of AI models and various types of devices or hardware platforms used to deploy AI models by selecting different compilation parameters. This can reduce the difficulty of deploying AI models on hardware platforms, and make the conversion and adaptation of AI models simpler and more convenient.
[0088] In some embodiments, the artificial intelligence model conversion device may include components such as a device management module, a data processing module, a model upload module, a parameter configuration module, a model compilation module, a performance analysis module, an inference testing module, a task management module, a file management module, a result display module, and an API interface module.
[0089] In some embodiments, the device management module can be used to acquire and manage available computing devices (including devices that can be accessed through interfaces such as the first interface to the seventh interface), providing device support for model compilation, performance analysis, and inference testing. The device management module can acquire information about all computing devices, parse the information about computing devices, and monitor the status of computing devices.
[0090] In some embodiments, the data processing module can be used to process the raw data uploaded by the user (which may be in the form of images, text, audio, or npy, etc.) and format the raw data uploaded by the user into a format supported by the AI Hub artificial intelligence model conversion platform (such as Python dictionary format).
[0091] In some embodiments, the model upload module 110 can be used to process model files in formats such as ONNX uploaded by users, providing the original model (source AI model) for subsequent model compilation and analysis. In some embodiments, the model upload module 110 can support drag-and-drop or click upload of model files, file format verification, file size checking, and upload progress display.
[0092] In some embodiments, the parameter configuration module 120 allows users to customize various parameters for model compilation to optimize compilation results and performance. The parameter configuration module 120 can support the selection of the target runtime platform (i.e., the target device), the configuration of quantization type parameters, the setting of compilation parameter options, and the verification and prompting of compilation parameters.
[0093] In some embodiments, the model compilation module 130 can be used to compile uploaded models in formats such as ONNX into QNN format, supporting the selection of various compilation parameters (including compilation parameter options and target devices). In some embodiments, the model compilation module 130 can be used for model format conversion, target device matching and selection, application of compilation device options, compilation progress monitoring, and compilation result storage.
[0094] In some embodiments, the performance analysis module can be used to perform performance analysis on the compiled QNN format model, providing detailed performance metrics and optimization suggestions. In some embodiments, the performance analysis module can perform model performance analysis, including: execution time analysis, memory usage analysis, performance report generation, and visualization of results.
[0095] In some embodiments, the inference testing module can be used to perform inference tests on the compiled model using verification data such as audio datasets to verify the actual performance of the model. In some embodiments, the inference testing module can specifically be used for data file processing, feature extraction and preprocessing, inference task execution, result data collection, and H5 data storage.
[0096] In some embodiments, the task management module can be used to manage and monitor the execution status of all background tasks, providing a unified task management interface. Specifically, in some embodiments, the task management module can be used for task creation and status management, task log recording, task dependency management, task result storage, and task status querying.
[0097] In some embodiments, the file management module can be used to handle the uploading, downloading, storage, and management of various files. Specifically, in some embodiments, the file management module can be used for uploading and downloading model files, uploading data files, managing log files, storing result files, and validating file formats.
[0098] In some embodiments, the results display module can be used to provide visualization of compilation, performance analysis, and inference test results. In some embodiments, the results display module can specifically be used to implement functions such as performance analysis result visualization, inference result data display, chart generation and display, and data export.
[0099] In some embodiments, the API interface module can be used to provide a complete RESTful API interface, supporting data interaction between the front-end and the back-end.
[0100] In some embodiments, the main interfaces provided by the API interface module may include: GET / api / devices - Used to retrieve a list of devices; GET / api / compile-options - Used to retrieve compilation options; POST / api / uploadmodel - Used to upload model files; POST / api / compile - Used to initiate model compilation; POST / api / profile - Used to start performance analysis; POST / api / inference - Used to start inference tests; POST / api / uploaddata - Used to upload data files; GET / api / download / {task_id} - Used to download model files; GET / api / taskstatus / {task_id} - Used to query task status; GET / api / profile-results - Used to retrieve performance analysis results; GET / api / inference-results - Used to retrieve inference results; `GET / api / inference-dataset-data` - Used to retrieve inference dataset data.
[0101] This application also provides a method for converting an artificial intelligence model. The method for converting an artificial intelligence model provided in this application can be executed by the aforementioned artificial intelligence model conversion platform.
[0102] The conversion method of the artificial intelligence model can be applied to the terminal, specifically executed by the hardware or software in the terminal.
[0103] The artificial intelligence model conversion method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the artificial intelligence model conversion method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The following uses an electronic device as the execution subject to illustrate the artificial intelligence model conversion method provided in this application embodiment.
[0104] like Figure 2 As shown, the conversion method of this artificial intelligence model includes steps 210, 220, 230, 240 and 250.
[0105] Step 210: In response to the first input, obtain the source AI model to be converted.
[0106] Step 220: In response to the second input, obtain the compilation parameters of the source AI model and the type of the target device for deploying the transformed target AI model.
[0107] Step 230: Compile the source AI model based on the target device type and compilation parameters. If the compilation is successful, obtain the target AI model.
[0108] Step 240: Perform performance analysis on the target artificial intelligence model based on the type of target device; Step 250: If the performance analysis results meet the first objective condition, conduct inference tests on the target artificial intelligence model based on the verification data.
[0109] The process of implementing the above-described artificial intelligence model conversion method can be found in the embodiments of the artificial intelligence model conversion platform, and will not be repeated here to avoid repetition.
[0110] The artificial intelligence model conversion method provided in this application, by obtaining the compilation parameters of the source artificial intelligence model and the type of the target device, and by selecting different compilation parameters and target device types, can achieve format conversion of artificial intelligence models for various types of artificial intelligence models and various types of devices or hardware platforms used to deploy artificial intelligence models. This reduces the difficulty of deploying artificial intelligence models on hardware platforms. Furthermore, by automatically performing performance analysis on the target artificial intelligence model based on the type of the target device when compilation is successful, and by automatically performing inference tests on the target artificial intelligence model when performance analysis is successful, compared with the related technologies that require users to manually perform performance analysis and inference tests, this method can greatly improve the efficiency of artificial intelligence model format conversion, performance analysis, inference testing, and deployment, and improve the reliability of artificial intelligence model deployment results. The conversion and adaptation of artificial intelligence models is simpler and more convenient.
[0111] In some embodiments of this application, after performing performance analysis on the target artificial intelligence model based on the type of the target device, the method further includes: if the result of the performance analysis does not meet the first target condition, analyzing the performance analysis log and outputting a visualized analysis result.
[0112] In actual implementation, when performance analysis fails, the system can automatically analyze the performance analysis logs, obtain analysis results by analyzing the error information in the logs, and visualize the results for users to view and understand the reasons and manifestations of the performance analysis failure. This allows users to adjust the source AI model and recompile and re-analyze the performance.
[0113] In some embodiments, the visualized analysis results may be in formats such as Hyper Text Markup Language (HTML) 5 or JSON.
[0114] According to the AI model conversion method provided in the embodiments of this application, by analyzing the performance analysis logs and outputting visualized analysis results when the target AI model fails, users can easily understand the reasons and manifestations of the performance analysis failure, adjust the source AI model in a timely manner, reduce the time spent obtaining the target AI model that meets the performance requirements, thereby improving the efficiency of AI model format conversion, performance analysis and deployment, enhancing the reliability and traceability of AI model deployment results, and making AI model conversion and adaptation simpler and more convenient.
[0115] In some embodiments of this application, before performing inference tests on the target artificial intelligence model based on the verification data, the method further includes: acquiring raw data in response to a third input; converting the raw data into verification data in Python dictionary format; the format of the raw data includes any one of image format, audio format, text format, and npy format.
[0116] The process of obtaining the verification data described above can be found in the implementation examples of the artificial intelligence model conversion platform. To avoid repetition, it will not be described again here.
[0117] According to the artificial intelligence model conversion method provided in the embodiments of this application, by converting raw data in formats such as image format, audio format, text format, or npy format into verification data in Python dictionary format, it is possible to call the AI model conversion platform in related technologies for inference testing, and to automatically process the verification data without requiring users to manually perform data conversion and data type conversion operations. It can realize inference testing for various types of artificial intelligence models, improve the reliability of the deployment results of artificial intelligence models, and make the conversion and adaptation of artificial intelligence models simpler and more convenient.
[0118] In some embodiments of this application, after performing inference tests on the target artificial intelligence model based on verification data, the method further includes: if the result of the inference test satisfies the second target condition, outputting the target artificial intelligence model in response to the fourth input.
[0119] In actual execution, after the inference testing module 150 obtains the inference test results of the target artificial intelligence model, the inference testing module 150 can determine whether the accuracy of the target artificial intelligence model meets the second objective condition. If it does, the inference test is successful; if it does not, the inference test fails.
[0120] In some embodiments, the second target condition can be set based on user needs, etc. The specific second target condition is not limited in the embodiments of this application. For example, the second target condition may include a precision greater than a precision threshold, etc.
[0121] If the inference test is successful, the system can respond to the user's fourth input and output the target AI model for the user to download. In other words, after all the above steps are completed, the system can respond to the fourth input and download and save the successfully compiled target AI model.
[0122] In some embodiments, the fourth input may be an input form including at least one of click input, drag operation, voice input, and drop-down menu selection operation. This application does not specifically limit the form of the fourth input.
[0123] In some embodiments, in response to the fourth input, the seventh interface can be invoked to output the target artificial intelligence model. The seventh interface can be an application programming interface for downloading model files.
[0124] According to the artificial intelligence model conversion method provided in the embodiments of this application, when the reasoning test result of the target artificial intelligence model meets the second target condition, the target artificial intelligence model is output in response to the fourth input. This method can output the target artificial intelligence model more conveniently and quickly, thereby improving the efficiency of format conversion and deployment of the target artificial intelligence model, enhancing the reliability of the deployment results of the artificial intelligence model, and making the conversion and adaptation of the artificial intelligence model simpler and more convenient.
[0125] In some embodiments of this application, after performing inference tests on the target artificial intelligence model based on verification data, the method further includes: if the result of the inference test does not meet the second target condition, analyzing the logs of the inference test and outputting visualized analysis results.
[0126] In actual implementation, when inference tests fail, the system can automatically analyze the inference test logs, obtain analysis results by analyzing the error information in the logs, and visualize the analysis results for users to view and understand the reasons and manifestations of the inference test failure. This allows users to adjust the verification data and re-perform the inference test.
[0127] In some embodiments, the visualized analysis results may be in formats such as Hyper Text Markup Language (HTML) 5 or JSON.
[0128] In some embodiments, the visualized analysis results can be presented in tabular form by displaying the analysis results data in H5 format. The H5 format analysis results data may include the size of the validation data, the name of the dataset containing the validation data, and its corresponding visualization data, etc.
[0129] According to the artificial intelligence model conversion method provided in the embodiments of this application, when the inference test result of the target artificial intelligence model does not meet the second target condition, the log of the inference test is analyzed and the visualized analysis result is output. This makes it easier for users to understand the reasons and performance of the inference test failure, adjust the verification data in time, and reduce the time spent obtaining the target artificial intelligence model that meets the accuracy requirements. This improves the efficiency of artificial intelligence model format conversion, inference testing and deployment, enhances the reliability and traceability of the deployment results of artificial intelligence model, and makes the conversion and adaptation of artificial intelligence model simpler and more convenient.
[0130] To facilitate understanding of the above embodiments of this application, reference is made below. Figure 3This paper describes one implementation process of a method for transforming artificial intelligence models. (Reference) Figure 3 A method for converting an artificial intelligence model may include the following steps.
[0131] Step 301: Upload the source model.
[0132] It can obtain the source AI model uploaded by the user.
[0133] Step 302: Configure compilation parameters.
[0134] It can obtain the compilation parameters uploaded by the user and configure the compilation parameters of the source artificial intelligence model to the values uploaded by the user.
[0135] Step 303: Model compilation.
[0136] The configured compilation parameters and the source AI model can be submitted together to the AI model conversion platform in the relevant technology, so that the source AI model can be compiled based on the compilation parameters of the source AI model.
[0137] Step 304: Determine if the compilation was successful.
[0138] If compilation is successful, proceed to step 307; if compilation fails, proceed to step 305.
[0139] Step 305: Output compilation log.
[0140] It can output compilation logs for users to view.
[0141] Step 306: Adjust the model.
[0142] Users can adjust the source AI model based on the compilation logs, and then re-execute step 301 to upload the adjusted source AI model.
[0143] Step 307, Performance Analysis.
[0144] It allows for performance analysis of the target AI model obtained after successful compilation.
[0145] Step 308: Determine if the performance analysis was successful.
[0146] If the performance analysis is successful, proceed to step 312; if the compilation fails, proceed to step 309.
[0147] Step 309: Output performance analysis failure information.
[0148] It can output performance analysis failure information to indicate that the performance analysis has failed.
[0149] Step 310: Analyze the log error information.
[0150] Error messages in the performance analysis logs can be analyzed to help users determine whether to re-perform the performance analysis on the target AI model.
[0151] Step 311: Determine whether to perform a new performance analysis.
[0152] If yes, then step 307 can be executed again; if not, then step 306 can be returned to.
[0153] Step 312: Output a success message for the performance analysis.
[0154] It can output a success message for the performance analysis to indicate that the performance analysis was successful.
[0155] Step 313: Obtain verification data.
[0156] It can convert the format of the raw data uploaded by users and obtain verification data.
[0157] Step 314, Reasoning Test.
[0158] It can perform inference tests on target artificial intelligence models that have successfully passed performance analysis.
[0159] Step 315: Determine whether the reasoning test was successful.
[0160] If the reasoning test is successful, step 312 can be executed; if the reasoning test fails, step 319 can be executed.
[0161] Step 316: Output the reasoning test failure message.
[0162] It can output inference test failure information to indicate that the inference test has failed.
[0163] Step 317: Analyze the log error information.
[0164] Error messages in the inference test logs can be analyzed to help users determine whether to adjust the validation data.
[0165] Step 318: Should the verification data be adjusted?
[0166] If so, step 314 can be re-executed based on the adjusted verification data; otherwise, step 320 can be executed.
[0167] Step 319: Output the reasoning test success message.
[0168] It can output a message indicating that the inference test was successful.
[0169] Step 320: Download the target model.
[0170] Users can download the converted target AI model.
[0171] It should be noted that the above embodiments of this application can be implemented by calling an artificial intelligence model conversion platform (such as AI Hub) in the related art. In some embodiments, the aforementioned first to seventh interfaces can be interfaces provided by an artificial intelligence model conversion platform in the related art.
[0172] In some embodiments, the AI Hub artificial intelligence model conversion platform mainly includes the following interfaces: Data upload interface: qai_hub.upload_dataset; Data download interface: qai_hub.get_dataset; Batch data retrieval interface: qai_hub.get_datasets; The API for retrieving the device list is: qai_hub.get_devices; The interface for obtaining device parameters is: qai_hub.get_devices_attributes; The API for retrieving the framework list is: qai_hub.get_frameworks; Get the interface for a specific task: qai_hub.get_job; The API for retrieving the task list is: qai_hub.get_job_summaries; Get model interface: qai_hub.get_model; Batch model retrieval interface: qai_hub.get_models; Detailed process printing interface: qai_hub.set_verbose; Model compilation interface: qai_hub.submit_compile_job; Model quantization interface: qai_hub.submit_quantize_job; Performance analysis interface: qai_hub.submit_profile_job; Inference test interface: qai_hub.submit_inference_job; Model link interface: qai_hub.submit_link_job; ...... In some embodiments, the SourceModelType (the type of the source AI model or the source model type) included in the AI Hub AI model conversion platform may include: UNRECOGNIZED_MODEL_TYPE =<SourceModelType.UNRECOGNIZED_MODEL_TYPE: 0> ; TORCHSCRIPT =<SourceModelType.TORCHSCRIPT: 1> ; MLMODEL =<SourceModelType.MLMODEL: 2> ; TFLITE =<SourceModelType.TFLITE: 4> ; MLMODELC =<SourceModelType.MLMODELC: 5> ; ONNX =<SourceModelType.ONNX: 6> ; MLPACKAGE =<SourceModelType.MLPACKAGE: 8> ; TETRART =<SourceModelType.TETRART: 9> ; QNN_LIB_AARCH64_ANDROID =<SourceModelType.QNN_LIB_AARCH64_ANDROID: 10> ; QNN_LIB_X86_64_LINUX =<SourceModelType.QNN_LIB_X86_64_LINUX: 14> ; QNN_CONTEXT_BINARY =<SourceModelType.QNN_CONTEXT_BINARY: 11> ; AIMET_ONNX =<SourceModelType.AIMET_ONNX: 12> ; QNN_DLC =<SourceModelType.QNN_DLC: 15> .
[0173] In some embodiments, the AI Hub artificial intelligence model conversion platform can upload source AI models by combining the ONNX framework with supported source model types. Furthermore, it can perform model validation for certain models based on user needs or requirements. For example, for uploaded ONNX format models, onnx.checker can be used to validate the model, and shape inference can be used to check the model's structure.
[0174] In some embodiments, when performing model compilation tasks, the AI Hub artificial intelligence model conversion platform can place the uploaded model on a cloud server, and then convert the operators in the model graph into operators supported by the QNN SDK, thus completing the model conversion.
[0175] It is understood that the execution entity of the artificial intelligence model conversion method provided in this application embodiment can be an automated model conversion and optimization platform built on the QNN SDK and AI Hub, and integrated with a Python virtual environment. This platform can efficiently convert AI models in formats such as ONNX into multiple deployment formats (i.e., annual target formats) suitable for various hardware platforms (supporting at least dozens of different hardware platforms). Furthermore, the artificial intelligence model conversion method provided in this application embodiment significantly simplifies the deployment difficulty of artificial intelligence models on different hardware platforms by providing a highly integrated, automated, and log-rich process, and can improve the reliability and traceability of deployment results.
[0176] It is understood that the execution entity of the artificial intelligence model transformation method provided in this application embodiment may include a pre-configured software environment. This environment integrates a toolchain, automated processing flow, and a comprehensive logging system.
[0177] In some embodiments, the toolchain may primarily include interfaces such as the model compilation interface of the AI Hub artificial intelligence model conversion platform, as well as model conversion, quantization, and compilation tools in the QNN SDK.
[0178] In some embodiments, the automated processing flow refers to receiving an AI model (i.e., the source AI model) in the ONNX format or other format provided by the user, automatically calling the corresponding conversion, quantization and compilation tools, generating the optimized model (i.e., the target AI model) required by the target hardware platform (i.e., the target device), and automatically performing data processing to adapt to the compiled model input.
[0179] In some embodiments, a comprehensive logging system can automatically generate and save data in formats such as H5, compilation logs (compile.log), performance analysis logs (profile.log), and inference test logs (inference.log), providing detailed tracking and debugging information for each step of the operation, facilitating problem localization and result verification.
[0180] It's worth noting that the automated model conversion and optimization platform, built using the QNN SDK and the AI Hub AI model conversion platform, combined with a Python virtual environment, can perform model compilation, processing of different data formats (including text, audio, npy, and images), and data visualization (e.g., JSON or H5 data). By applying various frameworks and utilizing Vue reactivity, VueRouter routing, ElementPlus components, and Axios requests on the client side, it's possible to call backend interfaces via HTTP to implement the functionality of various frontend modules. On the server side, Uvicorn + Fastapi can be used to build backend interfaces (including Swagger2 interface documentation). The AI Hub AI model conversion platform is used to implement cloud service calls (including model compilation, performance analysis, inference testing, model download, log download, and data result download). A custom backend tool, DataHandler, is used to process data in different formats (e.g., .wav, .txt, .npy, .jpg, .png, and .jpeg), implementing backend functional interfaces and data processing interfaces.
[0181] It's worth noting that this platform can more easily and conveniently convert models from ONNX and other formats to different model formats (including .onnx & .bin, .bin, and .dlc, etc.). Automated data processing supports image, npy, audio, and text formats, as well as H5 data visualization. The platform has detailed model compilation logs (compile.log), detailed model performance analysis logs (profile.log), and detailed model inference test logs (inference.log). Furthermore, the platform supports full parameter quantization (quantize_full_type), weight quantization (quantize_weight_type), and model input / output (IO) quantization, aiming to accelerate model computation using the GPU or NPU resources of the hardware platform.
[0182] The conversion platform for the artificial intelligence model in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the application.
[0183] The conversion platform for the artificial intelligence model in this application embodiment can be a device with an operating system. This operating system can be Microsoft (Windows), Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0184] The artificial intelligence model conversion platform provided in this application embodiment can achieve Figures 2 to 3 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0185] In some embodiments, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401, a memory 402, and a computer program stored in the memory 402 and executable on the processor 401. When the computer program is executed by the processor 401, it implements the various processes of the above-described artificial intelligence model conversion method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0186] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0187] This application also provides a non-volatile computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described artificial intelligence model conversion method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0188] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0189] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for converting artificial intelligence models.
[0190] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0191] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described artificial intelligence model conversion method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0192] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0193] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0194] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0195] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0196] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0197] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A conversion platform of an artificial intelligence model, characterized by, include: The model upload module is used to obtain the source AI model to be transformed in response to the first input; The parameter configuration module is used to obtain the compilation parameters of the source artificial intelligence model and the type of the target device for deploying the transformed target artificial intelligence model in response to the second input; The model compilation module is used to compile the source artificial intelligence model based on the type of the target device and the compilation parameters, and to obtain the target artificial intelligence model if the compilation is successful. The performance analysis module is used to perform performance analysis on the target artificial intelligence model based on the type of the target device. The inference testing module is used to perform inference testing on the target artificial intelligence model based on verification data, provided that the performance analysis results meet the first target condition. 2.The conversion platform of an artificial intelligence model according to claim 1, wherein, The platform also includes: A data processing module is used to acquire raw data in response to a third input; convert the raw data into verification data in Python dictionary format; the format of the raw data includes at least one of image format, audio format, text format and npy format. 3.The conversion platform of an artificial intelligence model according to claim 1, wherein, The platform also includes: The results display module is used to visualize the results of the performance analysis and the results of the inference test. 4.The conversion platform of an artificial intelligence model according to any one of claims 1 to 3, characterized in that, The compilation parameters include at least one of the following: target format of the target artificial intelligence model, truncation tensor parameters, truncation input / output parameters, full quantization type, quantization type of weights, quantization input / output parameters, and quantization type of input / output; the truncation tensor parameters indicate whether to truncate the tensors in the source artificial intelligence model to the target length; the truncation input / output parameters indicate whether to truncate the inputs and outputs of the source artificial intelligence model to the target length; and the quantization input / output parameters indicate whether to quantize the inputs and outputs of the source artificial intelligence model. 5.A conversion method of an artificial intelligence model, characterized by, include: In response to the first input, obtain the source AI model to be transformed; In response to the second input, the compilation parameters of the source AI model and the type of the target device for deploying the transformed target AI model are obtained; Based on the type of the target device and the compilation parameters, the source artificial intelligence model is compiled, and if the compilation is successful, the target artificial intelligence model is obtained. Performance analysis of the target artificial intelligence model based on the type of the target device; If the performance analysis results meet the first objective condition, the target artificial intelligence model is subjected to inference testing based on the verification data. 6.The conversion method of an artificial intelligence model according to claim 5, wherein, Following the performance analysis of the target artificial intelligence model based on the type of the target device, the method further includes: If the performance analysis results do not meet the first target condition, analyze the performance analysis logs and output visualized analysis results.
7. The method for converting artificial intelligence models according to claim 5, characterized in that, Before performing inference tests on the target artificial intelligence model based on the verification data, the method further includes: In response to a third input, raw data is acquired; the format of the raw data includes at least one of image format, audio format, text format, and npy format; The raw data is converted into the verification data in Python dictionary format.
8. The method for converting an artificial intelligence model according to any one of claims 5 to 7, characterized in that, After performing inference tests on the target artificial intelligence model based on the verification data, the method further includes: If the result of the inference test satisfies the second objective condition, the target artificial intelligence model is output in response to the fourth input; If the result of the inference test does not meet the second objective condition, analyze the log of the inference test and output a visualized analysis result.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the conversion method of the artificial intelligence model as described in any one of claims 5-8.
10. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for converting an artificial intelligence model as described in any one of claims 5-8.