A heterogeneous cluster hybrid parallel reasoning scheduling method, device, equipment and medium

By determining the operator set and activation values ​​in a heterogeneous cluster, calculating the number of parallel data groups and communication time, and using a dynamic programming algorithm to generate the optimal pipeline parallel partitioning method, the communication bottleneck in high-throughput inference scenarios of complex models is solved, efficient hybrid parallel inference scheduling is achieved, and inference speed and throughput are improved.

CN117573370BActive Publication Date: 2026-11-24CHINA UNIV OF PETROLEUM (BEIJING)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311773715.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2026-11-24
Estimated Expiration
2043-12-21

AI Technical Summary

Technical Problem

Existing parallel inference strategies are not suitable for high-throughput inference scenarios with complex models, leading to communication bottlenecks and reduced computational efficiency, and failing to meet real-time decision-making requirements.

Method used

By determining the operator set and activation values ​​of the deep neural network model in the heterogeneous cluster, calculating the number of parallel data groups and communication time, using dynamic programming algorithm to generate the optimal pipeline parallel partitioning method, selecting the best equipment allocation result, and realizing hybrid parallel inference scheduling.

Benefits of technology

It improves the speed of hybrid parallel inference, solves the problem of high-throughput inference scenarios with complex models, and enhances the throughput and efficiency of inference tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117573370B_ABST
    Figure CN117573370B_ABST
Patent Text Reader

Abstract

This application discloses a heterogeneous cluster hybrid parallel inference scheduling method, apparatus, device, and medium, relating to the field of intelligent application deployment technology. The method includes: calculating activation values ​​and computation time; calculating the number of parallel data groups to determine the heterogeneous device allocation result; calculating communication time, generating a set of devices within a group, calculating a three-dimensional array of the set of devices within a group, and inputting the communication time, computation time, and three-dimensional array into the state transition equation to obtain the optimal pipeline parallel partitioning method; selecting the optimal heterogeneous device allocation result to determine the corresponding optimal number of parallel data groups; generating the optimal heterogeneous device scheduling method based on the optimal pipeline parallel partitioning method, the optimal heterogeneous device allocation result, and the optimal number of parallel data groups; and scheduling the heterogeneous cluster hybrid parallel inference of a deep neural network model according to the optimal heterogeneous device scheduling method. This solves the problem of not being able to apply to high-throughput inference scenarios for complex models, realizes heterogeneous cluster hybrid parallel inference scheduling, and improves the speed of hybrid parallel inference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent application deployment technology, and in particular to a heterogeneous cluster hybrid parallel inference scheduling method, apparatus, equipment and medium. Background Technology

[0002] Deep learning technology is now widely used. However, in high-throughput data applications, the amount of data generated far exceeds the amount consumed by a single inference by the model, such as in autonomous driving and multi-video stream processing. This necessitates fast model inference speed and the ability to make real-time decisions as much as possible. Various methods have been proposed to improve model inference speed, including model compression, adaptive inference, and neural architecture search. These methods reduce the number of computational operations required, but at the cost of accuracy. Multi-device parallel inference does not sacrifice model accuracy. The most efficient method is data-parallel inference, which replicates the entire model to every device. These devices can process multiple batches simultaneously, almost doubling the inference speed. However, the model size is limited by the memory of a single device. For large models that cannot be accommodated by the memory of a single device, pipelined parallelism is typically used for acceleration. Pipeline parallelism divides the input batches into multiple micro-batches and feeds them into the DNN (Deep Neural Networks) model in a pipelined manner. The DNN model is then load-balanced across multiple devices, divided into multiple stages. However, communication between devices in pipelined parallel methods can become a performance bottleneck, and an excessive number of pipeline stages can lead to decreased memory utilization and computational efficiency. Therefore, existing single parallel inference strategies are not suitable for high-throughput inference scenarios with complex models.

[0003] As can be seen from the above, how to solve the problem of high-throughput inference scenarios that cannot be applied to complex models, realize hybrid parallel inference scheduling of heterogeneous machine clusters, and improve the speed of hybrid parallel inference are problems to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for hybrid parallel inference scheduling of heterogeneous machine clusters, which can solve the problem of high-throughput inference scenarios that cannot be applied to complex models, realize hybrid parallel inference scheduling of heterogeneous machine clusters, and improve the speed of hybrid parallel inference. The specific solution is as follows:

[0005] In a first aspect, this application discloses a heterogeneous cluster hybrid parallel inference scheduling method, including:

[0006] Determine the set of operators for deep neural network models in heterogeneous devices for heterogeneous clusters, and calculate the activation values ​​and computation time of the set of operators.

[0007] Calculate the number of data parallel groups used to partition the heterogeneous devices, determine the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups, and obtain a set of heterogeneous device allocation results.

[0008] The communication time between the heterogeneous devices is calculated using the activation value. A set of devices within a group is generated based on the set of heterogeneous device allocation results. A three-dimensional array of the set of devices within a group is calculated. The communication time, the calculation time, and the three-dimensional array are input into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method.

[0009] The optimal heterogeneous device allocation result is selected from the heterogeneous device allocation results, and the optimal number of parallel data groups corresponding to the optimal heterogeneous device allocation result is determined. Based on the optimal pipeline parallel partitioning method, the optimal heterogeneous device allocation result and the optimal number of parallel data groups, the optimal heterogeneous device scheduling method is generated.

[0010] The deep neural network model is subjected to hybrid parallel inference scheduling of heterogeneous clusters according to the optimal device scheduling method.

[0011] Optionally, the calculation of the number of data parallel groups used to partition the heterogeneous devices, and the determination of the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups, include:

[0012] Calculate the number of data parallel groups used to divide the heterogeneous devices, and determine the distribution of heterogeneous devices after dividing the heterogeneous devices according to the number of data parallel groups;

[0013] Based on the distribution of the heterogeneous devices, corresponding allocation results for each heterogeneous device are generated.

[0014] Optionally, the calculation of the number of data parallel groups used to partition the heterogeneous devices, and the determination of the heterogeneous device distribution after partitioning the heterogeneous devices according to the number of data parallel groups; generating corresponding allocation results for each heterogeneous device based on the heterogeneous device distribution, including:

[0015] The number of parallel data groups used to divide the heterogeneous devices is calculated by enumeration.

[0016] The distribution of heterogeneous devices after dividing the heterogeneous devices according to the number of parallel data groups is determined by the second type of Stirling number.

[0017] The allocation results of each heterogeneous device are generated by enumeration based on the distribution of the heterogeneous devices.

