Execution method, device, electronic device and storage medium
By dynamically updating the execution logic of the computing unit in the machine learning model, the problem of high cost in the update process is solved, and the machine learning model can be updated without re-releasing the application version. It is suitable for clients and data centers, etc. scene.
Patent Information
- Application Number
- CN201911067981.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-04
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-11-04
AI Technical Summary
In the application process of machine learning models, when updating computing units or adding new computing units, the existing technology requires re-releasing the application version, resulting in high costs. How to update machine learning models without increasing costs is an urgent problem that needs to be solved. question.
By determining the preset update position of the dynamic computing unit when traversing the execution of the machine learning model, and obtaining and loading the corresponding execution information from this position, the updated computing unit logic is dynamically configured and executed to avoid re-releasing the application version.
It realizes dynamic updating of machine learning models, reduces update costs, and avoids the need to re-release application versions. It is suitable for scenarios such as clients and data centers.
Smart Images

Figure CN112783520B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an execution method, device, electronic device and storage medium. Background Art
[0002] With the development of technology, the application of artificial intelligence is becoming more and more extensive. As an implementation of artificial intelligence, machine learning is increasingly being applied to various technical fields. In machine learning applications, a machine learning model is usually trained using training samples, and then the trained machine learning model is deployed to a hardware platform, and the corresponding functions are realized by executing the machine learning model on the hardware platform. The machine learning model may include multiple computing units, and the data input to the machine learning model is input to these computing units for processing to obtain the output results of the machine learning model. In the application process, once the application encapsulating the machine learning model is released, if the computing unit needs to be expanded or the existing computing unit needs to be modified, it is necessary to re-issue the updated application version, but the cost of re-issuing the application version is high. How to update the machine learning model without increasing the cost is one of the current problems that need to be solved urgently. Summary of the invention
[0003] The embodiments of the present disclosure provide an execution method, an apparatus, an electronic device, and a computer-readable storage medium.
[0004] In a first aspect, an embodiment of the present disclosure provides an execution method, including:
[0005] In the process of traversing and executing the machine learning model, when the computing unit currently traversed is a dynamic computing unit, determining a preset update position corresponding to the dynamic computing unit;
[0006] Acquire first execution information of the dynamic calculation unit from the preset update position;
[0007] The computing unit currently being traversed is executed according to the first execution information.
[0008] Furthermore, it also includes:
[0009] When the currently traversed computing unit is a non-dynamic computing unit, obtaining second execution information of the currently traversed computing unit from the machine learning model;
[0010] The computing unit currently being traversed is executed according to the second execution information.
[0011] Further, determining a preset update position corresponding to the dynamic calculation unit includes:
[0012] Matching the dynamic calculation unit with preset mapping information;
[0013] The preset update position corresponding to the dynamic calculation unit is obtained according to the matching result.
[0014] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes:
[0015] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0016] Further, the first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes:
[0017] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0018] Furthermore, the first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes:
[0019] The script program is loaded and executed in the virtual machine environment of the CPU.
[0020] Furthermore, it also includes:
[0021] Acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0022] The update data is stored.
[0023] In a second aspect, an execution method is provided in an embodiment of the present disclosure, including:
[0024] When traversing and executing the machine learning model, matching the currently traversed computing unit with the preset mapping information; wherein the preset mapping information includes a mapping relationship between the preset computing unit in the machine learning model and the first execution information;
[0025] After the match is successful, obtaining first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information;
[0026] The computing unit currently being traversed is executed according to the first execution information.
[0027] Furthermore, it also includes:
[0028] After the matching fails, obtaining second execution information of the computing unit currently being traversed from the machine learning model;
[0029] The computing unit currently being traversed is executed according to the second execution information.
[0030] Further, obtaining first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information includes:
[0031] Determining a method for acquiring the first execution information according to the preset mapping information; wherein the acquisition method includes an identifier and / or a storage location of the first execution information;
[0032] The first execution information is obtained from a local storage device according to the identifier and / or storage location of the first execution information.
[0033] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes:
[0034] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0035] Further, the first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes:
[0036] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0037] Furthermore, the first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes:
[0038] The script program is loaded and executed in the virtual machine environment of the CPU.
[0039] Furthermore, it also includes:
[0040] Acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0041] The update data is stored.
[0042] In a third aspect, an updating method is provided in an embodiment of the present disclosure, including:
[0043] Acquire update data of the machine learning model; wherein the update data includes first execution information corresponding to at least one dynamic computing unit in the machine learning model;
[0044] redeploying the machine learning model according to the updated data;
[0045] In response to an execution request for the machine learning model, the machine learning model is traversed and executed, and when the computing unit currently being traversed is the dynamic computing unit, the first execution information corresponding to the dynamic computing unit is obtained, and the computing unit currently being traversed is executed according to the first execution information.
[0046] Furthermore, it also includes:
[0047] When the computing unit currently being traversed is a non-dynamic execution unit, execute the second execution information corresponding to the computing unit currently being traversed; wherein the second execution information is located in the machine learning model.
[0048] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes:
[0049] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0050] Further, the first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes:
[0051] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0052] Furthermore, the first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes:
[0053] The script program is loaded and executed in the virtual machine environment of the CPU.
[0054] In a fourth aspect, an update method is provided in an embodiment of the present disclosure, including:
[0055] Acquire update data of the machine learning model; wherein the update data includes preset mapping information and first execution information; the preset mapping information includes a mapping relationship between the first execution information and a preset computing unit in the machine learning model;
[0056] redeploying the machine learning model according to the updated data;
[0057] In response to an execution request for the machine learning model, the machine learning model is traversed and executed, and when the computing unit currently traversed matches the preset computing unit in the preset mapping information, the computing unit currently traversed is executed according to the first execution information.
[0058] Furthermore, it also includes:
[0059] When the computing unit currently being traversed does not match the preset computing unit in the preset mapping information, execute the second execution information corresponding to the computing unit currently traversed; wherein the second execution information is located in the machine learning model.
[0060] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes:
[0061] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0062] Further, the first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes:
[0063] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0064] Furthermore, the first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes:
[0065] The script program is loaded and executed in the virtual machine environment of the CPU.
[0066] In a fifth aspect, an embodiment of the present invention provides an execution device, including:
[0067] A first determination module is configured to determine a preset update position corresponding to a dynamic computing unit when the computing unit currently being traversed is a dynamic computing unit during the process of traversing and executing the machine learning model;
[0068] A first acquisition module, configured to acquire first execution information of the dynamic calculation unit from the preset update position;
[0069] The first execution module is configured to execute the computing unit currently being traversed according to the first execution information.
[0070] Furthermore, it also includes:
[0071] A second acquisition module is configured to acquire second execution information of the currently traversed computing unit from the machine learning model when the currently traversed computing unit is a non-dynamic computing unit;
[0072] The second execution module is configured to execute the computing unit currently being traversed according to the second execution information.
[0073] Furthermore, the first determining module includes:
[0074] A first matching submodule, configured to match the dynamic calculation unit with preset mapping information;
[0075] The first acquisition submodule is configured to acquire the preset update position corresponding to the dynamic calculation unit according to the matching result.
[0076] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; and the first execution module includes:
[0077] The first execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
[0078] Furthermore, the first execution information includes a dynamic library; the first execution module includes:
[0079] The second execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0080] Furthermore, the first execution information includes a script program; and the first execution module includes:
[0081] The third execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0082] Furthermore, it also includes:
[0083] a third acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0084] The first storage module is configured to store the update data.
[0085] In a sixth aspect, an embodiment of the present invention provides an execution device, including:
[0086] A matching module, configured to match the currently traversed computing unit with preset mapping information when traversing and executing the machine learning model; wherein the preset mapping information includes a mapping relationship between a preset computing unit in the machine learning model and the first execution information;
[0087] A fourth acquisition module is configured to acquire, after the matching succeeds, first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information;
[0088] The third execution module is configured to execute the computing unit currently being traversed according to the first execution information.
[0089] Furthermore, it also includes:
[0090] a fifth acquisition module, configured to acquire, after a matching failure, second execution information of the computing unit currently being traversed from the machine learning model;
[0091] The fourth execution module is configured to execute the computing unit currently being traversed according to the second execution information.
[0092] Furthermore, the fourth acquisition module includes:
[0093] A first determination submodule is configured to determine a method for obtaining the first execution information according to the preset mapping information; wherein the method for obtaining includes an identifier and / or a storage location of the first execution information;
[0094] The second acquisition submodule is configured to acquire the first execution information from a local storage device according to the identifier and / or storage location of the first execution information.
[0095] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; and the third execution module includes:
[0096] The fourth execution submodule is configured to configure the shader program using the operating parameters, and load and execute the shader program on the GPU.
[0097] Furthermore, the first execution information includes a dynamic library; and the third execution module includes:
[0098] The fifth execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0099] Furthermore, the first execution information includes a script program; and the third execution module includes:
[0100] The sixth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0101] Furthermore, it also includes:
[0102] a sixth acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0103] The second storage module is configured to store the update data.
[0104] In a seventh aspect, an embodiment of the present invention provides an updating device, including:
[0105] a seventh acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes first execution information corresponding to at least one dynamic computing unit in the machine learning model;
[0106] A first deployment module, configured to redeploy the machine learning model according to the updated data;
[0107] The fifth execution module is configured to traverse and execute the machine learning model in response to an execution request for the machine learning model, and when the computing unit currently being traversed is the dynamic computing unit, obtain the first execution information corresponding to the dynamic computing unit, and execute the computing unit currently being traversed according to the first execution information.
[0108] Furthermore, it also includes:
[0109] The sixth execution module is configured to execute the second execution information corresponding to the computing unit currently traversed when the computing unit currently traversed is a non-dynamic execution unit; wherein the second execution information is located in the machine learning model.
[0110] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; and the fifth execution module includes:
[0111] The seventh execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
[0112] Furthermore, the first execution information includes a dynamic library; and the fifth execution module includes:
[0113] The eighth execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0114] Furthermore, the first execution information includes a script program; and the fifth execution module includes:
[0115] The ninth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0116] In an eighth aspect, an embodiment of the present invention provides an updating device, including:
[0117] an eighth acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes preset mapping information and first execution information; the preset mapping information includes a mapping relationship between the first execution information and a preset computing unit in the machine learning model;
[0118] a second deployment module, configured to redeploy the machine learning model according to the updated data;
[0119] The seventh execution module is configured to traverse and execute the machine learning model in response to an execution request for the machine learning model, and when the computing unit currently traversed matches the preset computing unit in the preset mapping information, execute the computing unit currently traversed according to the first execution information.
[0120] Furthermore, it also includes:
[0121] The eighth execution module is configured to execute the second execution information corresponding to the computing unit currently traversed when the computing unit currently traversed does not match the preset computing unit in the preset mapping information; wherein the second execution information is located in the machine learning model.
[0122] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; and the seventh execution module includes:
[0123] The tenth execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
[0124] Furthermore, the first execution information includes a dynamic library; and the seventh execution module includes:
[0125] The eleventh execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0126] Furthermore, the first execution information includes a script program; and the seventh execution module includes:
[0127] The twelfth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0128] The functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions.
[0129] In one possible design, the structure of the execution device or update device includes a memory and a processor, the memory is used to store one or more computer instructions that support the execution device or update device to execute any of the above methods, and the processor is configured to execute the computer instructions stored in the memory. The execution device or update device may also include a communication interface for the execution device or update device to communicate with other devices or communication networks.
[0130] In a ninth aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method described in any one of the above aspects.
[0131] In a tenth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by a security authentication device for an enterprise account, which includes computer instructions involved in executing the method described in any of the above aspects.
[0132] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0133] In the embodiment of the present disclosure, during the traversal and execution of the machine learning model, when the currently traversed computing unit is a dynamic computing unit, the preset update position corresponding to the dynamic computing unit is determined, and the first execution information of the dynamic computing unit is obtained from the preset update position, and the currently traversed computing unit is executed according to the first execution information. In this way, when the execution logic of the dynamic execution unit changes, the changed execution logic can be deployed to the preset update position, and the machine learning model can obtain and execute the updated execution logic from the preset update position when it is traversed and executed, which can make it possible for application scenarios of machine learning models such as clients to avoid the need to issue new application versions after the machine learning model is updated, thereby greatly reducing costs.
[0134] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0135] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:
[0136] Figure 1 A complete schematic diagram of the process of updating a machine learning model according to an embodiment of the present disclosure is shown;
[0137] Figure 2 A flowchart showing an execution method according to an embodiment of the present disclosure is shown;
[0138] Figure 3 A flowchart showing execution of a non-updated computing unit portion according to an embodiment of the present disclosure is shown;
[0139] Figure 4 Show according to Figure 2 Flow chart of step S202 of the illustrated embodiment;
[0140] Figure 5 A flowchart showing an updating method according to an embodiment of the present disclosure is shown;
[0141] Figure 6 A flowchart showing an execution method according to another embodiment of the present disclosure;
[0142] Figure 7 A flowchart showing an updating method according to another embodiment of the present disclosure;
[0143] Figure 8 A structural block diagram of an execution device according to an embodiment of the present disclosure is shown;
[0144] Fig. 9 A structural block diagram of an execution device according to another embodiment of the present disclosure is shown;
[0145] Fig.10 A structural block diagram showing a portion of a non-updated computing unit executed according to an embodiment of the present disclosure;
[0146] Fig.11 Show according to Fig. 9 A structural block diagram of the fourth acquisition module 902 of the illustrated embodiment;
[0147] Fig.12 A structural block diagram showing a redeployment portion of an updated machine learning model according to an embodiment of the present disclosure;
[0148] Fig.13 A structural block diagram of an updating device according to an embodiment of the present disclosure is shown;
[0149] Fig.14 A structural block diagram of an updating device according to another embodiment of the present disclosure is shown;
[0150] Fig.15 It is a structural diagram of an electronic device suitable for implementing an execution method or an update method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0151] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0152] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.
[0153] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0154] Figure 1 FIG. 1 shows a complete flow chart of updating a machine learning model according to an embodiment of the present disclosure. Figure 1As shown, after the machine learning model training is completed, the machine learning model is packaged into an application and uploaded to the server 101, the client 102 obtains the installation file of the application from the server 101, and installs it locally on the client 101, and the local CPU executes the application. Afterwards, if the computing unit in the machine learning model is updated, for example, a new computing unit is added or an existing computing unit is modified, a corresponding relationship between the identifier of the computing unit to be added or modified and the execution information corresponding to the computing unit (for example, the execution logic and operating parameters of the computing unit, etc.) can be established, and the preset mapping relationship table is written into the machine learning model, and uploaded to the server 101 together with the execution information of the computing unit to be added or modified, or the above-mentioned mapping relationship table is not written into the machine learning model, but is uploaded to the server 101 alone as configuration information together with the execution information of the computing unit to be added or modified. The server 101 can actively notify the client 102 that the machine learning model has been updated, or when the client 102 periodically inquires the server 101, it notifies the client 102 that the machine learning model has been updated. The client 102 obtains the execution information of the machine learning model and the added or modified computing unit from the server 101, and saves it on the storage device 1021 of the client 102. When the user opens the application whose function is realized by the machine learning model through the client 102, the client 102 loads the machine learning model on the CPU 1022, and traverses and executes the computing units in the machine learning model. For the currently traversed computing unit, first determine whether the computing unit is a dynamic computing unit according to the above-mentioned mapping relationship table. For example, if the currently traversed computing unit has a mapping relationship in the mapping relationship table, the computing unit can be considered to be a dynamic computing unit; if the computing unit is a dynamic computing unit, the storage location of the execution information having a mapping relationship with the dynamic computing unit is determined according to the mapping relationship table, and the execution information is loaded to the GPU 1023 of the client. After the GPU 1023 configures the execution logic of the computing unit using the running parameters in the execution information, the execution logic is executed on the GPU 1023 to realize the computing task of the computing unit.
[0155] It is understandable that the above-mentioned execution logic in the embodiments of the present disclosure is not limited to being executed on GPU 1023, but can also be executed in various machine learning acceleration hardware, such as FPGA / ASIC / GPA, etc.
[0156] It can also be understood that the embodiments of the present disclosure are not limited to the use of machine learning models to implement applications on the client, but can also be used in application scenarios such as self-management and data centers. When the embodiments of the present disclosure are applied in a data center, updates can be performed without interrupting data services and without the need for large-scale upgrades.
[0157] It should be noted that, in order to enable dynamic execution on GPU 1023, the execution logic having a mapping relationship with the dynamic computing unit can be implemented as a shader program.
[0158] It should also be noted that the execution logic in the execution information can also be implemented as a dynamic library or a script program. When implemented as a dynamic library or a script program, the execution logic of the dynamic computing unit can also be loaded onto the CPU 1022 of the client 102 for execution.
[0159] Figure 2 FIG. 1 is a flowchart showing an execution method according to an embodiment of the present disclosure. Figure 2 As shown, the execution method includes the following steps:
[0160] In step S201, when traversing and executing the machine learning model, the currently traversed computing unit is matched with the preset mapping information; wherein the preset mapping information includes a mapping relationship between the preset computing unit in the machine learning model and the first execution information;
[0161] In step S202, after the matching is successful, first execution information having a mapping relationship with the currently traversed computing unit is acquired according to the preset mapping information;
[0162] In step S203, the computing unit currently being traversed is executed according to the first execution information.
[0163] In this embodiment, the machine learning model can be encapsulated into an application so that the machine learning model can be deployed on the client by installing the application. The machine learning model may include multiple computing units and the connection relationship between the multiple computing units; each computing unit can complete a computing task. The computing task of the computing unit can be implemented by a computer program code, which is specifically related to the type of machine learning model. For example, a neuron in a neural network model can be a computing unit. The connection relationship between multiple computing units may include but is not limited to a sequential execution relationship and / or a parallel execution relationship. This embodiment is illustrated by using an application as an example, but it can be understood that the embodiment of the present disclosure is not limited to using a machine learning model to implement an application on the client, but can also be used in application scenarios such as self-management and data centers. When the embodiment of the present disclosure is applied in a data center, it can be updated without interrupting data services, and there is no need for large-scale upgrades.
[0164] When the application is installed on the client, the computing units in the machine learning model are also deployed on the client according to the installation environment at that time (such as CPU environment, cache size, etc.). When the application is opened and run on the client, the input data is input into the machine learning model, and the computing units in the machine learning model are traversed and executed to obtain the output results.
[0165] The application is executed on the CPU of the client device, so the execution environment of the computing unit in the machine learning model is the CPU environment when the application is installed. If the machine learning model needs to be updated, such as the computing unit needs to be modified or a new computing unit needs to be added, the application can be reinstalled on the client device so that the updated machine learning model can be deployed on the client device, so that the modified or newly added computing unit can be executed in the current CPU environment of the client device. However, this method requires the issuance of a new version of the application. If there are many clients using the application, the issuance cost is high.
[0166] In this embodiment, when the machine learning model is updated, in order not to issue a new version of the application, preset mapping information is first established according to the updated data of the machine learning model, and the preset mapping information includes the mapping relationship between the newly added computing unit or the modified computing unit and the first execution information. The first execution information may include but is not limited to the execution logic and operation parameters of the computing unit; the execution logic may be a section of program code for implementing the computing task corresponding to the computing unit, and the operation parameters may include but are not limited to the execution environment information of the execution logic (such as cache size, etc.), the input of the computing unit (such as from which computing unit the input is obtained), the output of the computing unit (such as to which unit the execution result of the computing unit is outputted, etc.), etc.
[0167] After the preset mapping information is established, the preset mapping information can be written into the machine learning model, or the preset mapping information can be saved as a configuration file separately, and then the updated data such as the machine learning model, the preset mapping information and the first execution information are uploaded to the server. The server can notify the client that the machine learning model has updated data and send the updated data to the client, or the client can periodically query the server and obtain the updated data from the server. It should be noted that if the preset mapping information is saved as a configuration file separately, the entire machine learning model can be sent to the client, but the preset mapping information and the first execution information can be sent to the client.
[0168] After the client receives the updated data of the machine learning model, the updated data can be stored in a local storage device. When the application corresponding to the machine learning model is opened on the client and the machine learning model is traversed and executed by the application, for each currently traversed computing unit, it can be checked whether the preset mapping information records the updated information of the computing unit, that is, the currently traversed computing unit is matched with the content in the preset mapping information. If there is a matching content in the preset mapping information, it can be considered that the execution information of the computing unit has been updated. Therefore, the first execution information having a mapping relationship with the computing unit can be determined based on the mapping relationship in the preset mapping information, and then the first execution information can be obtained from the corresponding storage location, and the currently traversed computing unit is executed according to the first execution information.
[0169] For example, the first execution information may include the updated program code and operating parameters of the computing task corresponding to the computing unit, and the program code may be configured through the operating parameters, and loaded and executed to implement the computing task of the computing unit. After the currently traversed computing unit is executed, the next computing unit may be executed. Of course, it is understandable that multiple computing units in the machine learning model may also be in a parallel execution relationship. While the currently traversed computing unit is being executed, other computing units may also be traversed and executed in the same way.
[0170] It should be noted that when the machine learning model is updated to add a new computing unit, the updated machine learning model, the preset mapping information and the first execution information need to be uploaded to the server and downloaded locally by the client. Because the calculation timing of the newly added computing unit in the machine learning model (for example, which computing units the newly added computing unit is connected to, and which computing units are executed after, etc.) is written in the machine learning model, it is necessary to dynamically deploy the entire updated machine learning model to the client locally, and when the client traverses and executes the machine learning model, it also traverses and executes the updated machine learning model.
[0171] In the traversal execution process of the machine learning model, the embodiment of the present disclosure matches the currently traversed computing unit with the preset mapping information, and the preset mapping information includes the mapping relationship between the preset computing unit in the machine learning model and the first execution information. After the match is successful, the first execution information having a mapping relationship with the currently traversed computing unit can be obtained according to the preset mapping information, and the currently traversed computing unit can be executed according to the first execution information. In this way, when the execution logic of the computing unit changes, a mapping relationship between the changed execution logic and the computing unit can be established, and when the machine learning model is executed, the updated execution logic can be obtained and executed according to the mapping relationship, so that in the application scenarios of the machine learning model such as the client, after the machine learning model is updated, there is no need to issue a new application version, thereby greatly reducing the cost.
[0172] In an optional implementation of this embodiment, Figure 3 As shown, the method further comprises the following steps:
[0173] In step S301, after the matching fails, the second execution information of the computing unit currently being traversed is obtained from the machine learning model;
[0174] In step S302, the computing unit currently being traversed is executed according to the second execution information.
[0175] In this optional implementation, for the computing units in the machine learning model that have not been updated, the second execution information can be obtained from the machine learning model. The second execution information is the original execution information of the computing unit in the machine model, which is configured according to the installation environment at that time when the application is installed. Therefore, the second execution information can be directly executed on the CPU of the client device.
[0176] In an optional implementation of this embodiment, Figure 4 As shown, the step S202, i.e., the step of acquiring first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information, further includes the following steps:
[0177] In step S401, a method for obtaining the first execution information is determined according to the preset mapping information; wherein the method for obtaining includes an identifier and / or a storage location of the first execution information;
[0178] In step S402, the first execution information is acquired from a local storage device according to the identifier and / or storage location of the first execution information.
[0179] In this optional implementation, the preset mapping information may include a mapping relationship between a newly added or updated preset computing unit and the first execution information. The mapping relationship may specifically be a mapping relationship between an identifier of the preset computing unit and an identifier and / or a relative storage position of the first execution information. Therefore, after the identifier and / or relative storage of the first execution information is determined according to the mapping relationship, the first execution information can be found from the client's storage device and the first execution information can be obtained from the storage device. It should be noted that the relative storage position of the first execution information may be the position of the first execution information in the current update data. After receiving the update data of the machine learning model from the server, the client may store the update data on the local storage device and record the starting position of the update data on the local storage device. When obtaining the first execution information, the actual storage address of the first execution information on the client's local storage device may be determined by the starting position and the relative position in the preset mapping information, and then the first execution information may be obtained from the actual storage address.
[0180] In an optional implementation of this embodiment, the first execution information includes a shader program and operating parameters of the shader program; step S203, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0181] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0182] In this optional implementation, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can be implemented using a shader program. Since the shader program runs on the GPU and can be dynamically configured and loaded, after the shader program is used to implement the newly added or modified computing unit in the machine learning model, the shader program can be directly loaded onto the GPU for execution after the running parameters are configured, without the need to reinstall the installation program encapsulating the machine learning model in the CPU environment of the client device. Since the program executed on the CPU needs to be automatically configured according to the CPU environment during the installation process (for example, configuring cache information, etc.) before it can be executed, and the shader program can be dynamically configured and loaded for execution on the GPU, the dynamic expansion and modification of the computing unit in the machine learning model can be achieved by executing the shader program on the GPU. It can be understood that the above-mentioned execution logic in the embodiment of the present disclosure is not limited to execution on GPU 1023, but can also be executed in various machine learning acceleration hardware, such as FPGA / ASIC / GPA, etc.
[0183] In an optional implementation of this embodiment, the first execution information includes a dynamic library; step S203, i.e., executing the computing unit currently being traversed according to the first execution information, further includes the following steps:
[0184] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0185] In this optional implementation, if the CPU environment of the client device supports a just-in-time compilation environment such as a JIT environment, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented in the form of a dynamic library. In this way, the newly added or modified computing unit can be implemented as a dynamic library, and when the machine learning model is loaded and executed on the CPU, the computing task of the computing unit is implemented by dynamically loading the dynamic library.
[0186] In an optional implementation of this embodiment, the first execution information includes a script program; step S203, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0187] The script program is loaded and executed in the virtual machine environment of the CPU.
[0188] In this optional implementation, the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented by using a script. By executing a virtual machine on the CPU, and when executing the computing unit on the machine learning model, the corresponding script is loaded into the virtual machine for execution to complete the computing task of the computing unit.
[0189] In an optional implementation of this embodiment, the method further includes the following steps:
[0190] Acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0191] The update data is stored.
[0192] In this optional implementation, after the client installs the application program encapsulating the machine learning model, if the machine learning model is updated, the client can obtain the updated data of the machine learning model from the server and store it locally on the client. The updated data includes preset mapping information and first execution information. The preset mapping information includes the mapping relationship between the newly added or modified preset computing unit in the machine learning model and the first execution information preset for the computing unit. The first execution information may include but is not limited to the execution logic and operating parameters of the preset computing unit. After the client stores the updated data in the local storage device, the dynamic deployment of the updated machine learning model is completed. When executing the machine learning model, the preset computing unit can be executed according to the preset mapping information and the first execution information, while other computing units can still be executed based on the execution logic of the machine learning model.
[0193] Figure 5 FIG. 1 is a flow chart showing an updating method according to an embodiment of the present disclosure. Figure 5 As shown, the updating method comprises the following steps:
[0194] In step S501, update data of the machine learning model is obtained; wherein the update data includes preset mapping information and first execution information; the preset mapping information includes a mapping relationship between the first execution information and a preset computing unit in the machine learning model;
[0195] In step S502, the machine learning model is redeployed according to the updated data;
[0196] In step S503, in response to an execution request for the machine learning model, the machine learning model is traversed and executed, and when the computing unit currently traversed matches the preset computing unit in the preset mapping information, the computing unit currently traversed is executed according to the first execution information.
[0197] In this embodiment, the machine learning model can be encapsulated into an application so that the machine learning model can be deployed on the client by installing the application. The machine learning model may include multiple computing units and connection relationships between the multiple computing units; each computing unit can complete a computing task. The computing task of the computing unit can be implemented by a computer program code, which is specifically related to the type of machine learning model. For example, a neuron in a neural network model can be a computing unit. The connection relationship between multiple computing units may include, but is not limited to, a sequential execution relationship and / or a parallel execution relationship.
[0198] When the application is installed on the client, the computing units in the machine learning model are also deployed on the client according to the installation environment at that time (such as CPU environment, cache size, etc.). When the application is opened and run on the client, the input data is input into the machine learning model, and the computing units in the machine learning model are traversed and executed to obtain the output results.
[0199] The application is executed on the CPU of the client device, so the execution environment of the computing unit in the machine learning model is the CPU environment when the application is installed. If the machine learning model needs to be updated, such as the computing unit needs to be modified or a new computing unit needs to be added, the application can be reinstalled on the client device so that the updated machine learning model can be deployed on the client device, so that the modified or newly added computing unit can be executed in the current CPU environment of the client device. However, this method requires the issuance of a new version of the application. If there are many clients using the application, the issuance cost is high.
[0200] In this embodiment, when the machine learning model is updated, in order not to issue a new version of the application, preset mapping information is first established according to the updated data of the machine learning model, and the preset mapping information includes the mapping relationship between the newly added computing unit or the modified computing unit and the first execution information. The first execution information may include but is not limited to the execution logic and operation parameters of the computing unit; the execution logic may be a section of program code for implementing the computing task corresponding to the computing unit, and the operation parameters may include but are not limited to the execution environment information of the execution logic (such as cache size, etc.), the input of the computing unit (such as from which computing unit the input is obtained), the output of the computing unit (such as to which unit the execution result of the computing unit is outputted, etc.), etc.
[0201] After the preset mapping information is established, the preset mapping information can be written into the machine learning model, or the preset mapping information can be saved as a configuration file separately, and then the updated data such as the machine learning model, the preset mapping information and the first execution information are uploaded to the server. The server can notify the client that the machine learning model has updated data and send the updated data to the client, or the client can periodically query the server and obtain the updated data from the server. It should be noted that if the preset mapping information is saved as a configuration file separately, the entire machine learning model can be sent to the client, but the preset mapping information and the first execution information can be sent to the client.
[0202] The client can obtain the updated data of the machine learning model from the server and store it locally on the client. The updated data includes preset mapping information and first execution information. The preset mapping information includes the mapping relationship between the newly added or modified preset computing unit in the machine learning model and the first execution information preset for the computing unit. The first execution information may include but is not limited to the execution logic and operating parameters of the preset computing unit. After the client stores the updated data in the local storage device, the dynamic deployment of the updated machine learning model is completed. When executing the machine learning model, the preset computing unit can be executed according to the preset mapping information and the first execution information, while other computing units can still be executed based on the execution logic of the machine learning model.
[0203] The user can open the application corresponding to the machine learning model on the client so that when the application traverses and executes the machine learning model, it can check whether the update information of each computing unit currently traversed is recorded in the preset mapping information, that is, match the computing unit currently traversed with the content in the preset mapping information. If there is matching content in the preset mapping information, it can be considered that the execution information of the computing unit has been updated. Therefore, the first execution information that has a mapping relationship with the computing unit can be determined according to the mapping relationship in the preset mapping information, and then the first execution information can be obtained from the corresponding storage location, and the computing unit currently traversed is executed according to the first execution information.
[0204] For example, the first execution information may include the updated program code and operating parameters of the computing task corresponding to the computing unit, and the program code may be configured through the operating parameters, and loaded and executed to implement the computing task of the computing unit. After the currently traversed computing unit is executed, the next computing unit may be executed. Of course, it is understandable that multiple computing units in the machine learning model may also be in a parallel execution relationship. While the currently traversed computing unit is being executed, other computing units may also be traversed and executed in the same way.
[0205] It should be noted that when the machine learning model is updated to add a new computing unit, the updated machine learning model, the preset mapping information and the first execution information need to be uploaded to the server and downloaded locally by the client. Because the calculation timing of the newly added computing unit in the machine learning model (for example, which computing units the newly added computing unit is connected to, and which computing units are executed after, etc.) is written in the machine learning model, it is necessary to dynamically deploy the entire updated machine learning model to the client locally, and when the client traverses and executes the machine learning model, it also traverses and executes the updated machine learning model.
[0206] In the traversal execution process of the machine learning model, the embodiment of the present disclosure matches the currently traversed computing unit with the preset mapping information, and the preset mapping information includes the mapping relationship between the preset computing unit in the machine learning model and the first execution information. After the match is successful, the first execution information having a mapping relationship with the currently traversed computing unit can be obtained according to the preset mapping information, and the currently traversed computing unit can be executed according to the first execution information. In this way, when the execution logic of the computing unit changes, a mapping relationship between the changed execution logic and the computing unit can be established, and when the machine learning model is executed, the updated execution logic can be obtained and executed according to the mapping relationship, so that in the application scenarios of the machine learning model such as the client, after the machine learning model is updated, there is no need to issue a new application version, thereby greatly reducing the cost.
[0207] In an optional implementation of this embodiment, the method further includes the following steps:
[0208] When the computing unit currently being traversed does not match the preset computing unit in the preset mapping information, execute the second execution information corresponding to the computing unit currently traversed; wherein the second execution information is located in the machine learning model.
[0209] In this optional implementation, the preset mapping information stores a mapping relationship between a newly added or modified computing unit and the corresponding first execution information. If it is an unmodified computing unit in the original framework of the machine learning model, the corresponding information does not exist in the preset mapping information. Therefore, for a computing unit that has not been updated in the machine learning model, the second execution information can be obtained from the machine learning model. The second execution information is the original execution information of the computing unit in the machine model, which is configured according to the installation environment at the time when the application is installed. Therefore, the second execution information can be directly executed on the CPU of the client device.
[0210] In an optional implementation of this embodiment, the first execution information includes a shader program and operating parameters of the shader program; in step S503, executing the steps of the currently traversed computing unit according to the first execution information further includes the following steps:
[0211] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0212] In this optional implementation, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can be implemented using a shader program. Since the shader program runs on the GPU and can be dynamically configured and loaded, after using the shader program to implement the newly added or modified computing unit in the machine learning model, the shader program can be directly loaded onto the GPU for execution after being configured with running parameters, without having to reinstall the installation program encapsulating the machine learning model in the CPU environment of the client device. Since the program executed on the CPU needs to be automatically configured according to the CPU environment during the installation process (for example, configuring cache information, etc.) before it can be executed, and the shader program can be dynamically configured and loaded for execution on the GPU, the dynamic expansion and modification of the computing units in the machine learning model can be achieved by executing the shader program on the GPU.
[0213] In an optional implementation of this embodiment, the first execution information includes a dynamic library; step S503, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0214] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0215] In this optional implementation, if the CPU environment of the client device supports a just-in-time compilation environment such as a JIT environment, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented in the form of a dynamic library. In this way, the newly added or modified computing unit can be implemented as a dynamic library, and when the machine learning model is loaded and executed on the CPU, the computing task of the computing unit is implemented by dynamically loading the dynamic library.
[0216] In an optional implementation of this embodiment, the first execution information includes a script program; step S503, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0217] The script program is loaded and executed in the virtual machine environment of the CPU.
[0218] In this optional implementation, the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented by using a script. By executing a virtual machine on the CPU, and when executing the computing unit on the machine learning model, the corresponding script is loaded into the virtual machine for execution to complete the computing task of the computing unit.
[0219] Figure 6FIG. 1 is a flowchart showing an execution method according to another embodiment of the present disclosure. Figure 6 As shown, the execution method includes the following steps:
[0220] In step S601, in the process of traversing and executing the machine learning model, when the computing unit currently traversed is a dynamic computing unit, determining a preset update position corresponding to the dynamic computing unit;
[0221] In step S602, first execution information of the dynamic calculation unit is obtained from the preset update position;
[0222] In step S603, the computing unit currently being traversed is executed according to the first execution information.
[0223] In this embodiment, the machine learning model can be encapsulated into an application so that the machine learning model can be deployed on the client by installing the application. The machine learning model may include multiple computing units and the connection relationship between the multiple computing units; each computing unit can complete a computing task. The computing task of the computing unit can be implemented by a computer program code, which is specifically related to the type of machine learning model. For example, a neuron in a neural network model can be a computing unit. The connection relationship between multiple computing units may include but is not limited to a sequential execution relationship and / or a parallel execution relationship. This embodiment is illustrated by using an application as an example, but it can be understood that the embodiment of the present disclosure is not limited to using a machine learning model to implement an application on the client, but can also be used in application scenarios such as self-management and data centers. When the embodiment of the present disclosure is applied in a data center, it can be updated without interrupting data services, and there is no need for large-scale upgrades.
[0224] When the application is installed on the client, the computing units in the machine learning model are also deployed on the client according to the installation environment at that time (such as CPU environment, cache size, etc.). When the application is opened and run on the client, the input data is input into the machine learning model, and the computing units in the machine learning model are traversed and executed to obtain the output results.
[0225] The application is executed on the CPU of the client device, so the execution environment of the computing unit in the machine learning model is the CPU environment when the application is installed. If the machine learning model needs to be updated, such as the computing unit needs to be modified or a new computing unit needs to be added, the application can be reinstalled on the client device so that the updated machine learning model can be deployed on the client device, so that the modified or newly added computing unit can be executed in the current CPU environment of the client device. However, this method requires the issuance of a new version of the application. If there are many clients using the application, the issuance cost is high.
[0226] In this embodiment, when the machine learning model is updated, in order not to issue a new version of the application, the modified or newly added computing unit is first set as a dynamic computing unit according to the updated data of the machine learning model, and a mapping relationship between the dynamic computing unit and the first execution information is established. For example, preset mapping information can be established, and the preset mapping information includes a mapping relationship between the newly added computing unit or the modified computing unit and the first execution information, and can also include the storage location of the first execution information, according to which the preset update location corresponding to the dynamic computing unit can be obtained. The preset update location can be the local storage location of the first execution information. The first execution information can include but is not limited to the execution logic and operation parameters of the computing unit; the execution logic can be a section of program code for implementing the computing task corresponding to the dynamic computing unit, and the operation parameters can include but are not limited to the execution environment information of the execution logic (such as cache size, etc.), the input of the dynamic computing unit (such as which computing unit to obtain the input from), the output of the dynamic computing unit (such as which unit to output the execution result of the computing unit, etc.), etc.
[0227] After the preset mapping information is established, the preset mapping information can be written into the machine learning model, or the preset mapping information can be saved as a configuration file separately, and then the updated data such as the machine learning model, the preset mapping information and the first execution information are uploaded to the server. The server can notify the client that the machine learning model has updated data and send the updated data to the client, or the client can periodically query the server and obtain the updated data from the server. It should be noted that if the preset mapping information is saved as a configuration file separately, the entire machine learning model can be sent to the client, but the preset mapping information and the first execution information can be sent to the client.
[0228] After the client receives the updated data of the machine learning model, the updated data can be stored in a local storage device. When the application corresponding to the machine learning model is opened on the client, and the machine learning model is traversed and executed by the application, it can be determined whether each currently traversed computing unit is a dynamic computing unit. For example, it can be determined whether it is a dynamic computing unit by checking whether the update information of the computing unit is recorded in the preset mapping information, that is, the currently traversed computing unit is matched with the content in the preset mapping information. If there is a matching content in the preset mapping information, it can be considered that the execution information of the computing unit has been updated. Therefore, the first execution information having a mapping relationship with the computing unit can be determined according to the mapping relationship in the preset mapping information, and then the first execution information is obtained from the corresponding storage location, and the currently traversed computing unit is executed according to the first execution information. Of course, it can be understood that other methods can also be used, such as setting the category of the dynamic computing unit to a preset category, so as to determine whether the currently traversed computing unit is a dynamic computing unit by checking the preset category. If it is a dynamic computing unit, the first execution information having a mapping relationship with the dynamic computing unit can be obtained according to the preset mapping information.
[0229] For example, the first execution information may include the updated program code and operating parameters of the computing task corresponding to the computing unit, and the program code may be configured through the operating parameters, and loaded and executed to implement the computing task of the computing unit. After the currently traversed computing unit is executed, the next computing unit may be executed. Of course, it is understandable that multiple computing units in the machine learning model may also be in a parallel execution relationship. While the currently traversed computing unit is being executed, other computing units may also be traversed and executed in the same way.
[0230] It should be noted that when the machine learning model is updated to add a new computing unit, the updated machine learning model, the preset mapping information and the first execution information need to be uploaded to the server and downloaded locally by the client. Because the calculation timing of the newly added computing unit in the machine learning model (for example, which computing units the newly added computing unit is connected to, and which computing units are executed after, etc.) is written in the machine learning model, it is necessary to dynamically deploy the entire updated machine learning model to the client locally, and when the client traverses and executes the machine learning model, it also traverses and executes the updated machine learning model.
[0231] In the embodiment of the present disclosure, during the traversal and execution of the machine learning model, when the currently traversed computing unit is a dynamic computing unit, the preset update position corresponding to the dynamic computing unit is determined, and the first execution information of the dynamic computing unit is obtained from the preset update position, and the currently traversed computing unit is executed according to the first execution information. In this way, when the execution logic of the dynamic execution unit changes, the changed execution logic can be deployed to the preset update position, and the machine learning model can obtain and execute the updated execution logic from the preset update position when it is traversed and executed, which can make it possible for application scenarios of machine learning models such as clients to avoid the need to issue new application versions after the machine learning model is updated, thereby greatly reducing costs.
[0232] In an optional implementation of this embodiment, the method further includes the following steps:
[0233] When the currently traversed computing unit is a non-dynamic computing unit, obtaining second execution information of the currently traversed computing unit from the machine learning model;
[0234] The computing unit currently being traversed is executed according to the second execution information.
[0235] In this optional implementation, for the computing units in the machine learning model that have not been updated, the second execution information can be obtained from the machine learning model. The second execution information is the original execution information of the computing unit in the machine model, which is configured according to the installation environment at that time when the application is installed. Therefore, the second execution information can be directly executed on the CPU of the client device.
[0236] In an optional implementation of this embodiment, the step S601, i.e., the step of determining the preset update position corresponding to the dynamic calculation unit, further includes the following steps:
[0237] Matching the dynamic calculation unit with preset mapping information;
[0238] The preset update position corresponding to the dynamic calculation unit is obtained according to the matching result.
[0239] In this optional implementation, the preset update position corresponding to the dynamic computing unit can be implemented by presetting preset mapping information. The preset mapping information may include a mapping relationship between the dynamic computing unit and the first execution information, and may also include a storage location of the first execution information, according to which the preset update position corresponding to the dynamic computing unit can be obtained. In this way, when the machine learning model is executed, it obtains and executes the updated execution logic according to the mapping relationship, which enables the application scenarios of the machine learning model such as the client to avoid the need to issue a new application version after the machine learning model is updated, thereby greatly reducing costs.
[0240] In some embodiments, the preset mapping information may include a mapping relationship between a newly added or updated preset computing unit and the first execution information. The mapping relationship may specifically be a mapping relationship between an identifier of the preset computing unit and an identifier and / or a relative storage position of the first execution information. Therefore, after the identifier and / or relative storage of the first execution information is determined according to the mapping relationship, the first execution information can be found from the storage device of the client and the first execution information can be obtained from the storage device. It should be noted that the relative storage position of the first execution information may be the position of the first execution information in the current update data. After receiving the update data of the machine learning model from the server, the client may store the update data on the local storage device and record the starting position of the update data on the local storage device. When obtaining the first execution information, the real storage address of the first execution information on the local storage device of the client may be determined by the starting position and the relative position in the preset mapping information, and then the first execution information may be obtained from the real storage address.
[0241] In an optional implementation of this embodiment, the first execution information includes a shader program and operating parameters of the shader program; step S603, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0242] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0243] In this optional implementation, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can be implemented using a shader program. Since the shader program runs on the GPU and can be dynamically configured and loaded, after the shader program is used to implement the newly added or modified computing unit in the machine learning model, the shader program can be directly loaded onto the GPU for execution after the running parameters are configured, without the need to reinstall the installation program encapsulating the machine learning model in the CPU environment of the client device. Since the program executed on the CPU needs to be automatically configured according to the CPU environment during the installation process (for example, configuring cache information, etc.) before it can be executed, and the shader program can be dynamically configured and loaded for execution on the GPU, the dynamic expansion and modification of the computing unit in the machine learning model can be achieved by executing the shader program on the GPU. It can be understood that the above-mentioned execution logic in the embodiment of the present disclosure is not limited to execution on GPU 1023, but can also be executed in various machine learning acceleration hardware, such as FPGA / ASIC / GPA, etc.
[0244] In an optional implementation of this embodiment, the first execution information includes a dynamic library; step S603, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0245] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0246] In this optional implementation, if the CPU environment of the client device supports a just-in-time compilation environment such as a JIT environment, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented in the form of a dynamic library. In this way, the newly added or modified computing unit can be implemented as a dynamic library, and when the machine learning model is loaded and executed on the CPU, the computing task of the computing unit is implemented by dynamically loading the dynamic library.
[0247] In an optional implementation of this embodiment, the first execution information includes a script program; step S603, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0248] The script program is loaded and executed in the virtual machine environment of the CPU.
[0249] In this optional implementation, the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented by using a script. By executing a virtual machine on the CPU, and when executing the computing unit on the machine learning model, the corresponding script is loaded into the virtual machine for execution to complete the computing task of the computing unit.
[0250] In an optional implementation of this embodiment, the method further includes the following steps:
[0251] Acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0252] The update data is stored.
[0253] In this optional implementation, after the client installs the application program encapsulating the machine learning model, if the machine learning model is updated, the client can obtain the updated data of the machine learning model from the server and store it locally on the client. The updated data includes preset mapping information and first execution information. The preset mapping information includes the mapping relationship between the newly added or modified preset computing unit in the machine learning model and the first execution information preset for the computing unit. The first execution information may include but is not limited to the execution logic and operating parameters of the preset computing unit. After the client stores the updated data in the local storage device, the dynamic deployment of the updated machine learning model is completed. When executing the machine learning model, the preset computing unit can be executed according to the preset mapping information and the first execution information, while other computing units can still be executed based on the execution logic of the machine learning model.
[0254] Figure 7 FIG. 1 is a flow chart showing an updating method according to another embodiment of the present disclosure. Figure 7 As shown, the updating method comprises the following steps:
[0255] In step S701, update data of the machine learning model is obtained; wherein the update data includes first execution information corresponding to at least one dynamic computing unit in the machine learning model;
[0256] In step S702, the machine learning model is redeployed according to the updated data;
[0257] In step S703, in response to an execution request for the machine learning model, the machine learning model is traversed and executed, and when the computing unit currently being traversed is the dynamic computing unit, the first execution information corresponding to the dynamic computing unit is obtained, and the computing unit currently being traversed is executed according to the first execution information.
[0258] In this embodiment, the machine learning model can be encapsulated into an application so that the machine learning model can be deployed on the client by installing the application. The machine learning model may include multiple computing units and connection relationships between the multiple computing units; each computing unit can complete a computing task. The computing task of the computing unit can be implemented by a computer program code, which is specifically related to the type of machine learning model. For example, a neuron in a neural network model can be a computing unit. The connection relationship between multiple computing units may include, but is not limited to, a sequential execution relationship and / or a parallel execution relationship.
[0259] When the application is installed on the client, the computing units in the machine learning model are also deployed on the client according to the installation environment at that time (such as CPU environment, cache size, etc.). When the application is opened and run on the client, the input data is input into the machine learning model, and the computing units in the machine learning model are traversed and executed to obtain the output results.
[0260] The application is executed on the CPU of the client device, so the execution environment of the computing unit in the machine learning model is the CPU environment when the application is installed. If the machine learning model needs to be updated, such as the computing unit needs to be modified or a new computing unit needs to be added, the application can be reinstalled on the client device so that the updated machine learning model can be deployed on the client device, so that the modified or newly added computing unit can be executed in the current CPU environment of the client device. However, this method requires the issuance of a new version of the application. If there are many clients using the application, the issuance cost is high.
[0261] In this embodiment, when the machine learning model is updated, in order not to issue a new version of the application, the modified or newly added computing unit is first set as a dynamic computing unit according to the updated data of the machine learning model, and a mapping relationship between the dynamic computing unit and the first execution information is established. For example, preset mapping information can be established, and the preset mapping information includes a mapping relationship between the newly added computing unit or the modified computing unit and the first execution information, and can also include the storage location of the first execution information, according to which the preset update location corresponding to the dynamic computing unit can be obtained. The preset update location can be the local storage location of the first execution information. The first execution information can include but is not limited to the execution logic and operation parameters of the computing unit; the execution logic can be a section of program code for implementing the computing task corresponding to the dynamic computing unit, and the operation parameters can include but are not limited to the execution environment information of the execution logic (such as cache size, etc.), the input of the dynamic computing unit (such as which computing unit to obtain the input from), the output of the dynamic computing unit (such as which unit to output the execution result of the computing unit, etc.), etc.
[0262] After the preset mapping information is established, the preset mapping information can be written into the machine learning model, or the preset mapping information can be saved as a configuration file separately, and then the updated data such as the machine learning model, the preset mapping information and the first execution information are uploaded to the server. The server can notify the client that the machine learning model has updated data and send the updated data to the client, or the client can periodically query the server and obtain the updated data from the server. It should be noted that if the preset mapping information is saved as a configuration file separately, the entire machine learning model can be sent to the client, but the preset mapping information and the first execution information can be sent to the client.
[0263] The client can obtain the updated data of the machine learning model from the server and store it locally on the client. The updated data includes preset mapping information and first execution information. The preset mapping information includes the mapping relationship between the newly added or modified preset computing unit in the machine learning model and the first execution information preset for the computing unit. The first execution information may include but is not limited to the execution logic and operating parameters of the preset computing unit. After the client stores the updated data in the local storage device, the dynamic deployment of the updated machine learning model is completed. When executing the machine learning model, the preset computing unit can be executed according to the preset mapping information and the first execution information, while other computing units can still be executed based on the execution logic of the machine learning model.
[0264] The user can open the application corresponding to the machine learning model on the client so that the application can traverse and execute the machine learning model. For each currently traversed computing unit, it can determine whether it is a dynamic computing unit. For example, it can be determined whether the update information of the computing unit is recorded in the preset mapping information to determine whether it is a dynamic computing unit, that is, the currently traversed computing unit is matched with the content in the preset mapping information. If there is a matching content in the preset mapping information, it can be considered that the execution information of the computing unit has been updated. Therefore, the first execution information having a mapping relationship with the computing unit can be determined according to the mapping relationship in the preset mapping information, and then the first execution information is obtained from the corresponding storage location, and the currently traversed computing unit is executed according to the first execution information. Of course, it can be understood that other methods can also be used, such as setting the category of the dynamic computing unit to a preset category, so as to determine whether the currently traversed computing unit is a dynamic computing unit by checking the preset category. If it is a dynamic computing unit, the first execution information having a mapping relationship with the dynamic computing unit can be obtained according to the preset mapping information.
[0265] For example, the first execution information may include the updated program code and operating parameters of the computing task corresponding to the computing unit, and the program code may be configured through the operating parameters, and loaded and executed to implement the computing task of the computing unit. After the currently traversed computing unit is executed, the next computing unit may be executed. Of course, it is understandable that multiple computing units in the machine learning model may also be in a parallel execution relationship. While the currently traversed computing unit is being executed, other computing units may also be traversed and executed in the same way.
[0266] It should be noted that when the machine learning model is updated to add a new computing unit, the updated machine learning model, the preset mapping information and the first execution information need to be uploaded to the server and downloaded locally by the client. Because the calculation timing of the newly added computing unit in the machine learning model (for example, which computing units the newly added computing unit is connected to, and which computing units are executed after, etc.) is written in the machine learning model, it is necessary to dynamically deploy the entire updated machine learning model to the client locally, and when the client traverses and executes the machine learning model, it also traverses and executes the updated machine learning model.
[0267] In the embodiment of the present disclosure, during the traversal and execution of the machine learning model, when the currently traversed computing unit is a dynamic computing unit, the preset update position corresponding to the dynamic computing unit is determined, and the first execution information of the dynamic computing unit is obtained from the preset update position, and the currently traversed computing unit is executed according to the first execution information. In this way, when the execution logic of the dynamic execution unit changes, the changed execution logic can be deployed to the preset update position, and the machine learning model can obtain and execute the updated execution logic from the preset update position when it is traversed and executed, which can make it possible for application scenarios of machine learning models such as clients to avoid the need to issue new application versions after the machine learning model is updated, thereby greatly reducing costs.
[0268] In an optional implementation of this embodiment, the method further includes the following steps:
[0269] When the computing unit currently being traversed does not match the preset computing unit in the preset mapping information, execute the second execution information corresponding to the computing unit currently traversed; wherein the second execution information is located in the machine learning model.
[0270] In this optional implementation, the preset mapping information stores a mapping relationship between a newly added or modified computing unit and the corresponding first execution information. If it is an unmodified computing unit in the original framework of the machine learning model, the corresponding information does not exist in the preset mapping information. Therefore, for a computing unit that has not been updated in the machine learning model, the second execution information can be obtained from the machine learning model. The second execution information is the original execution information of the computing unit in the machine model, which is configured according to the installation environment at the time when the application is installed. Therefore, the second execution information can be directly executed on the CPU of the client device.
[0271] In an optional implementation of this embodiment, the first execution information includes a shader program and operating parameters of the shader program; in step S703, executing the steps of the currently traversed computing unit according to the first execution information further includes the following steps:
[0272] The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
[0273] In this optional implementation, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can be implemented using a shader program. Since the shader program runs on the GPU and can be dynamically configured and loaded, after using the shader program to implement the newly added or modified computing unit in the machine learning model, the shader program can be directly loaded onto the GPU for execution after being configured with running parameters, without having to reinstall the installation program encapsulating the machine learning model in the CPU environment of the client device. Since the program executed on the CPU needs to be automatically configured according to the CPU environment during the installation process (for example, configuring cache information, etc.) before it can be executed, and the shader program can be dynamically configured and loaded for execution on the GPU, the dynamic expansion and modification of the computing units in the machine learning model can be achieved by executing the shader program on the GPU.
[0274] In an optional implementation of this embodiment, the first execution information includes a dynamic library; step S703, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0275] The dynamic library is loaded and executed in the real-time editing environment of the CPU.
[0276] In this optional implementation, if the CPU environment of the client device supports a just-in-time compilation environment such as a JIT environment, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented in the form of a dynamic library. In this way, the newly added or modified computing unit can be implemented as a dynamic library, and when the machine learning model is loaded and executed on the CPU, the computing task of the computing unit is implemented by dynamically loading the dynamic library.
[0277] In an optional implementation of this embodiment, the first execution information includes a script program; step S703, i.e., executing the step of the currently traversed computing unit according to the first execution information, further includes the following steps:
[0278] The script program is loaded and executed in the virtual machine environment of the CPU.
[0279] In this optional implementation, the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented by using a script. By executing a virtual machine on the CPU, and when executing the computing unit on the machine learning model, the corresponding script is loaded into the virtual machine for execution to complete the computing task of the computing unit.
[0280] The following are embodiments of the apparatus of the present disclosure, which can be used to execute embodiments of the method of the present disclosure.
[0281] Figure 8 FIG. 1 shows a structural block diagram of an execution device according to an embodiment of the present disclosure. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 8 As shown, the execution device includes:
[0282] The first determination module 801 is configured to determine a preset update position corresponding to a dynamic computing unit when the computing unit currently being traversed is a dynamic computing unit during the process of traversing and executing the machine learning model;
[0283] A first acquisition module 802 is configured to acquire first execution information of the dynamic calculation unit from the preset update position;
[0284] The first execution module 803 is configured to execute the computing unit currently being traversed according to the first execution information.
[0285] Furthermore, it also includes:
[0286] A second acquisition module is configured to acquire second execution information of the currently traversed computing unit from the machine learning model when the currently traversed computing unit is a non-dynamic computing unit;
[0287] The second execution module is configured to execute the computing unit currently being traversed according to the second execution information.
[0288] Furthermore, the first determining module includes:
[0289] A first matching submodule, configured to match the dynamic calculation unit with preset mapping information;
[0290] The first acquisition submodule is configured to acquire the preset update position corresponding to the dynamic calculation unit according to the matching result.
[0291] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; and the first execution module includes:
[0292] The first execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
[0293] Furthermore, the first execution information includes a dynamic library; the first execution module includes:
[0294] The second execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0295] Furthermore, the first execution information includes a script program; and the first execution module includes:
[0296] The third execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0297] Furthermore, it also includes:
[0298] a third acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0299] The first storage module is configured to store the update data.
[0300] The execution device proposed in this embodiment and Figure 6 The execution methods in the embodiment shown and the related embodiments correspond to each other. For details, please refer to the above Figure 6 The description of the execution methods in the illustrated embodiment and related embodiments will not be repeated here.
[0301] Fig. 9 FIG. 2 shows a structural block diagram of an execution device according to another embodiment of the present disclosure, which can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Fig. 9As shown, the execution device includes:
[0302] The matching module 901 is configured to match the currently traversed computing unit with the preset mapping information when traversing and executing the machine learning model; wherein the preset mapping information includes a mapping relationship between the preset computing unit in the machine learning model and the first execution information;
[0303] A fourth acquisition module 902 is configured to acquire, after the matching succeeds, first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information;
[0304] The third execution module 903 is configured to execute the computing unit currently being traversed according to the first execution information.
[0305] In this embodiment, the machine learning model can be encapsulated into an application so that the machine learning model can be deployed on the client by installing the application. The machine learning model may include multiple computing units and connection relationships between the multiple computing units; each computing unit can complete a computing task. The computing task of the computing unit can be implemented by a computer program code, which is specifically related to the type of machine learning model. For example, a neuron in a neural network model can be a computing unit. The connection relationship between multiple computing units may include, but is not limited to, a sequential execution relationship and / or a parallel execution relationship.
[0306] When the application is installed on the client, the computing units in the machine learning model are also deployed on the client according to the installation environment at that time (such as CPU environment, cache size, etc.). When the application is opened and run on the client, the input data is input into the machine learning model, and the computing units in the machine learning model are traversed and executed to obtain the output results.
[0307] The application is executed on the CPU of the client device, so the execution environment of the computing unit in the machine learning model is the CPU environment when the application is installed. If the machine learning model needs to be updated, such as the computing unit needs to be modified or a new computing unit needs to be added, the application can be reinstalled on the client device so that the updated machine learning model can be deployed on the client device, so that the modified or newly added computing unit can be executed in the current CPU environment of the client device. However, this method requires the issuance of a new version of the application. If there are many clients using the application, the issuance cost is high.
[0308] In this embodiment, when the machine learning model is updated, in order not to issue a new version of the application, preset mapping information is first established according to the updated data of the machine learning model, and the preset mapping information includes the mapping relationship between the newly added computing unit or the modified computing unit and the first execution information. The first execution information may include but is not limited to the execution logic and operation parameters of the computing unit; the execution logic may be a section of program code for implementing the computing task corresponding to the computing unit, and the operation parameters may include but are not limited to the execution environment information of the execution logic (such as cache size, etc.), the input of the computing unit (such as from which computing unit the input is obtained), the output of the computing unit (such as to which unit the execution result of the computing unit is outputted, etc.), etc.
[0309] After the preset mapping information is established, the preset mapping information can be written into the machine learning model, or the preset mapping information can be saved as a configuration file separately, and then the updated data such as the machine learning model, the preset mapping information and the first execution information are uploaded to the server. The server can notify the client that the machine learning model has updated data and send the updated data to the client, or the client can periodically query the server and obtain the updated data from the server. It should be noted that if the preset mapping information is saved as a configuration file separately, the entire machine learning model can be sent to the client, but the preset mapping information and the first execution information can be sent to the client.
[0310] After the client receives the updated data of the machine learning model, the updated data can be stored in a local storage device. When the application corresponding to the machine learning model is opened on the client and the machine learning model is traversed and executed by the application, for each currently traversed computing unit, it can be checked whether the preset mapping information records the updated information of the computing unit, that is, the currently traversed computing unit is matched with the content in the preset mapping information. If there is a matching content in the preset mapping information, it can be considered that the execution information of the computing unit has been updated. Therefore, the first execution information having a mapping relationship with the computing unit can be determined based on the mapping relationship in the preset mapping information, and then the first execution information can be obtained from the corresponding storage location, and the currently traversed computing unit is executed according to the first execution information.
[0311] For example, the first execution information may include the updated program code and operating parameters of the computing task corresponding to the computing unit, and the program code may be configured through the operating parameters, and loaded and executed to implement the computing task of the computing unit. After the currently traversed computing unit is executed, the next computing unit may be executed. Of course, it is understandable that multiple computing units in the machine learning model may also be in a parallel execution relationship. While the currently traversed computing unit is being executed, other computing units may also be traversed and executed in the same way.
[0312] It should be noted that when the machine learning model is updated to add a new computing unit, the updated machine learning model, the preset mapping information and the first execution information need to be uploaded to the server and downloaded locally by the client. Because the calculation timing of the newly added computing unit in the machine learning model (for example, which computing units the newly added computing unit is connected to, and which computing units are executed after, etc.) is written in the machine learning model, it is necessary to dynamically deploy the entire updated machine learning model to the client locally, and when the client traverses and executes the machine learning model, it also traverses and executes the updated machine learning model.
[0313] During the execution of the machine learning model, the disclosed embodiment determines the category of the currently executed target computing unit, and when the target computing unit is of a preset category, obtains the execution logic of the target computing unit from a preset storage location, and loads the execution logic to the GPU for execution. In this way, when the execution logic of the target execution unit changes, the changed execution logic can be deployed to the preset storage location, and the machine learning model takes out the updated execution logic from the preset storage location during execution and loads it to the GPU for execution, which enables the machine learning model to be updated without the need to issue a new application version, thereby greatly reducing costs.
[0314] In an optional implementation of this embodiment, Fig.10 As shown, the device further includes:
[0315] A fifth acquisition module 1001 is configured to acquire second execution information of the computing unit currently being traversed from the machine learning model after the matching fails;
[0316] The fourth execution module 1002 is configured to execute the computing unit currently being traversed according to the second execution information.
[0317] In this optional implementation, for the computing units in the machine learning model that have not been updated, the second execution information can be obtained from the machine learning model. The second execution information is the original execution information of the computing unit in the machine model, which is configured according to the installation environment at that time when the application is installed. Therefore, the second execution information can be directly executed on the CPU of the client device.
[0318] In an optional implementation of this embodiment, Fig.11 As shown, the fourth acquisition module 902 includes:
[0319] A first determining submodule 1101 is configured to determine a method for obtaining the first execution information according to the preset mapping information; wherein the method for obtaining includes an identifier and / or a storage location of the first execution information;
[0320] The second acquisition submodule 1102 is configured to acquire the first execution information from a local storage device according to the identifier and / or storage location of the first execution information.
[0321] In this optional implementation, the preset mapping information may include a mapping relationship between a newly added or updated preset computing unit and the first execution information. The mapping relationship may specifically be a mapping relationship between an identifier of the preset computing unit and an identifier and / or a relative storage position of the first execution information. Therefore, after the identifier and / or relative storage of the first execution information is determined according to the mapping relationship, the first execution information can be found from the client's storage device and the first execution information can be obtained from the storage device. It should be noted that the relative storage position of the first execution information may be the position of the first execution information in the current update data. After receiving the update data of the machine learning model from the server, the client may store the update data on the local storage device and record the starting position of the update data on the local storage device. When obtaining the first execution information, the actual storage address of the first execution information on the client's local storage device may be determined by the starting position and the relative position in the preset mapping information, and then the first execution information may be obtained from the actual storage address.
[0322] In an optional implementation of this embodiment, the first execution information includes a shader program and operating parameters of the shader program; the third execution module 903 includes:
[0323] The fourth execution submodule is configured to configure the shader program using the operating parameters, and load and execute the shader program on the GPU.
[0324] In this optional implementation, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can be implemented using a shader program. Since the shader program runs on the GPU and can be dynamically configured and loaded, after using the shader program to implement the newly added or modified computing unit in the machine learning model, the shader program can be directly loaded onto the GPU for execution after being configured with running parameters, without having to reinstall the installation program encapsulating the machine learning model in the CPU environment of the client device. Since the program executed on the CPU needs to be automatically configured according to the CPU environment during the installation process (for example, configuring cache information, etc.) before it can be executed, and the shader program can be dynamically configured and loaded for execution on the GPU, the dynamic expansion and modification of the computing units in the machine learning model can be achieved by executing the shader program on the GPU.
[0325] In an optional implementation of this embodiment, the first execution information includes a dynamic library; the third execution module 903 includes:
[0326] The fifth execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0327] In this optional implementation, if the CPU environment of the client device supports a just-in-time compilation environment such as a JIT environment, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented in the form of a dynamic library. In this way, the newly added or modified computing unit can be implemented as a dynamic library, and when the machine learning model is loaded and executed on the CPU, the computing task of the computing unit is implemented by dynamically loading the dynamic library.
[0328] In an optional implementation of this embodiment, the first execution information includes a script program; the third execution module 903 includes:
[0329] The sixth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0330] In this optional implementation, the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented by using a script. By executing a virtual machine on the CPU, and when executing the computing unit on the machine learning model, the corresponding script is loaded into the virtual machine for execution to complete the computing task of the computing unit.
[0331] In an optional implementation of this embodiment, Fig.12 As shown, the device further includes:
[0332] The sixth acquisition module 1201 is configured to acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information;
[0333] The second storage module 1202 is configured to store the update data.
[0334] In this optional implementation, after the client installs the application program encapsulating the machine learning model, if the machine learning model is updated, the client can obtain the updated data of the machine learning model from the server and store it locally on the client. The updated data includes preset mapping information and first execution information. The preset mapping information includes the mapping relationship between the newly added or modified preset computing unit in the machine learning model and the first execution information preset for the computing unit. The first execution information may include but is not limited to the execution logic and operating parameters of the preset computing unit. After the client stores the updated data in the local storage device, the dynamic deployment of the updated machine learning model is completed. When executing the machine learning model, the preset computing unit can be executed according to the preset mapping information and the first execution information, while other computing units can still be executed based on the execution logic of the machine learning model.
[0335] Fig.13 FIG. 1 shows a structural block diagram of an updating device according to an embodiment of the present disclosure. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Fig.13 As shown, the updating device comprises:
[0336] A seventh acquisition module 1301 is configured to acquire update data of the machine learning model; wherein the update data includes first execution information corresponding to at least one dynamic computing unit in the machine learning model;
[0337] A first deployment module 1302 is configured to redeploy the machine learning model according to the updated data;
[0338] The fifth execution module 1303 is configured to traverse and execute the machine learning model in response to an execution request for the machine learning model, and when the computing unit currently being traversed is the dynamic computing unit, obtain the first execution information corresponding to the dynamic computing unit, and execute the computing unit currently being traversed according to the first execution information.
[0339] Furthermore, it also includes:
[0340] The sixth execution module is configured to execute the second execution information corresponding to the computing unit currently traversed when the computing unit currently traversed is a non-dynamic execution unit; wherein the second execution information is located in the machine learning model.
[0341] Furthermore, the first execution information includes a shader program and operating parameters of the shader program; and the fifth execution module includes:
[0342] The seventh execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
[0343] Furthermore, the first execution information includes a dynamic library; and the fifth execution module includes:
[0344] The eighth execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0345] Furthermore, the first execution information includes a script program; and the fifth execution module includes:
[0346] The ninth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0347] The execution device proposed in this embodiment and Figure 7 The updating methods in the embodiment shown and the related embodiments correspond to each other. For details, please refer to the above Figure 7 The description of the updating method in the illustrated embodiment and related embodiments will not be repeated here.
[0348] Fig.14 FIG. 1 shows a structural block diagram of an updating device according to an embodiment of the present disclosure. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Fig.14 As shown, the updating device comprises:
[0349] An eighth acquisition module 1401 is configured to acquire update data of the machine learning model; wherein the update data includes preset mapping information and first execution information; the preset mapping information includes a mapping relationship between the first execution information and a preset computing unit in the machine learning model;
[0350] A second deployment module 1402 is configured to redeploy the machine learning model according to the updated data;
[0351] The seventh execution module 1403 is configured to traverse and execute the machine learning model in response to an execution request for the machine learning model, and when the computing unit currently traversed matches the preset computing unit in the preset mapping information, execute the computing unit currently traversed according to the first execution information.
[0352] In this embodiment, the machine learning model can be encapsulated into an application so that the machine learning model can be deployed on the client by installing the application. The machine learning model may include multiple computing units and connection relationships between the multiple computing units; each computing unit can complete a computing task. The computing task of the computing unit can be implemented by a computer program code, which is specifically related to the type of machine learning model. For example, a neuron in a neural network model can be a computing unit. The connection relationship between multiple computing units may include, but is not limited to, a sequential execution relationship and / or a parallel execution relationship.
[0353] When the application is installed on the client, the computing units in the machine learning model are also deployed on the client according to the installation environment at that time (such as CPU environment, cache size, etc.). When the application is opened and run on the client, the input data is input into the machine learning model, and the computing units in the machine learning model are traversed and executed to obtain the output results.
[0354] The application is executed on the CPU of the client device, so the execution environment of the computing unit in the machine learning model is the CPU environment when the application is installed. If the machine learning model needs to be updated, such as the computing unit needs to be modified or a new computing unit needs to be added, the application can be reinstalled on the client device so that the updated machine learning model can be deployed on the client device, so that the modified or newly added computing unit can be executed in the current CPU environment of the client device. However, this method requires the issuance of a new version of the application. If there are many clients using the application, the issuance cost is high.
[0355] In this embodiment, when the machine learning model is updated, in order not to issue a new version of the application, preset mapping information is first established according to the updated data of the machine learning model, and the preset mapping information includes the mapping relationship between the newly added computing unit or the modified computing unit and the first execution information. The first execution information may include but is not limited to the execution logic and operation parameters of the computing unit; the execution logic may be a section of program code for implementing the computing task corresponding to the computing unit, and the operation parameters may include but are not limited to the execution environment information of the execution logic (such as cache size, etc.), the input of the computing unit (such as from which computing unit the input is obtained), the output of the computing unit (such as to which unit the execution result of the computing unit is outputted, etc.), etc.
[0356] After the preset mapping information is established, the preset mapping information can be written into the machine learning model, or the preset mapping information can be saved as a configuration file separately, and then the updated data such as the machine learning model, the preset mapping information and the first execution information are uploaded to the server. The server can notify the client that the machine learning model has updated data and send the updated data to the client, or the client can periodically query the server and obtain the updated data from the server. It should be noted that if the preset mapping information is saved as a configuration file separately, the entire machine learning model can be sent to the client, but the preset mapping information and the first execution information can be sent to the client.
[0357] The client can obtain the updated data of the machine learning model from the server and store it locally on the client. The updated data includes preset mapping information and first execution information. The preset mapping information includes the mapping relationship between the newly added or modified preset computing unit in the machine learning model and the first execution information preset for the computing unit. The first execution information may include but is not limited to the execution logic and operating parameters of the preset computing unit. After the client stores the updated data in the local storage device, the dynamic deployment of the updated machine learning model is completed. When executing the machine learning model, the preset computing unit can be executed according to the preset mapping information and the first execution information, while other computing units can still be executed based on the execution logic of the machine learning model.
[0358] The user can open the application corresponding to the machine learning model on the client so that when the application traverses and executes the machine learning model, it can check whether the update information of each computing unit currently traversed is recorded in the preset mapping information, that is, match the computing unit currently traversed with the content in the preset mapping information. If there is matching content in the preset mapping information, it can be considered that the execution information of the computing unit has been updated. Therefore, the first execution information that has a mapping relationship with the computing unit can be determined according to the mapping relationship in the preset mapping information, and then the first execution information can be obtained from the corresponding storage location, and the computing unit currently traversed is executed according to the first execution information.
[0359] For example, the first execution information may include the updated program code and operating parameters of the computing task corresponding to the computing unit, and the program code may be configured through the operating parameters, and loaded and executed to implement the computing task of the computing unit. After the currently traversed computing unit is executed, the next computing unit may be executed. Of course, it is understandable that multiple computing units in the machine learning model may also be in a parallel execution relationship. While the currently traversed computing unit is being executed, other computing units may also be traversed and executed in the same way.
[0360] It should be noted that when the machine learning model is updated to add a new computing unit, the updated machine learning model, the preset mapping information and the first execution information need to be uploaded to the server and downloaded locally by the client. Because the calculation timing of the newly added computing unit in the machine learning model (for example, which computing units the newly added computing unit is connected to, and which computing units are executed after, etc.) is written in the machine learning model, it is necessary to dynamically deploy the entire updated machine learning model to the client locally, and when the client traverses and executes the machine learning model, it also traverses and executes the updated machine learning model.
[0361] During the execution of the machine learning model, the disclosed embodiment determines the category of the currently executed target computing unit, and when the target computing unit is of a preset category, obtains the execution logic of the target computing unit from a preset storage location, and loads the execution logic to the GPU for execution. In this way, when the execution logic of the target execution unit changes, the changed execution logic can be deployed to the preset storage location, and the machine learning model takes out the updated execution logic from the preset storage location during execution and loads it to the GPU for execution, which enables the machine learning model to be updated without the need to issue a new application version, thereby greatly reducing costs.
[0362] In an optional implementation of this embodiment, the device further includes:
[0363] The eighth execution module is configured to execute the second execution information corresponding to the computing unit currently traversed when the computing unit currently traversed does not match the preset computing unit in the preset mapping information; wherein the second execution information is located in the machine learning model.
[0364] In this optional implementation, the preset mapping information stores a mapping relationship between a newly added or modified computing unit and the corresponding first execution information. If it is an unmodified computing unit in the original framework of the machine learning model, the corresponding information does not exist in the preset mapping information. Therefore, for a computing unit that has not been updated in the machine learning model, the second execution information can be obtained from the machine learning model. The second execution information is the original execution information of the computing unit in the machine model, which is configured according to the installation environment at the time when the application is installed. Therefore, the second execution information can be directly executed on the CPU of the client device.
[0365] In an optional implementation of this embodiment, the first execution information includes a shader program and operating parameters of the shader program; the seventh execution module 1403 includes:
[0366] The tenth execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
[0367] In this optional implementation, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can be implemented using a shader program. Since the shader program runs on the GPU and can be dynamically configured and loaded, after using the shader program to implement the newly added or modified computing unit in the machine learning model, the shader program can be directly loaded onto the GPU for execution after being configured with running parameters, without having to reinstall the installation program encapsulating the machine learning model in the CPU environment of the client device. Since the program executed on the CPU needs to be automatically configured according to the CPU environment during the installation process (for example, configuring cache information, etc.) before it can be executed, and the shader program can be dynamically configured and loaded for execution on the GPU, the dynamic expansion and modification of the computing units in the machine learning model can be achieved by executing the shader program on the GPU.
[0368] In an optional implementation of this embodiment, the first execution information includes a dynamic library; the seventh execution module 1403 includes:
[0369] The eleventh execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
[0370] In this optional implementation, if the CPU environment of the client device supports a just-in-time compilation environment such as a JIT environment, the execution logic in the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented in the form of a dynamic library. In this way, the newly added or modified computing unit can be implemented as a dynamic library, and when the machine learning model is loaded and executed on the CPU, the computing task of the computing unit is implemented by dynamically loading the dynamic library.
[0371] In an optional implementation of this embodiment, the first execution information includes a script program; the seventh execution module 1403 includes:
[0372] The twelfth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
[0373] In this optional implementation, the first execution information of the newly added or modified computing unit in the machine learning model can also be implemented by using a script. By executing a virtual machine on the CPU, and when executing the computing unit on the machine learning model, the corresponding script is loaded into the virtual machine for execution to complete the computing task of the computing unit.
[0374] Fig.15 It is a structural diagram of an electronic device suitable for implementing the execution method or update method according to an embodiment of the present disclosure.
[0375] like Fig.15 As shown, the electronic device 1500 includes a central processing unit (CPU) 1501, which can perform various processes in the embodiments of the above method of the present disclosure according to the program stored in the read-only memory (ROM) 1502 or the program loaded from the storage part 1508 to the random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the electronic device 1500 are also stored. The CPU 1501, the ROM 1502, and the RAM 1503 are connected to each other through a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.
[0376] The following components are connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1510 as needed, so that a computer program read therefrom is installed into the storage section 1508 as needed.
[0377] In particular, according to an embodiment of the present disclosure, the method in the above-mentioned embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes a program code for executing the method in the embodiment of the present disclosure. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1509, and / or installed from the removable medium 1511.
[0378] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0379] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.
[0380] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.
[0381] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.
Claims
1. An execution method, characterized in that: include: In the process of traversing and executing the machine learning model, when the computing unit currently traversed is a dynamic computing unit, determining a preset update position corresponding to the dynamic computing unit; The preset update location is a local storage location of the first execution information; Acquire first execution information of the dynamic computing unit from the preset update position; the first execution information includes execution logic and operation parameters of the computing unit; the execution logic is a section of program code for implementing the computing task corresponding to the dynamic computing unit, and the operation parameters include execution environment information of the execution logic, input of the dynamic computing unit, and output of the dynamic computing unit; The computing unit currently being traversed is executed according to the first execution information.
2. The method according to claim 1, characterized in that: Also includes: When the currently traversed computing unit is a non-dynamic computing unit, obtaining second execution information of the currently traversed computing unit from the machine learning model; The computing unit currently being traversed is executed according to the second execution information.
3. The method according to any one of claims 1 to 2, characterized in that: Determining a preset update position corresponding to the dynamic calculation unit includes: Matching the dynamic computing unit with preset mapping information; the preset mapping information includes a mapping relationship between a newly added computing unit or a modified computing unit and the first execution information and a storage location of the first execution information; The preset update position corresponding to the dynamic calculation unit is obtained according to the matching result.
4. The method according to any one of claims 1 to 2, characterized in that: The first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes: The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
5. The method according to any one of claims 1-2, characterized in that: The first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes: The dynamic library is loaded and executed in the real-time editing environment of the CPU.
6. The method according to any one of claims 1-2, characterized in that: The first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes: The script program is loaded and executed in the virtual machine environment of the CPU.
7. The method according to claim 3, characterized in that Also includes: Acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information; The update data is stored.
8. An execution method, characterized in that: include: When traversing and executing the machine learning model, the currently traversed computing unit is matched with the preset mapping information; wherein the preset mapping information includes a mapping relationship between the preset computing unit in the machine learning model and the first execution information; the first execution information includes the execution logic and operation parameters of the computing unit; the execution logic is a section of program code for implementing the computing task corresponding to the dynamic computing unit, and the operation parameters include the execution environment information of the execution logic, the input of the dynamic computing unit, and the output of the dynamic computing unit; After the match is successful, obtaining first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information; The computing unit currently being traversed is executed according to the first execution information.
9. The method according to claim 8, characterized in that Also includes: After the matching fails, obtaining second execution information of the computing unit currently being traversed from the machine learning model; The computing unit currently being traversed is executed according to the second execution information.
10. The method according to any one of claims 8 to 9, characterized in that: Acquiring first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information includes: Determining a method for acquiring the first execution information according to the preset mapping information; wherein the acquisition method includes an identifier and / or a storage location of the first execution information; The first execution information is obtained from a local storage device according to the identifier and / or storage location of the first execution information.
11. The method according to any one of claims 8 to 9, characterized in that: The first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes: The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
12. The method according to any one of claims 8 to 9, characterized in that: The first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes: The dynamic library is loaded and executed in the real-time editing environment of the CPU.
13. The method according to any one of claims 8 to 9, characterized in that: The first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes: The script program is loaded and executed in the virtual machine environment of the CPU.
14. The method according to any one of claims 8 to 9, characterized in that: Also includes: Acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information; The update data is stored.
15. An updating method, characterized in that: include: Obtaining update data of the machine learning model; wherein the update data includes first execution information corresponding to at least one dynamic computing unit in the machine learning model; the first execution information includes execution logic and operating parameters of the computing unit; the execution logic is a section of program code for implementing a computing task corresponding to the dynamic computing unit, and the operating parameters include execution environment information of the execution logic, input of the dynamic computing unit, and output of the dynamic computing unit; redeploying the machine learning model according to the updated data; In response to an execution request for the machine learning model, the machine learning model is traversed and executed, and when the computing unit currently being traversed is the dynamic computing unit, the first execution information corresponding to the dynamic computing unit is obtained, and the computing unit currently being traversed is executed according to the first execution information.
16. The method according to claim 15, characterized in that Also includes: When the computing unit currently being traversed is a non-dynamic execution unit, execute the second execution information corresponding to the computing unit currently being traversed; wherein the second execution information is located in the machine learning model.
17. The method according to any one of claims 15-16, characterized in that: The first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes: The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
18. The method according to any one of claims 15-16, characterized in that: The first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes: The dynamic library is loaded and executed in the real-time editing environment of the CPU.
19. The method according to any one of claims 15-16, characterized in that: The first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes: The script program is loaded and executed in the virtual machine environment of the CPU.
20. An updating method, characterized in that: include: Obtaining update data of the machine learning model; wherein the update data includes preset mapping information and first execution information; the preset mapping information includes a mapping relationship between the first execution information and a preset computing unit in the machine learning model; the first execution information includes an execution logic and an operating parameter of the computing unit; the execution logic is a section of program code for implementing a computing task corresponding to a dynamic computing unit, and the operating parameter includes execution environment information of the execution logic, an input of the dynamic computing unit, and an output of the dynamic computing unit; redeploying the machine learning model according to the updated data; In response to an execution request for the machine learning model, the machine learning model is traversed and executed, and when the computing unit currently traversed matches the preset computing unit in the preset mapping information, the computing unit currently traversed is executed according to the first execution information.
21. The method according to claim 20, characterized in that Also includes: When the computing unit currently being traversed does not match the preset computing unit in the preset mapping information, execute the second execution information corresponding to the computing unit currently traversed; wherein the second execution information is located in the machine learning model.
22. The method according to any one of claims 20-21, characterized in that: The first execution information includes a shader program and operating parameters of the shader program; executing the currently traversed computing unit according to the first execution information includes: The shader program is configured using the operating parameters, and the shader program is loaded and executed on the GPU.
23. The method according to any one of claims 20-21, characterized in that: The first execution information includes a dynamic library; executing the currently traversed computing unit according to the first execution information includes: The dynamic library is loaded and executed in the real-time editing environment of the CPU.
24. The method according to any one of claims 20-21, characterized in that: The first execution information includes a script program; executing the currently traversed computing unit according to the first execution information includes: The script program is loaded and executed in the virtual machine environment of the CPU.
25. An execution device, characterized in that: include: A first determination module is configured to determine a preset update position corresponding to a dynamic computing unit when the computing unit currently being traversed is a dynamic computing unit during the process of traversing and executing the machine learning model; The preset update location is a local storage location of the first execution information; a first acquisition module configured to acquire first execution information of the dynamic computing unit from the preset update position; the first execution information includes execution logic and operation parameters of the computing unit; the execution logic is a section of program code for implementing the computing task corresponding to the dynamic computing unit, and the operation parameters include execution environment information of the execution logic, input of the dynamic computing unit, and output of the dynamic computing unit; The first execution module is configured to execute the computing unit currently being traversed according to the first execution information.
26. The device according to claim 25, characterized in that Also includes: A second acquisition module is configured to acquire second execution information of the currently traversed computing unit from the machine learning model when the currently traversed computing unit is a non-dynamic computing unit; The second execution module is configured to execute the computing unit currently being traversed according to the second execution information.
27. The device according to any one of claims 25-26, characterized in that The first determining module includes: a first matching submodule configured to match the dynamic computing unit with preset mapping information; the preset mapping information includes a mapping relationship between a newly added computing unit or a modified computing unit and the first execution information and a storage location of the first execution information; The first acquisition submodule is configured to acquire the preset update position corresponding to the dynamic calculation unit according to the matching result.
28. The device according to any one of claims 25-26, characterized in that The first execution information includes a shader program and operating parameters of the shader program; The first execution module includes: The first execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
29. The device according to any one of claims 25-26, characterized in that The first execution information includes a dynamic library; the first execution module includes: The second execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
30. The device according to any one of claims 25-26, characterized in that The first execution information includes a script program; the first execution module includes: The third execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
31. The device according to claim 27, characterized in that Also includes: a third acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information; The first storage module is configured to store the update data.
32. An execution device, characterized in that: include: A matching module is configured to match the currently traversed computing unit with preset mapping information when traversing and executing the machine learning model; wherein the preset mapping information includes a mapping relationship between a preset computing unit in the machine learning model and first execution information; the first execution information includes an execution logic and operating parameters of the computing unit; the execution logic is a section of program code for implementing a computing task corresponding to a dynamic computing unit, and the operating parameters include execution environment information of the execution logic, input of the dynamic computing unit, and output of the dynamic computing unit; A fourth acquisition module is configured to acquire, after the matching succeeds, first execution information having a mapping relationship with the currently traversed computing unit according to the preset mapping information; The third execution module is configured to execute the computing unit currently being traversed according to the first execution information.
33. The device according to claim 32, characterized in that Also includes: a fifth acquisition module, configured to acquire, after a matching failure, second execution information of the computing unit currently being traversed from the machine learning model; The fourth execution module is configured to execute the computing unit currently being traversed according to the second execution information.
34. The device according to any one of claims 32-33, characterized in that The fourth acquisition module includes: A first determination submodule is configured to determine a method for obtaining the first execution information according to the preset mapping information; wherein the method for obtaining includes an identifier and / or a storage location of the first execution information; The second acquisition submodule is configured to acquire the first execution information from a local storage device according to the identifier and / or storage location of the first execution information.
35. The device according to any one of claims 32-33, characterized in that The first execution information includes a shader program and operating parameters of the shader program; The third execution module includes: The fourth execution submodule is configured to configure the shader program using the operating parameters, and load and execute the shader program on the GPU.
36. The device according to any one of claims 32-33, characterized in that The first execution information includes a dynamic library; the third execution module includes: The fifth execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
37. The device according to any one of claims 32-33, characterized in that The first execution information includes a script program; the third execution module includes: The sixth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
38. The device according to any one of claims 32-33, characterized in that Also includes: a sixth acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes the preset mapping information and the first execution information; The second storage module is configured to store the update data.
39. An updating device, characterized in that: include: a seventh acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes first execution information corresponding to at least one dynamic computing unit in the machine learning model; the first execution information includes execution logic and operation parameters of the computing unit; the execution logic is a section of program code for implementing a computing task corresponding to the dynamic computing unit, and the operation parameters include execution environment information of the execution logic, input of the dynamic computing unit, and output of the dynamic computing unit; A first deployment module, configured to redeploy the machine learning model according to the updated data; The fifth execution module is configured to traverse and execute the machine learning model in response to an execution request for the machine learning model, and when the computing unit currently being traversed is the dynamic computing unit, obtain the first execution information corresponding to the dynamic computing unit, and execute the computing unit currently being traversed according to the first execution information.
40. The device according to claim 39, characterized in that Also includes: The sixth execution module is configured to execute the second execution information corresponding to the computing unit currently traversed when the computing unit currently traversed is a non-dynamic execution unit; wherein the second execution information is located in the machine learning model.
41. The device according to any one of claims 39-40, characterized in that The first execution information includes a shader program and operating parameters of the shader program; The fifth execution module includes: The seventh execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
42. The device according to any one of claims 39-40, characterized in that The first execution information includes a dynamic library; the fifth execution module includes: The eighth execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
43. The device according to any one of claims 39-40, characterized in that The first execution information includes a script program; The fifth execution module includes: The ninth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
44. An updating device, characterized in that: include: an eighth acquisition module, configured to acquire update data of the machine learning model; wherein the update data includes preset mapping information and first execution information; the preset mapping information includes a mapping relationship between the first execution information and a preset computing unit in the machine learning model; the first execution information includes an execution logic and an operation parameter of the computing unit; the execution logic is a section of program code for implementing a computing task corresponding to a dynamic computing unit, and the operation parameter includes execution environment information of the execution logic, an input of the dynamic computing unit, and an output of the dynamic computing unit; a second deployment module, configured to redeploy the machine learning model according to the updated data; The seventh execution module is configured to traverse and execute the machine learning model in response to an execution request for the machine learning model, and when the currently traversed computing unit matches the preset computing unit in the preset mapping information, execute the currently traversed computing unit according to the first execution information.
45. The device according to claim 44, characterized in that Also includes: The eighth execution module is configured to execute the second execution information corresponding to the computing unit currently traversed when the computing unit currently traversed does not match the preset computing unit in the preset mapping information; wherein the second execution information is located in the machine learning model.
46. The device according to any one of claims 44-45, characterized in that The first execution information includes a shader program and operating parameters of the shader program; The seventh execution module includes: The tenth execution submodule is configured to configure the shader program using the operation parameters, and load and execute the shader program on the GPU.
47. The device according to any one of claims 44-45, characterized in that The first execution information includes a dynamic library; the seventh execution module includes: The eleventh execution submodule is configured to load and execute the dynamic library in the real-time editing environment of the CPU.
48. The device according to any one of claims 44-45, characterized in that The first execution information includes a script program; the seventh execution module includes: The twelfth execution submodule is configured to load and execute the script program in the virtual machine environment of the CPU.
49. An electronic device, characterized in that: comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1 to 24.
50. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 24 is implemented.
