A method and device for accelerating AI model deployment
Through the method of sharding and feature code storage in the P2P network, the problem of low efficiency of traditional AI model deployment is solved, and more efficient bandwidth utilization and transmission efficiency are achieved.
Patent Information
- Application Number
- CN202110132071.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-31
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-01-31
AI Technical Summary
Traditional AI model deployment methods are inefficient, especially because large AI models need to be deployed machine by machine, resulting in serious waste of network bandwidth, long transmission time, and low efficiency.
The P2P algorithm and Chord algorithm are used in the P2P network to fragment the data and store it on the Chord ring through signature codes, making full use of the bandwidth of multiple links to achieve distributed coordination and efficient transmission.
It improves the efficiency of AI model deployment, shortens transmission time, and improves bandwidth utilization and transmission efficiency.
Smart Images

Figure CN112799680B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of AI model deployment, and in particular to a method and device for accelerating AI model deployment. Background Art
[0002] Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. Artificial Intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems.
[0003] When deploying AI (Artificial Intelligence) models, the traditional method is generally to use scp (Secure Copy Protocol, a tool for remote file transfer under Linux system, used for data transmission between servers) or rsync (remote sync, a data mirror backup tool under Unix-like system) for batch deployment. The larger the AI model, the more it needs to be deployed on each machine, which means that each machine needs to transmit all the AI model data, and the data transmission needs to be carried out in sequence. For example, the time to transmit an AI model to a machine is T, and the time to transmit to n machines is n*T; this wastes the network bandwidth more seriously. At present, with the continuous development of AI models, the amount of AI model data is getting larger and larger, resulting in low deployment efficiency.
[0004] Therefore, there is a need for a better solution to solve the problems in the prior art. Summary of the invention
[0005] The present invention provides a method and device for accelerating AI model deployment, which can solve the technical problem of low efficiency in the prior art.
[0006] The technical solution of the present invention to solve the above technical problems is as follows:
[0007] An embodiment of the present invention proposes a method for accelerating AI model deployment, which is applied to a P2P network including multiple nodes. The method includes:
[0008] Set up a transmission tool based on the P2P algorithm on the machine to be deployed;
[0009] Add the machine as a new node to the P2P network;
[0010] Slice the data of the AI model to be deployed to divide the data into multiple data slices;
[0011] Perform distributed coordination based on the Chord algorithm to obtain each of the nodes and each of the data slices in the P2P;
[0012] Determine a feature code for each of the data slices, wherein different data slices correspond to different feature codes;
[0013] The feature code is stored on a Chord ring to complete the deployment of the AI model on the machine based on the transmission tool through the feature code on the Chord ring.
[0014] In a specific embodiment, adding the machine as a new node to the P2P network includes:
[0015] authenticating the machine;
[0016] If the authentication is successful, the authenticated machine will be added to the P2P network as a new node.
[0017] In a specific embodiment, it also includes:
[0018] If the authentication fails, a prompt message is generated based on the information of the machine that failed the authentication.
[0019] In a specific embodiment, the authentication is performed using one or more of the nodes in the P2P network.
[0020] In a specific embodiment, the size of the data slice is any value between 240KB and 280KB.
[0021] In a specific embodiment, the feature code is a hash code.
[0022] In a specific embodiment, the time required to complete the deployment of the AI model on the machine is determined based on the following formula:
[0023]
[0024] D p2p is the time to complete the deployment of the AI model on the machine based on the P2P algorithm;
[0025] F is the size of the data to be transferred; n is the number of copies to be transferred; u s is the upload rate of the node as a server; d min is the download rate of the node as a client; u i It is the P2P transmission rate.
[0026] The embodiment of the present invention further proposes a device for accelerating the deployment of an AI model, which is applied to a P2P network including multiple nodes. The device includes:
[0027] A setting module is used to set up a transmission tool based on a P2P algorithm on the machine to be deployed;
[0028] A joining module, used to join the machine as a new node into the P2P network;
[0029] A sharding module, used to shard the data of the AI model to be deployed, so as to divide the data into multiple data slices;
[0030] An acquisition module, configured to acquire each of the nodes and each of the data slices in the P2P through distributed coordination based on a Chord algorithm;
[0031] A determination module, configured to determine a feature code of each of the data slices, wherein different data slices correspond to different feature codes;
[0032] A deployment module is used to store the feature code on the Chord ring to complete the deployment of the AI model on the machine based on the transmission tool through the feature code on the Chord ring.
[0033] In a specific embodiment, the joining module includes:
[0034] An authentication module, used for authenticating the machine;
[0035] The processing module is used to add the authenticated machine into the P2P network as a new node when the authentication is passed.
[0036] In a specific embodiment, it also includes:
[0037] The prompt module is used to generate prompt information based on the information of the machine that failed to pass the authentication if the authentication fails.
[0038] The beneficial effects of the present invention are:
[0039] This solution, based on P2P network and transmission technology, fully utilizes the bandwidth of multiple links in the network connection. Compared with traditional methods, it has higher bandwidth utilization, higher transmission efficiency, and shorter transmission time, effectively improving the deployment efficiency of AI models. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flowchart of a method for accelerating AI model deployment provided by an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of the structure of a P2P network in a method for accelerating AI model deployment provided by an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of a Chord ring in a method for accelerating AI model deployment provided by an embodiment of the present invention;
[0043] Figure 4 A schematic diagram showing a time comparison between a method for accelerating AI model deployment provided by an embodiment of the present invention and deployment in an existing manner;
[0044] Figure 5 A schematic diagram of the structure of a device for accelerating AI model deployment provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0046] A method for accelerating AI model deployment provided by an embodiment of the present invention is applied to a P2P network including multiple nodes. The method includes the following steps:
[0047] Step 101: Setting a transmission tool based on a P2P algorithm on a machine to be deployed;
[0048] Specifically, the machine can be any machine that can deploy AI models, such as computers, tablets, smart phones, existing servers and other terminals with computing capabilities. First, a transmission tool for implementing the P2P (Peer to Peer, peer-to-peer network) algorithm is set on the machine.
[0049] The specific peer-to-peer network is a network structure idea. An essential difference between it and the client / server structure (that is, the structure adopted by WWW) that currently dominates the network is that there is no central node (or central server) in the entire network structure. In the P2P structure, each node (peer) generally has three functions: information consumer, information provider, and information communication. From the perspective of computing mode, P2P breaks the traditional Client / Server (C / S) model, and the status of each node in the network is equal. Each node acts as a server, providing services to other nodes, and also enjoys the services provided by other nodes.
[0050] As for the transmission tools based on P2P algorithm, they can be Xender, Infinit and so on.
[0051] Step 102: adding the machine as a new node to the P2P network;
[0052] Specifically, after executing 101, the machine is added to the P2P network as a new node, such as Figure 2 As shown, the structure of the P2P network consists of multiple nodes, each of which acts as both a client and a server.
[0053] Specifically, in order to ensure the security of transmission and control the authority, the step 102 of adding the machine as a new node to the P2P network includes: authenticating the machine; if the authentication is successful, the authenticated machine is added to the P2P network as a new node. In this way, only machines that have passed the authentication can join the P2P network. For example, the authenticated machine corresponds to Figure 2 Node 5 in the network is added as a new node to the P2P network to form a new P2P network.
[0054] Specifically, if the authentication fails, a prompt message is generated based on the information of the machine that failed the authentication. In this way, if the authentication fails, a prompt message can also be generated to prompt the user that the machine authentication fails, so that the user can handle it in time.
[0055] Specifically, the above authentication process is completed using one or more nodes in the P2P network. Specifically, for example, 1-3 nodes can be used as authentication centers, for example Figure 2 Taking an example for explanation, node 1 and node 2 can be selected to form an authentication center to authenticate the machine corresponding to node 5.
[0056] There are many specific authentication methods, such as permission authentication, time-based authentication, machine name-based authentication, etc.
[0057] Step 103: Slice the data of the AI model to be deployed to divide the data into multiple data slices;
[0058] Specifically, since the data of the AI model to be deployed is generally large, the data is segmented. The size of the specific data slice is any value between 240KB-280KB. More specifically, for example, the size of each data slice is 256KB or close to 256KB. In this way, when data is subsequently transmitted, the characteristics of the P2P network can be more fully utilized, and the bandwidth of multiple links in the P2P network connection can be fully utilized to speed up transmission, thereby ultimately improving the deployment efficiency of the AI model.
[0059] The specific sharding can be performed by the nodes in P2P.
[0060] Step 104: Perform distributed coordination based on the Chord algorithm to obtain each node and each data slice in the P2P network;
[0061] Specifically, through step 104, it can be determined that Figure 2 The nodes in the P2P network and the sliced data are shown in FIG. 1. Specifically, the information or data obtained by the Chord algorithm are stored in the Chord ring to facilitate subsequent search.
[0062] Step 105: Determine a feature code for each of the data slices, wherein different data slices correspond to different feature codes;
[0063] Specifically, the feature code in step 105 is used to uniquely mark the corresponding data piece. In a specific example, the feature code is a hash code.
[0064] Step 106: Store the feature code on the Chord ring to complete the deployment of the AI model on the machine based on the transmission tool through the feature code on the Chord ring.
[0065] Specifically, the feature code obtained in step 105 is stored in a Chord ring. The specific Chord ring is as follows: Figure 3 As shown, the corresponding node and the related data slice can be found based on the feature code on the Chord ring, so as to transmit them to the node corresponding to the machine to be deployed.
[0066] In a specific embodiment, using the solution of the present application, the time required to complete the deployment of the AI model on the machine is determined based on the following formula:
[0067]
[0068] D p2p is the time to complete the deployment of the AI model on the machine based on the P2P algorithm;
[0069] F is the size of the data to be transferred; n is the number of copies to be transferred; u s is the upload rate of the node as a server; d min is the download rate of the node as a client; u i It is the P2P transmission rate.
[0070] Correspondingly, if the traditional method is adopted, that is, using tools such as scp or rsync to deploy AI models, the calculation of the time required for the client to upload or download resources needs to be based on the following formula:
[0071]
[0072] In this formula, F is the size of the data to be transferred; n is the number of copies to be transferred; u s is the upload rate of the node as a server; d min is the download rate of the node as a client; D cs It is the time required for the client to upload or download.
[0073] Based on the comparison with the traditional method, the following results are obtained: Figure 4 The curve shown, where Figure 4 The smaller the Y-axis is, the better the effect is (indicating low transmission latency). P2P has significantly improved effects compared to ordinary transmission methods.
[0074] Example 2
[0075] To further illustrate the present solution, Embodiment 2 of the present invention further discloses a device for accelerating the deployment of an AI model, which is applied to a P2P network including multiple nodes. As shown in the figure, the device includes:
[0076] A setting module 201 is used to set a transmission tool based on a P2P algorithm on a machine to be deployed;
[0077] A joining module 202, used to join the machine as a new node into the P2P network;
[0078] A sharding module 203, used to shard the data of the AI model to be deployed, so as to divide the data into multiple data slices;
[0079] An acquisition module 204 is used for acquiring each node and each data slice in the P2P network through distributed coordination based on a Chord algorithm;
[0080] A determination module 205, configured to determine a feature code of each of the data slices, wherein different data slices correspond to different feature codes;
[0081] The deployment module 206 is used to store the feature code on the Chord ring to complete the deployment of the AI model on the machine based on the transmission tool through the feature code on the Chord ring.
[0082] In a specific embodiment, the adding module 202 includes:
[0083] An authentication module 2021, used to authenticate the machine;
[0084] The processing module 2022 is used to add the authenticated machine into the P2P network as a new node when the authentication is passed.
[0085] In a specific embodiment, it also includes:
[0086] The prompt module 2023 is used to generate prompt information based on the information of the machine that failed to pass the authentication if the authentication fails.
[0087] In a specific embodiment, the authentication is performed using one or more of the nodes in the P2P network.
[0088] In a specific embodiment, the size of the data slice is any value between 240KB and 280KB.
[0089] In a specific embodiment, the feature code is a hash code.
[0090] In a specific embodiment, the time required to complete the deployment of the AI model on the machine is determined based on the following formula:
[0091]
[0092] D p2p is the time to complete the deployment of the AI model on the machine based on the P2P algorithm;
[0093] F is the size of the data to be transferred; n is the number of copies to be transferred; u s is the upload rate of the node as a server; d min is the download rate of the node as a client; u i It is the P2P transmission rate.
[0094] The present invention relates to a method and device for accelerating the deployment of an AI model, which is applied to a P2P network including multiple nodes, and the method includes: setting a transmission tool based on a P2P algorithm on a machine to be deployed; adding the machine as a new node to the P2P network; slicing the data of the AI model to be deployed to divide the data into multiple data slices; obtaining each node and each data slice in the P2P through distributed coordination based on the Chord algorithm; determining a feature code for each data slice, wherein different data slices correspond to different feature codes; storing the feature code on a Chord ring to complete the deployment of the AI model on the machine based on the transmission tool through the feature code on the Chord ring. This solution, based on the P2P network and transmission technology, fully utilizes the bandwidth of multiple links in the network connection. Compared with the traditional method, it has higher bandwidth utilization, higher transmission efficiency, and shorter transmission time, which effectively improves the deployment efficiency of the AI model.
[0095] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for accelerating AI model deployment, characterized in that: Applied in a P2P network including multiple nodes, the method includes: Set up a transmission tool based on the P2P algorithm on the machine to be deployed; Add the machine as a new node to the P2P network; Slice the data of the AI model to be deployed to divide the data into multiple data slices; Perform distributed coordination based on the Chord algorithm to obtain each of the nodes and each of the data slices in the P2P; Determine a feature code for each of the data slices, wherein different data slices correspond to different feature codes; Storing the feature code on a Chord ring, so as to complete the deployment of the AI model on the machine based on the transmission tool through the feature code on the Chord ring; The adding the machine as a new node to the P2P network includes: authenticating the machine; If the authentication is successful, the authenticated machine will be added to the P2P network as a new node.
2. The method according to claim 1, characterized in that Also includes: If the authentication fails, a prompt message is generated based on the information of the machine that failed the authentication.
3. The method according to claim 1, characterized in that The authentication is performed using one or more of the nodes in the P2P network.
4. The method according to claim 1, characterized in that The size of the data slice is any value between 240KB and 280KB.
5. The method according to claim 1, characterized in that The feature code is a hash code.
6. The method according to claim 1, characterized in that The time required to complete the deployment of the AI model on the machine is determined based on the following formula: D p2p is the time to complete the deployment of the AI model on the machine based on the P2P algorithm; F is the size of the data to be transferred; n is the number of copies to be transferred; u s is the upload rate of the node as a server; d min is the download rate of the node as a client; u i It is the P2P transmission rate.
7. A device for accelerating AI model deployment, characterized in that: Applied in a P2P network including multiple nodes, the device includes: A setting module is used to set up a transmission tool based on a P2P algorithm on the machine to be deployed; A joining module, used to join the machine as a new node into the P2P network; A sharding module, used to shard the data of the AI model to be deployed, so as to divide the data into multiple data slices; An acquisition module, configured to acquire each of the nodes and each of the data slices in the P2P through distributed coordination based on a Chord algorithm; A determination module, configured to determine a feature code of each of the data slices, wherein different data slices correspond to different feature codes; A deployment module, used to store the feature code on a Chord ring, so as to complete the deployment of the AI model on the machine through the feature code on the Chord ring based on the transmission tool; The joining module comprises: An authentication module, used for authenticating the machine; The processing module is used to add the authenticated machine into the P2P network as a new node when the authentication is passed.
8. The device according to claim 7, characterized in that Also includes: The prompt module is used to generate prompt information based on the information of the machine that failed to pass the authentication if the authentication fails.