[0018] Optionally, calculating the communication time between the heterogeneous devices using the activation value includes:

[0019] The activation value is calculated using a communication time calculation formula to obtain the communication time between the heterogeneous devices; the communication time calculation formula is:

[0020]

[0021] Where, p j b is the activation value; u,v The communication bandwidth for each pair of heterogeneous devices u, v.

[0022] Optionally, generating a set of devices within a group based on the heterogeneous device allocation result set includes:

[0023] Randomly select any one of the heterogeneous device allocation results from the set of heterogeneous device allocation results as the target heterogeneous device allocation result;

[0024] All subsets in the target heterogeneous device allocation result are combined to generate the group of devices.

[0025] Optionally, the step of selecting the best heterogeneous device allocation result from the allocation results of each heterogeneous device includes:

[0026] Calculate the inference time corresponding to each of the heterogeneous device allocation results, sort the inference times, and obtain the sorted inference times.

[0027] The inference time with the smallest value among the sorted inference times is taken as the minimum inference delay;

[0028] The optimal heterogeneous device allocation result corresponding to the minimum inference latency is selected from the allocation results of each heterogeneous device.

[0029] Optionally, the state transition equation of the dynamic programming algorithm is:

[0030]

[0031] Where f(i, s, u) is a three-dimensional array; T comp ({i→j}, u) represents the computation time; T comm (u, v, p) i ) represents the communication time between the heterogeneous devices; S represents the size of the set of devices within the group; s represents a subset of the set of devices within the group; j represents an operator in the operator set; D c The number of heterogeneous devices in the allocation results for each heterogeneous device; p i is the activation value; u and v are a pair of heterogeneous devices.

[0032] Secondly, this application discloses a heterogeneous cluster hybrid parallel inference scheduling device, comprising:

[0033] The statistics module is used to determine the set of operators for deep neural network models in heterogeneous devices of a heterogeneous cluster, and to count the activation values ​​and computation time of the set of operators.

[0034] The allocation result determination module is used to calculate the number of data parallel groups used to divide the heterogeneous devices, determine the allocation result of each heterogeneous device generated after dividing the heterogeneous devices according to the number of data parallel groups, so as to obtain a set of heterogeneous device allocation results.

[0035] The partitioning method determination module is used to calculate the communication time between the heterogeneous devices using the activation value, generate a set of devices within a group based on the heterogeneous device allocation result set, calculate a three-dimensional array of the set of devices within a group, and input the communication time, the calculation time, and the three-dimensional array into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method.

[0036] The scheduling method determination module is used to select the best heterogeneous device allocation result from the allocation results of each heterogeneous device, determine the optimal number of data parallel groups corresponding to the best heterogeneous device allocation result, and generate the best heterogeneous device scheduling method based on the optimal pipeline parallel partitioning method, the best heterogeneous device allocation result and the optimal number of data parallel groups.

[0037] The hybrid parallel inference scheduling module is used to perform hybrid parallel inference scheduling of the deep neural network model on heterogeneous clusters according to the optimal architecture scheduling method.

[0038] Thirdly, this application discloses an electronic device, including:

[0039] Memory, used to store computer programs;

[0040] A processor is used to execute the computer program to implement the aforementioned heterogeneous cluster hybrid parallel inference scheduling method.

[0041] Fourthly, this application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed heterogeneous cluster hybrid parallel inference scheduling method.

[0042] As can be seen, this application provides a heterogeneous cluster hybrid parallel inference scheduling method, including determining the operator set of deep neural network models in heterogeneous devices of a heterogeneous cluster, and calculating the activation values ​​and computation time of the operator set; calculating the number of data parallel groups used to partition the heterogeneous devices, determining the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups, so as to obtain a heterogeneous device allocation result set; calculating the communication time between the heterogeneous devices using the activation values, generating a set of devices within a group based on the heterogeneous device allocation result set, and calculating the communication time between the devices within the group. A three-dimensional array is used as input to the state transition equation of a dynamic programming algorithm to obtain an optimal pipeline parallel partitioning method. The optimal pipeline parallel partitioning method is then selected from the heterogeneous device allocation results, and the optimal number of parallel data groups corresponding to the optimal allocation result is determined. Based on the optimal pipeline parallel partitioning method, the optimal pipeline parallel partitioning result, and the optimal number of parallel data groups, an optimal pipeline parallel scheduling method is generated. Finally, the deep neural network model is subjected to hybrid parallel inference scheduling of heterogeneous clusters according to the optimal pipeline parallel scheduling method. This application groups heterogeneous devices and obtains a set of heterogeneous device allocation results based on the number of data parallel groups. It then generates a set of devices within each group based on this allocation result set, thereby obtaining an optimal pipeline parallel partitioning method. This leads to the generation of an optimal heterogeneous device scheduling method. A hybrid parallel inference scheduling approach, combining data parallelism between groups and optimal pipeline parallel partitioning within groups, is employed to improve the throughput of inference tasks. The optimal heterogeneous device scheduling method is used to perform hybrid parallel inference scheduling on deep neural network models across heterogeneous clusters, achieving hybrid parallel inference scheduling for heterogeneous clusters. This approach addresses the problem of not being suitable for high-throughput inference scenarios with complex models, thereby improving the speed of hybrid parallel inference. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0044] Figure 1 This is a flowchart of a heterogeneous cluster hybrid parallel inference scheduling method disclosed in this application;

[0045] Figure 2 This is a flowchart of another heterogeneous cluster hybrid parallel inference scheduling method disclosed in this application;

[0046] Figure 3This is a system operation example diagram of the hybrid parallel inference system disclosed in this application, which combines inter-group data parallel inference and intra-group pipelined parallel inference.

[0047] Figure 4 The diagram illustrates an example of optimizing the inference time of the model disclosed in this application, which is limited by the inference time of stage 2 in device group 1.

[0048] Figure 5 An example diagram of intra-group pipelined parallel inference on three heterogeneous devices for two batches of data (each batch being divided into four micro-batches) disclosed in this application;

[0049] Figure 6 This is an example diagram of intra-group pipelined parallel inference of two batches (each batch is split into 4 micro-batches) of data on 3 heterogeneous devices after adding inter-batch parallelism as disclosed in this application;

[0050] Figure 7 Example diagrams of five inference scenarios with progressively increasing heterogeneity of the eight NVIDIA GeForce RTX 3090 graphics cards disclosed in this application;

[0051] Figure 8 This is an example diagram illustrating the optimal hybrid parallel strategy obtained by the optimal joint scheduling algorithm for the large visual transformation model disclosed in this application in five heterogeneous scenarios.

[0052] Figure 9 This is a comparison of the number of inference batches per second between the visual transformation large model disclosed in this application and the pure pipelined parallel inference scheduling method.

[0053] Figure 10 This is an example diagram showing the optimal hybrid parallel strategy obtained by the optimal joint scheduling algorithm for the visual transformation giant model disclosed in this application in five heterogeneous scenarios;

[0054] Figure 11 This is an example of comparing the number of inference batches per second between the visual transformation giant model disclosed in this application and the pure pipelined parallel inference scheduling method;

[0055] Figure 12 This is a schematic diagram of the structure of a heterogeneous cluster hybrid parallel inference scheduling device disclosed in this application;

[0056] Figure 13 This application provides a structural diagram of an electronic device. Detailed Implementation

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] Deep learning technology is now widely used. However, in high-throughput data applications, the amount of data generated far exceeds the amount consumed by a single inference by the model, such as in autonomous driving and multi-video stream processing. This necessitates fast model inference speed and the ability to make real-time decisions as much as possible. Various methods have been proposed to improve model inference speed, including model compression, adaptive inference, and neural architecture search. These methods reduce the number of computational operations required, but at the cost of accuracy. Multi-device parallel inference does not sacrifice model accuracy. The most efficient method is data-parallel inference, which replicates the entire model to every device. These devices can process multiple batches simultaneously, almost doubling the inference speed. However, the model size is limited by the memory of a single device. For large models that cannot be accommodated by the memory of a single device, pipelined parallelism is typically used for acceleration. Pipeline parallelism divides the input batches into multiple micro-batches and pipes them into the DNN model. The DNN model is then load-balanced across multiple stages distributed across multiple devices. However, communication between devices in pipelined parallelism can become a performance bottleneck, and an excessive number of pipeline stages can lead to decreased memory utilization and computational efficiency. Therefore, existing single parallel inference strategies are unsuitable for high-throughput inference scenarios with complex models. As can be seen, addressing the inapplicability of such strategies to high-throughput inference scenarios with complex models, achieving hybrid parallel inference scheduling across heterogeneous clusters, and improving the speed of hybrid parallel inference are problems that need to be solved in this field.

[0059] See Figure 1 As shown in the figure, this invention discloses a heterogeneous cluster hybrid parallel inference scheduling method, which may specifically include:

[0060] Step S11: Determine the set of operators for the deep neural network model in the heterogeneous devices of the heterogeneous cluster, and count the activation value and computation time of the set of operators.

[0061] In this embodiment, the set of operators executed sequentially is statistically analyzed based on the DNN model structure. Statistics of each operator activation value p j And the memory usage m required to execute this operator. j Based on a given set of heterogeneous devices that can be used to deploy the model. Statistics for each device Memory capacity M v And the communication bandwidth b for each pair of devices u and v u,v .

[0062] Specifically, after obtaining the set L of operators, it is necessary to calculate the computation time of each operator on each type of device as input for the three-dimensional dynamic programming algorithm. To calculate the computation time of each operator, the device must first be running, and then the operator to be tested is run 1000 times to obtain the average computation time, which is the final computation time T of that operator on that device. comp (j, u), T comp (j, u) represents the computation time of operator j on device u.

[0063] Step S12: Calculate the number of data parallel groups used to divide the heterogeneous devices, determine the allocation results of each heterogeneous device generated after dividing the heterogeneous devices according to the number of data parallel groups, so as to obtain a set of heterogeneous device allocation results.

[0064] Step S13: Calculate the communication time between the heterogeneous devices using the activation value, generate a set of devices within the group based on the heterogeneous device allocation result set, calculate the three-dimensional array of the set of devices within the group, and input the communication time, the calculation time, and the three-dimensional array into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method.

[0065] In this embodiment, the activation value is calculated using a communication time calculation formula to obtain the communication time between the heterogeneous devices; the communication time calculation formula is:

[0066]

[0067] Where, p j b is the activation value; u,v The communication bandwidth for each pair of heterogeneous devices u, v.

[0068] Then, any heterogeneous device allocation result is randomly selected from the heterogeneous device allocation result set as the target heterogeneous device allocation result. All subsets in the target heterogeneous device allocation result are combined to generate the group-based device set. The three-dimensional array of the group-based device set is calculated. The communication time, the computation time, and the three-dimensional array are input into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method.

[0069] In this embodiment, the state transition equation of the dynamic programming algorithm is:

[0070]

[0071] Where f(i, s, u) is a three-dimensional array; T comp ({i→j}, u) represents the computation time; T comm (u, v, p) i ) represents the communication time between the heterogeneous devices; S represents the size of the set of devices within the group; s represents a subset of the set of devices within the group; j represents an operator in the operator set; D c The number of heterogeneous devices in the allocation results for each heterogeneous device; p i is the activation value; u and v are a pair of heterogeneous devices.

[0072] The specific process for generating the set of devices within a group is as follows: combine all subsets of the distribution of devices within the group into a single set of devices within the group. The size of this collection is set to This indicates that some devices within the group share the same device type. Furthermore, it's necessary to record the quantity of each device type within the group to calculate its prefix product set P. This facilitates the state transition when adding devices to a subset in the dynamic programming algorithm. The prefix product set P is obtained by multiplying the quantity of each device type in the group. Further, the three-dimensional array f(i, s, u) represents the set of devices within the group. Let be the shortest time required to process the first i operators on a subset s (1≤s≤S) of devices, and let u be the next heterogeneous device to be used. f(i, s, u) is the optimal solution to the subproblem of processing the first i operators on the subset s. That is, first allocate the result set from the heterogeneous devices. The allocation result of any heterogeneous device is randomly selected as the target heterogeneous device allocation result. Then, all subsets in the target heterogeneous device allocation result are combined to generate a set of devices within the group.

[0073] Furthermore, the computation of the new state f(j, s+P[u], v) requires the use of the optimal subproblem property, where the computation time of inference in this state is determined by the previous state f(i, s, u), or by the computation time T from the i-th operator to the j-th operator on the u-th heterogeneous device. comp ({l→j},u) determines, or is determined by the communication time T between the j-th operator and the u-th heterogeneous device and the next v-th heterogeneous device to be used. comm (u, v, p) j ) Decision. Initialize state. The shortest time taken for this group is the optimal solution. Since heterogeneous devices are all multi-core architectures, they can simultaneously process the computation of the current micro-batch and the communication of the previous micro-batch through multiple streams or execution queues. Therefore, the final execution time on the device is determined by the computation time T. comF({i→j}, u) and communication time T comm (u, v, p) j It is determined by the maximum value in ).

[0074] Step S14: Select the best heterogeneous device allocation result from the heterogeneous device allocation results, determine the optimal number of parallel data groups corresponding to the best heterogeneous device allocation result, and generate the best heterogeneous device scheduling method based on the optimal pipeline parallel partitioning method, the best heterogeneous device allocation result and the optimal number of parallel data groups.

[0075] Step S15: Perform heterogeneous cluster hybrid parallel inference scheduling on the deep neural network model according to the optimal device scheduling method.

[0076] In this embodiment, the set of operators for the deep neural network model in the heterogeneous devices of a heterogeneous cluster is determined, and the activation values ​​and computation times of the operator set are statistically analyzed. The number of data parallel groups used to partition the heterogeneous devices is calculated, and the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups are determined to obtain a set of heterogeneous device allocation results. The communication time between the heterogeneous devices is calculated using the activation values. Based on the set of heterogeneous device allocation results, a set of devices within a group is generated, and a three-dimensional array of the set of devices within a group is calculated. The communication time, the computation time, and the three-dimensional array are input into the state transition equation of a dynamic programming algorithm to obtain the optimal pipelined parallel partitioning method. The optimal heterogeneous device allocation result is selected from each of the heterogeneous device allocation results, and the optimal number of data parallel groups corresponding to the optimal heterogeneous device allocation result is determined. Based on the optimal pipelined parallel partitioning method, the optimal heterogeneous device allocation result, and the optimal number of data parallel groups, an optimal heterogeneous device scheduling method is generated. The deep neural network model is then subjected to hybrid parallel inference scheduling for the heterogeneous cluster according to the optimal heterogeneous device scheduling method. This application groups heterogeneous devices and obtains a set of heterogeneous device allocation results based on the number of data parallel groups. It then generates a set of devices within each group based on this allocation result set, thereby obtaining an optimal pipeline parallel partitioning method. This leads to the generation of an optimal heterogeneous device scheduling method. A hybrid parallel inference scheduling approach, combining data parallelism between groups and optimal pipeline parallel partitioning within groups, is employed to improve the throughput of inference tasks. The optimal heterogeneous device scheduling method is used to perform hybrid parallel inference scheduling on deep neural network models across heterogeneous clusters, achieving hybrid parallel inference scheduling for heterogeneous clusters. This approach addresses the problem of not being suitable for high-throughput inference scenarios with complex models, thereby improving the speed of hybrid parallel inference.

[0077] See Figure 2 As shown in the figure, this invention discloses a heterogeneous cluster hybrid parallel inference scheduling method, which may specifically include:

[0078] Step S21: Determine the set of operators for the deep neural network model in the heterogeneous devices of the heterogeneous cluster, and count the activation value and computation time of the set of operators.

[0079] Step S22: Calculate the number of data parallel groups used to divide the heterogeneous devices, determine the distribution of heterogeneous devices after dividing the heterogeneous devices according to the number of data parallel groups, and generate the corresponding allocation result of each heterogeneous device based on the distribution of heterogeneous devices.

[0080] In this embodiment, the number of data parallel groups used to partition the heterogeneous devices is calculated by enumeration; the distribution of heterogeneous devices after partitioning the heterogeneous devices according to the number of data parallel groups is determined by a second type of Stirling number; and the corresponding allocation results for each heterogeneous device are generated by enumeration based on the distribution of the heterogeneous devices. Specifically, the number of data parallel groups C (1≤C≤D) to be partitioned by the devices is determined by enumeration, and the number of heterogeneous devices in the device cluster D divided into C is further determined by a second type of Stirling number. Then, the specific allocation result set of all heterogeneous devices distributed into each group of C is found by enumeration once again.

[0081] Step S23: Calculate the communication time between the heterogeneous devices using the activation value, generate a set of devices within the group based on the heterogeneous device allocation result set, calculate the three-dimensional array of the set of devices within the group, and input the communication time, the calculation time, and the three-dimensional array into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method.

[0082] In this embodiment, after calculating the computation time of each operator and the communication time of its activation value, and given that the number of groups C, the distribution of device types within each group, and the number of heterogeneous devices D in each group are determined... o After (1≤c≤c), a three-dimensional array dynamic programming algorithm is needed to solve for the optimal model partitioning method and the corresponding execution order of the devices within the group. This algorithm records the subset of operators processed, the subset of devices used, and the state of the devices to be used in the next pipeline stage.

[0083] Step S24: Calculate the inference time corresponding to each of the heterogeneous device allocation results, sort the inference times to obtain sorted inference times, take the inference time with the smallest value among the sorted inference times as the minimum inference delay, and select the best heterogeneous device allocation result corresponding to the minimum inference delay from the heterogeneous device allocation results.

[0084] Step S25: Determine the optimal number of parallel data groups corresponding to the optimal configuration device allocation result, and generate the optimal configuration device scheduling method based on the optimal pipeline parallel partitioning method, the optimal configuration device allocation result, and the optimal number of parallel data groups.

[0085] Step S26: Perform heterogeneous cluster hybrid parallel inference scheduling on the deep neural network model according to the optimal device scheduling method.

[0086] An example of the system operation of this application, which combines inter-group data parallel reasoning and intra-group pipelined parallel reasoning, is shown below. Figure 3 As shown, Figure 3 This paper demonstrates an example of the joint scheduling system for data parallelism and pipeline parallelism of the present invention. The joint scheduling problem of the present invention can be defined as follows: Given a DNN model A collection of heterogeneous devices The goal is to minimize the inference latency of a batch by grouping the device cluster and using a hybrid parallel strategy of inter-group data parallel inference and intra-group pipelined parallel inference.

[0087] Figure 4 The diagram illustrates an example of optimizing inference time for stage 2 within device group 1, where improvements in model inference time are limited. Figure 4 This is a hybrid parallel scheduling instance with two data parallel groups, each containing three heterogeneous devices executing pipelined parallelism, and each group performing four micro-batches (a, b, c, d) for inference. It's clear that this isn't a hybrid parallel scheduling method with the lowest inference latency for heterogeneous devices. The overall inference latency can be optimized by reducing the number of operators in Stage 2 of Group 1. The optimal inference latency T for this scheduling system is... opt The calculation can be modeled as follows:

[0088]

[0089] st

[0090] 1≤D c ≤D-C+1;

[0091]

[0092] Among them, B micro This represents the number of micro-batches of data during parallel inference in the intra-group pipeline. t d This refers to the inference time of the d-th device under the optimal model partitioning method obtained through the above three-dimensional array dynamic programming.

[0093] Figure 5The diagram illustrates an example of intra-group pipelined parallel inference on three heterogeneous devices for two batches of data (each batch being split into four micro-batches). It demonstrates the intra-group pipelined parallelism of the present invention across input batches after joint scheduling that minimizes inference latency. To execute the task of the second micro-batch of the first input batch on device 3, from Figure 5 It can be seen that during parallel inference in the pipeline within the group, a large number of bubbles will appear between two input batches, which not only wastes computing resources but also increases the inference latency under high input throughput. Figure 6 By strategically utilizing the multi-threading mechanism of the CPU (Central Processing Unit) and the multi-streaming mechanism of the GPU (Graphics Processing Unit) to schedule various devices, different tasks can be executed in parallel, thus enabling the parallel execution of tasks. The task can be executed simultaneously. Tasks, etc., enable the elimination of execution bubbles between batches, achieving inter-batch parallelism and further reducing inference latency during hybrid parallel joint scheduling.

[0094] Figure 7 The demonstration showcased five heterogeneous scenario examples simulated on eight NVIDIA GeForce RTX 3090 graphics cards, with the heterogeneity increasing sequentially across the five simulated scenarios. Figure 8 and Figure 9 The results demonstrate the optimal hybrid parallel joint scheduling, optimal model partitioning, and highest inference throughput instance for inferring 840 batches of input data in 5 heterogeneous scenarios after dividing the ViT-Large (VisionTransformer-Large Model) into 96 operators. Figure 10 and Figure 11 This document showcases the optimal hybrid parallel joint scheduling results, optimal model partitioning results, and a record of the highest inference throughput after partitioning the ViT-Huge (VisionTransformer-huge model) into 128 operators and performing inference on 840 batches of input data across five heterogeneous scenarios.

[0095] 1. Using 100% GPU computing power and 4GB of video memory on 8 devices a, b, c, ..., h, and 100%...

[0096] In scenarios involving communication bandwidth:

[0097] (1) The four steps in the invention were executed on the ViT-Large model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of data parallel groups was found to be 4 groups, with two devices in each group. The first device in the group executed the first to 48th operators of the model, and the second device in the group executed the 49th to 96th operators of the model. The execution throughput on the hybrid parallel joint scheduling runtime system was 1.07 batches / second, while the execution throughput of the pure pipelined parallel inference method in the heterogeneous device scenario was only 0.63 batches / second.

[0098] (2) The four steps described in the invention were executed on the ViT-Huge model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of data parallel groups was found to be 2 groups. Group 1 has 4 devices (a, b, c, d), and Group 2 has 4 devices (e, f, g, h). Devices a and e execute the first 32 operators of the model simultaneously, devices b and f execute the 33rd to 65th operators simultaneously, devices c and g execute the 66th to 96th operators simultaneously, and devices d and h execute the 97th to 128th operators simultaneously. The execution throughput on the hybrid parallel joint scheduling runtime system is 0.38 batches / second, while the execution throughput of the pure pipelined parallel inference method in the heterogeneous device scenario is only 0.28 batches / second.

[0099] II. In scenarios where a, b, c, and d utilize 50% of the GPU computing power, 2GB of video memory, and 100% of the communication bandwidth, and e, f, g, and h utilize 100% of the GPU computing power, 4GB of video memory, and 100% of the communication bandwidth:

[0100] (1) The four steps described in the invention were executed on the ViT-Large model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of data parallel groups was found to be 4 groups. The first group consists of 5 devices: a, b, c, d, and h. Device a executes operators 1-15, device b executes operators 16-31, device c executes operators 32-47, device d executes operators 48-64, and device h executes operators 65-96. The second group is device e, which executes all operators in the model; the third group is device f, which executes all operators in the model; and the fourth group is device g, which executes all operators in the model. The execution throughput is 1.18 batches / second, while the pure pipelined parallel inference method in the heterogeneous device scenario is only 0.47 batches / second.

[0101] (2) The four steps described in the invention were executed on the ViT-Huge model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of parallel data groups was determined to be 4 groups. Group 1 consists of two devices, e and a. Device e executes operators 1-86, and device a executes operators 87-128. Group 2 consists of two devices, f and b. Device f executes operators 1-86, and device b executes operators 87-128. Group 3 consists of two devices, g and c. Device g executes operators 1-86, and device c executes operators 87-128. Group 4 consists of two devices, e and a. Device e executes operators 1-86, and device a executes operators 87-128. The execution throughput is 0.35 batches / second, while the throughput under pure pipelined parallel inference in a heterogeneous device scenario is only 0.21 batches / second.

[0102] III. In a scenario where devices a, b, and c use 25% of the GPU computing power, 2GB of video memory, and 25% of the communication bandwidth; devices d, e, and f use 50% of the GPU computing power, 4GB of video memory, and 50% of the communication bandwidth; and devices g and h use 100% of the GPU computing power, 8GB of video memory, and 100% of the communication bandwidth:

[0103] (1) The four steps described in the invention were executed on the ViT-Large model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of data parallel groups was found to be 4 groups. The first group consists of five devices: g, a, b, c, and h. Device g executes operators 1-35, device a executes operators 36-43, device b executes operators 44-52, device c executes operators 53-62, and device h executes operators 63-96. The second group is device d, which executes all operators in the model; the third group is device e, which executes all operators in the model; and the fourth group is device f, which executes all operators in the model. The execution throughput is 1.09 batches / second, while the pure pipelined parallel inference method in the heterogeneous device scenario is only 0.33 batches / second.

[0104] (2) The four steps described in the invention were executed on the ViT-Huge model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of parallel data groups was determined to be 3 groups. Group 1 consists of six devices: a, b, d, c, e, and f. Device a executes operators 1-14, device b executes operators 15-28, device d executes operators 29-57, device c executes operators 58-71, device e executes operators 72-99, and device f executes operators 100-128. Group 2 consists of device g, which executes all operators in the model. Group 3 consists of device h, which executes all operators in the model. The execution throughput is 1.09 batches / second, while the throughput under pure pipelined parallel inference in a heterogeneous device scenario is only 0.33 batches / second.

[0105] IV. In the scenario where devices a and b use 25% of the GPU computing power, 2GB of video memory, and 25% of the communication bandwidth; devices c and d use 50% of the GPU computing power, 4GB of video memory, and 50% of the communication bandwidth; devices e and f use 75% of the GPU computing power, 6GB of video memory, and 75% of the communication bandwidth; and devices g and h use 100% of the GPU computing power, 8GB of video memory, and 100% of the communication bandwidth:

[0106] (1) The four steps described in the invention were executed on the ViT-Large model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of data parallel groups was found to be 5 groups. The first group consists of five devices: g, h, a, and b. Device g executes operators 1-39, device h executes operators 40-78, device a executes operators 79-87, and device b executes operators 88-96. The second group consists of device c, which executes all operators in the model; the third group consists of device d, which executes all operators in the model; the fourth group consists of device e, which executes all operators in the model; and the fifth group consists of device f, which executes all operators in the model. The execution throughput is 1.35 batches / second, while the pure pipelined parallel inference method in a heterogeneous device scenario is only 0.39 batches / second.

[0107] (2) The four steps described in the invention were executed on the ViT-Huge model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of parallel data groups was determined to be 4 groups. Group 1 consists of five devices: c, h, d, a, and b. Device c executes operators 1-26, device h executes operators 27-78, device d executes operators 79-103, device a executes operators 104-115, and device b executes operators 116-128. Group 2 consists of device e, which executes all operators in the model; Group 3 consists of device f, which executes all operators in the model; and Group 4 consists of device g, which executes all operators in the model. The execution throughput is 0.44 batches / second, while the throughput under pure pipelined parallel inference in a heterogeneous device scenario is only 0.18 batches / second.

[0108] V. In the scenario where device a uses 10% GPU computing power, 1GB VRAM, and 25% communication bandwidth; device b uses 20% GPU computing power, 2GB VRAM, and 25% communication bandwidth; device c uses 25% GPU computing power, 3GB VRAM, and 50% communication bandwidth; device d uses 50% GPU computing power, 4GB VRAM, and 50% communication bandwidth; device e uses 60% GPU computing power, 5GB VRAM, and 75% communication bandwidth; device f uses 75% GPU computing power, 6GB VRAM, and 75% communication bandwidth; device g uses 90% GPU computing power, 7GB VRAM, and 100% communication bandwidth; and device h uses 100% GPU computing power, 8GB VRAM, and 100% communication bandwidth:

[0109] (1) The four steps described in the invention were executed on the ViT-Large model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of data parallel groups was found to be 5 groups. The first group consists of five devices: h, a, b, and g. Device h executes operators 1-43, device a executes operators 44-48, device b executes operators 49-58, and device g executes operators 59-96. The second group consists of device c, which executes all operators in the model; the third group consists of device d, which executes all operators in the model; the fourth group consists of device e, which executes all operators in the model; and the fifth group consists of device f, which executes all operators in the model. The execution throughput is 1.19 batches / second, while the pure pipelined parallel inference method in the heterogeneous device scenario is only 0.34 batches / second.

[0110] (2) The four steps described in the invention were executed on the ViT-Huge model. After enumerating the number of groups and using three-dimensional dynamic programming to find the optimal model partitioning algorithm, the optimal number of parallel data groups was determined to be 4 groups. Group 1 consists of five devices: h, a, c, d, and b. Device h executes operators 1-63, device a executes operators 64-69, device c executes operators 70-84, device d executes operators 85-115, and device b executes operators 116-128. Group 2 consists of device e, which executes all operators in the model. Group 3 consists of device f, which executes all operators in the model. Group 4 consists of device g, which executes all operators in the model. The execution throughput is 0.36 batches / second, while the throughput under pure pipelined parallel inference in a heterogeneous device scenario is only 0.15 batches / second.

[0111] In summary, this invention proposes a hybrid parallel joint scheduling inference method that combines inter-group data parallelism and intra-group pipeline parallelism. It iterates through the number of groups and, after determining the number of groups, uses a Stirling number of the second kind to determine the number of heterogeneous devices in each group, and then enumerates the allocation results for each type of heterogeneous device. For each heterogeneous device allocation result, a three-dimensional array dynamic programming algorithm is used to determine the optimal DNN model partitioning method and inference latency. By comparison, the optimal number of data parallel groups, device allocation method, and optimal model partitioning method with the minimum inference latency are found. This invention is applicable to high-throughput heterogeneous cluster inference scenarios.

[0112] In this embodiment, the set of operators for the deep neural network model in the heterogeneous devices of a heterogeneous cluster is determined, and the activation values ​​and computation times of the operator set are statistically analyzed. The number of data parallel groups used to partition the heterogeneous devices is calculated, and the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups are determined to obtain a set of heterogeneous device allocation results. The communication time between the heterogeneous devices is calculated using the activation values. Based on the set of heterogeneous device allocation results, a set of devices within a group is generated, and a three-dimensional array of the set of devices within a group is calculated. The communication time, the computation time, and the three-dimensional array are input into the state transition equation of a dynamic programming algorithm to obtain the optimal pipelined parallel partitioning method. The optimal heterogeneous device allocation result is selected from each of the heterogeneous device allocation results, and the optimal number of data parallel groups corresponding to the optimal heterogeneous device allocation result is determined. Based on the optimal pipelined parallel partitioning method, the optimal heterogeneous device allocation result, and the optimal number of data parallel groups, an optimal heterogeneous device scheduling method is generated. The deep neural network model is then subjected to hybrid parallel inference scheduling for the heterogeneous cluster according to the optimal heterogeneous device scheduling method. This application groups heterogeneous devices and obtains a set of heterogeneous device allocation results based on the number of data parallel groups. It then generates a set of devices within each group based on this allocation result set, thereby obtaining an optimal pipeline parallel partitioning method. This leads to the generation of an optimal heterogeneous device scheduling method. A hybrid parallel inference scheduling approach, combining data parallelism between groups and optimal pipeline parallel partitioning within groups, is employed to improve the throughput of inference tasks. The optimal heterogeneous device scheduling method is used to perform hybrid parallel inference scheduling on deep neural network models across heterogeneous clusters, achieving hybrid parallel inference scheduling for heterogeneous clusters. This approach addresses the problem of not being suitable for high-throughput inference scenarios with complex models, thereby improving the speed of hybrid parallel inference.

[0113] See Figure 12 As shown, this embodiment of the invention discloses a heterogeneous cluster hybrid parallel inference scheduling device, which may specifically include:

[0114] The statistics module 11 is used to determine the set of operators for the deep neural network model in the heterogeneous devices of the heterogeneous cluster, and to count the activation value and computation time of the set of operators.

[0115] The allocation result determination module 12 is used to calculate the number of data parallel groups used to divide the heterogeneous devices, determine the allocation result of each heterogeneous device generated after dividing the heterogeneous devices according to the number of data parallel groups, so as to obtain a set of heterogeneous device allocation results.

[0116] The partitioning method determination module 13 is used to calculate the communication time between the heterogeneous devices using the activation value, generate a set of devices within a group based on the heterogeneous device allocation result set, calculate a three-dimensional array of the set of devices within a group, and input the communication time, the calculation time, and the three-dimensional array into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method.

[0117] The scheduling method determination module 14 is used to filter out the best heterogeneous device allocation result from the allocation results of each heterogeneous device, determine the optimal number of parallel data groups corresponding to the best heterogeneous device allocation result, and generate the best heterogeneous device scheduling method based on the optimal pipeline parallel partitioning method, the best heterogeneous device allocation result and the optimal number of parallel data groups.

[0118] The hybrid parallel inference scheduling module 15 is used to perform hybrid parallel inference scheduling of the deep neural network model on heterogeneous clusters according to the optimal architecture scheduling method.

[0119] In this embodiment, the set of operators for the deep neural network model in the heterogeneous devices of a heterogeneous cluster is determined, and the activation values ​​and computation times of the operator set are statistically analyzed. The number of data parallel groups used to partition the heterogeneous devices is calculated, and the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups are determined to obtain a set of heterogeneous device allocation results. The communication time between the heterogeneous devices is calculated using the activation values. Based on the set of heterogeneous device allocation results, a set of devices within a group is generated, and a three-dimensional array of the set of devices within a group is calculated. The communication time, the computation time, and the three-dimensional array are input into the state transition equation of a dynamic programming algorithm to obtain the optimal pipelined parallel partitioning method. The optimal heterogeneous device allocation result is selected from each of the heterogeneous device allocation results, and the optimal number of data parallel groups corresponding to the optimal heterogeneous device allocation result is determined. Based on the optimal pipelined parallel partitioning method, the optimal heterogeneous device allocation result, and the optimal number of data parallel groups, an optimal heterogeneous device scheduling method is generated. The deep neural network model is then subjected to hybrid parallel inference scheduling for the heterogeneous cluster according to the optimal heterogeneous device scheduling method. This application groups heterogeneous devices and obtains a set of heterogeneous device allocation results based on the number of data parallel groups. It then generates a set of devices within each group based on this allocation result set, thereby obtaining an optimal pipeline parallel partitioning method. This leads to the generation of an optimal heterogeneous device scheduling method. A hybrid parallel inference scheduling approach, combining data parallelism between groups and optimal pipeline parallel partitioning within groups, is employed to improve the throughput of inference tasks. The optimal heterogeneous device scheduling method is used to perform hybrid parallel inference scheduling on deep neural network models across heterogeneous clusters, achieving hybrid parallel inference scheduling for heterogeneous clusters. This approach addresses the problem of not being suitable for high-throughput inference scenarios with complex models, thereby improving the speed of hybrid parallel inference.

[0120] In some specific embodiments, the allocation result determination module 12 may specifically include:

[0121] The partitioning module is used to calculate the number of data parallel groups used to partition the heterogeneous devices, and to determine the distribution of heterogeneous devices after partitioning the heterogeneous devices according to the number of data parallel groups.

[0122] The allocation result generation module is used to generate corresponding allocation results for each heterogeneous device based on the distribution of the heterogeneous devices.

[0123] In some specific embodiments, the allocation result determination module 12 may specifically include:

[0124] The group number calculation module is used to calculate the number of parallel data groups used to divide the heterogeneous devices by enumeration;

[0125] The distribution generation module is used to determine the heterogeneous device distribution generated after dividing the heterogeneous devices according to the number of data parallel groups by a second type of Stirling number;

[0126] The allocation result generation module is used to generate corresponding allocation results for each heterogeneous device by enumeration and based on the distribution of the heterogeneous devices.

[0127] In some specific embodiments, the partitioning method determining module 13 may specifically include:

[0128] The calculation module is used to calculate the activation value using a communication time calculation formula to obtain the communication time between the heterogeneous devices; the communication time calculation formula is:

[0129]

[0130] Where, p j b is the activation value; u,v The communication bandwidth for each pair of heterogeneous devices u, v.

[0131] In some specific embodiments, the partitioning method determining module 13 may specifically include:

[0132] The filtering module is used to randomly filter any heterogeneous device allocation result from the heterogeneous device allocation result set as the target heterogeneous device allocation result;

[0133] The combination module is used to combine all subsets in the target heterogeneous device allocation result to generate the set of devices within the group.

[0134] In some specific embodiments, the scheduling method determining module 14 may specifically include:

[0135] The sorting module is used to calculate the inference time corresponding to the allocation result of each heterogeneous device, sort the inference times, and obtain the sorted inference times.

[0136] The minimum inference latency determination module is used to determine the inference time with the smallest value among the sorted inference times as the minimum inference latency.

[0137] The optimal allocation result determination module is used to select the optimal heterogeneous device allocation result corresponding to the minimum inference delay from the allocation results of each heterogeneous device.

[0138] In some specific embodiments, the state transition equation of the dynamic programming algorithm is:

[0139]

[0140] Where f(i, s, u) is a three-dimensional array; T comp ({i→j}, u) represents the computation time; T comm (u, v, p) i ) represents the communication time between the heterogeneous devices; S represents the size of the set of devices within the group; s represents a subset of the set of devices within the group; j represents an operator in the operator set; D c The number of heterogeneous devices in the allocation results for each heterogeneous device; p i is the activation value; u and v are a pair of heterogeneous devices.

[0141] Figure 13 This is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the heterogeneous cluster hybrid parallel inference scheduling method executed by the electronic device disclosed in any of the foregoing embodiments.

[0142] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0143] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0144] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform operations and processing on the data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the heterogeneous cluster hybrid parallel inference scheduling method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the heterogeneous cluster hybrid parallel inference scheduling device from external devices, and may also include data collected by its own input / output interface 25.

[0145] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0146] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the steps of the heterogeneous cluster hybrid parallel inference scheduling method disclosed in any of the foregoing embodiments.

[0147] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0148] The above provides a detailed description of a heterogeneous cluster hybrid parallel inference scheduling method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A heterogeneous cluster hybrid parallel inference scheduling method, characterized in that, include: Determine the set of operators for deep neural network models in heterogeneous devices for heterogeneous clusters, and calculate the activation values ​​and computation time of the set of operators. Calculate the number of data parallel groups used to partition the heterogeneous devices, determine the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups, and obtain a set of heterogeneous device allocation results. The communication time between the heterogeneous devices is calculated using the activation value. A set of devices within a group is generated based on the set of heterogeneous device allocation results. A three-dimensional array of the set of devices within a group is calculated. The communication time, the calculation time, and the three-dimensional array are input into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method. The optimal heterogeneous device allocation result is selected from the heterogeneous device allocation results, and the optimal number of parallel data groups corresponding to the optimal heterogeneous device allocation result is determined. Based on the optimal pipeline parallel partitioning method, the optimal heterogeneous device allocation result and the optimal number of parallel data groups, the optimal heterogeneous device scheduling method is generated. The deep neural network model is subjected to hybrid parallel inference scheduling of heterogeneous clusters according to the optimal device scheduling method described above. Calculate the number of data parallel groups used to partition the heterogeneous devices, and determine the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups. This includes: calculating the number of data parallel groups used to partition the heterogeneous devices, and determining the distribution of heterogeneous devices after partitioning the heterogeneous devices according to the number of data parallel groups; and generating the corresponding allocation results of each heterogeneous device based on the distribution of heterogeneous devices. Calculate the number of data parallel groups used to partition the heterogeneous devices, and determine the distribution of heterogeneous devices after partitioning them according to the number of data parallel groups; generate the corresponding allocation results for each heterogeneous device based on the distribution of heterogeneous devices, including: calculating the number of data parallel groups used to partition the heterogeneous devices by enumeration; determining the distribution of heterogeneous devices after partitioning them according to the number of data parallel groups by Stirling number of the second kind; and generating the corresponding allocation results for each heterogeneous device by enumeration and based on the distribution of heterogeneous devices. The optimal heterogeneous device allocation result is selected from the heterogeneous device allocation results, including: calculating the inference time corresponding to each heterogeneous device allocation result, sorting the inference times to obtain the sorted inference times; taking the inference time with the smallest value among the sorted inference times as the minimum inference latency; and selecting the optimal heterogeneous device allocation result corresponding to the minimum inference latency from the heterogeneous device allocation results. The state transition equation for the dynamic programming algorithm is: ; in, It is a three-dimensional array; For calculating time; The communication time between the heterogeneous devices is denoted as S; the size of the set of devices within the group is denoted as s; and j is an operator in the set of operators. The number of heterogeneous devices in the allocation results for each heterogeneous device; is the activation value; u and v are a pair of heterogeneous devices.

2. The heterogeneous cluster hybrid parallel inference scheduling method according to claim 1, characterized in that, The step of calculating the communication time between the heterogeneous devices using the activation value includes: The activation value is calculated using a communication time calculation formula to obtain the communication time between the heterogeneous devices; the communication time calculation formula is: ; in, The activation value; The communication bandwidth for each pair of heterogeneous devices u, v.

3. The heterogeneous cluster hybrid parallel inference scheduling method according to claim 1, characterized in that, The process of generating a set of devices within a group based on the heterogeneous device allocation result set includes: Randomly select any one of the heterogeneous device allocation results from the set of heterogeneous device allocation results as the target heterogeneous device allocation result; All subsets in the target heterogeneous device allocation result are combined to generate the group of devices.

4. A heterogeneous cluster hybrid parallel inference scheduling device, characterized in that, include: The statistics module is used to determine the set of operators for deep neural network models in heterogeneous devices of a heterogeneous cluster, and to count the activation values ​​and computation time of the set of operators. The allocation result determination module is used to calculate the number of data parallel groups used to divide the heterogeneous devices, determine the allocation result of each heterogeneous device generated after dividing the heterogeneous devices according to the number of data parallel groups, so as to obtain a set of heterogeneous device allocation results. The partitioning method determination module is used to calculate the communication time between the heterogeneous devices using the activation value, generate a set of devices within a group based on the heterogeneous device allocation result set, calculate a three-dimensional array of the set of devices within a group, and input the communication time, the calculation time, and the three-dimensional array into the state transition equation of the dynamic programming algorithm to obtain the optimal pipeline parallel partitioning method. The scheduling method determination module is used to select the best heterogeneous device allocation result from the allocation results of each heterogeneous device, determine the optimal number of data parallel groups corresponding to the best heterogeneous device allocation result, and generate the best heterogeneous device scheduling method based on the optimal pipeline parallel partitioning method, the best heterogeneous device allocation result and the optimal number of data parallel groups. A hybrid parallel inference scheduling module is used to perform hybrid parallel inference scheduling of the deep neural network model on heterogeneous clusters according to the optimal architecture scheduling method. Calculate the number of data parallel groups used to partition the heterogeneous devices, and determine the allocation results of each heterogeneous device generated after partitioning the heterogeneous devices according to the number of data parallel groups. This includes: calculating the number of data parallel groups used to partition the heterogeneous devices, and determining the distribution of heterogeneous devices after partitioning the heterogeneous devices according to the number of data parallel groups; and generating the corresponding allocation results of each heterogeneous device based on the distribution of heterogeneous devices. Calculate the number of data parallel groups used to partition the heterogeneous devices, and determine the distribution of heterogeneous devices after partitioning them according to the number of data parallel groups; generate the corresponding allocation results for each heterogeneous device based on the distribution of heterogeneous devices, including: calculating the number of data parallel groups used to partition the heterogeneous devices by enumeration; determining the distribution of heterogeneous devices after partitioning them according to the number of data parallel groups by Stirling number of the second kind; and generating the corresponding allocation results for each heterogeneous device by enumeration and based on the distribution of heterogeneous devices. The optimal heterogeneous device allocation result is selected from the heterogeneous device allocation results, including: calculating the inference time corresponding to each heterogeneous device allocation result, sorting the inference times to obtain the sorted inference times; taking the inference time with the smallest value among the sorted inference times as the minimum inference latency; and selecting the optimal heterogeneous device allocation result corresponding to the minimum inference latency from the heterogeneous device allocation results. The state transition equation for the dynamic programming algorithm is: ; in, It is a three-dimensional array; For calculating time; The communication time between the heterogeneous devices is denoted as S; the size of the set of devices within the group is denoted as s; and j is an operator in the set of operators. The number of heterogeneous devices in the allocation results for each heterogeneous device; is the activation value; u and v are a pair of heterogeneous devices.

5. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the heterogeneous cluster hybrid parallel inference scheduling method as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the heterogeneous cluster hybrid parallel inference scheduling method as described in any one of claims 1 to 3.