Computing power scheduling method and related device
By selecting target computing cards that meet preset conditions in the video intelligent analysis platform to create tasks of the same type, the problem of insufficient resource utilization of computing cards in the existing technology is solved, and higher resource utilization and economy are achieved. benefit.
Patent Information
- Application Number
- CN202111144173.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-09-28
AI Technical Summary
The existing technology cannot fully utilize the remaining resources of the computing power card, resulting in insufficient economic benefits and resource conservation of video intelligent analysis platforms.
By obtaining the type and computing power card collection of the task to be created, the computing power card collection containing this type of task is selected, and the target computing card that meets the preset conditions, and create a task on this computing card to improve Resource utilization.
The memory utilization rate and CNN composition usage rate of computing power cards have been improved, the remaining resource utilization rate of the computing power card is improved, and additional memory consumption required for the first creation task is saved.
Smart Images

Figure CN114003370B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of AI computing power scheduling technology, and in particular to a computing power scheduling method and related devices. Background Art
[0002] In recent years, with the rapid development of machine learning and deep learning, more and more products have become more automated and intelligent by applying image analysis technology, such as face recognition, license plate recognition, etc. The growing number of user-side calls has caused many video intelligent analysis platforms to be overwhelmed, forcing many platform manufacturers to respond by improving the performance of hardware facilities or adding new hardware servers. However, this response method not only increases the cost of the platform, but also increases the workload of platform maintenance. Therefore, studying a method that can fully and flexibly schedule the computing power resources of the platform has high practicality in terms of economic benefits and resource conservation for video intelligent analysis platforms.
[0003] The current method is generally to balance the load, but this method cannot make full use of the remaining resources of the computing power card. Therefore, a new computing power scheduling method is urgently needed to solve the above problems. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a computing power scheduling method and related devices, which can improve the utilization rate of the remaining resources of the computing power card.
[0005] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide a computing power scheduling method, including: obtaining the type of task to be created, and a first computing power card subset in a computing power card set that includes tasks of the first type; wherein the task to be created is a task of the first type; in response to the first computing power card subset including a target computing power card that meets preset conditions, creating the task to be created on the target computing power card.
[0006] Among them, the step of obtaining a target computing power card that meets the preset conditions in response to the first computing power card subset includes: obtaining the single-channel resource consumption value of the task to be created and the remaining resource value of each computing power card in the first computing power card subset; selecting a first set of candidate computing power cards that meet the first preset conditions from the first computing power card subset according to the single-channel resource consumption value and the remaining resource value; and selecting a target computing power card that meets the second preset condition from the first set of candidate computing power cards.
[0007] Among them, the step of selecting a first candidate computing power card set that meets the first preset condition from the first computing power card subset according to the single-channel resource consumption value and the remaining resource value includes: in response to the first sub-computing power card set including computing power cards that only include the first type of tasks, obtaining a first difference between the remaining resource value and the single-channel resource consumption value of each computing power card in the first computing power card subset; wherein the first difference includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value that is not enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the single-type environment computing power consumption value, and the single-type environment computing power consumption value is the single-channel CNN computing power consumption value measured when the computing power card currently only enables the first type of tasks; selecting from the first computing power card subset the first candidate computing power card set whose first difference is greater than the preset condition; A first candidate computing power card set with a threshold is set; and / or, in response to the first sub-computing power card set including computing power cards including the first type of tasks and other types of tasks, a second difference between the remaining resource value and the single-channel resource consumption value of each computing power card in the first computing power card subset is obtained; wherein the second difference includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value that is not enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the multi-type environment computing power consumption value, wherein the multi-type environment computing power consumption value is the single-channel CNN computing power consumption value measured when the current computing power card currently enables multiple types of tasks, and the multi-type environment computing power consumption value is related to the single-type environment computing power consumption value; a first candidate computing power card set whose second difference is greater than the preset threshold is selected from the first computing power card subset.
[0008] The step of selecting a target computing power card that meets the second preset condition from the first set of candidate computing power cards includes: in response to the first sub-set of computing power cards including computing power cards that only include tasks of the first type, selecting the target computing power card with the smallest remaining resource value from the first set of candidate computing power cards; and / or, in response to the first sub-set of computing power cards including computing power cards that include tasks of the first type and tasks of other types, selecting the target computing power card with the largest number of tasks of the first type currently opened from the first set of candidate computing power cards.
[0009] Among them, the remaining resource value includes the remaining CNN computing power value; the step of obtaining the remaining resource value of each computing power card in the first computing power card subset includes: in response to the current computing power card only containing the first type of tasks, obtaining a third difference between one and the product of the single-type environment computing power consumption value of each task in the current computing power card and the number of tasks, and using the third difference as the remaining CNN computing power value of the current computing power card; and / or, in response to the current computing power card containing the first type of tasks and other types of tasks, obtaining a fourth difference between one and the sum of the multi-type environment computing power consumption values of each task in the current computing power card, and using the fourth difference as the remaining CNN computing power value of the current computing power card.
[0010] The method further includes: in response to the target computing power card not being determined from the first computing power card subset, obtaining a second computing power card subset that does not include the first type of tasks from the computing power card set.
[0011] Among them, after the step of obtaining a second computing power card subset that does not include the first type of task from the computing power card set, it includes: in response to the second computing power card subset including at least one idle computing power card, any of the idle computing power cards is selected as the target computing power card, and the step of creating the task to be created on the target computing power card is entered; wherein, the idle computing power card currently has no task opened.
[0012] Among them, after the step of obtaining a second computing power card subset that does not include the first type of task from the computing power card set, it also includes: in response to the second computing power card subset including at least one non-completely idle computing power card, obtaining the single-channel resource consumption value of the task to be created and the remaining resource value of each computing power card in the second computing power card subset; selecting a second candidate computing power card set that meets the third preset condition from the second computing power card subset according to the single-channel resource consumption value and the remaining resource value; selecting a target computing power card that meets the fourth preset condition from the second candidate computing power card set, and entering the step of creating the task to be created on the target computing power card.
[0013] Among them, the step of selecting a second candidate computing power card set that meets the third preset condition from the second computing power card subset according to the single-channel resource consumption value and the remaining resource value includes: obtaining the fifth difference between the remaining resource value and the single-channel resource consumption value of each computing power card in the second computing power card subset; selecting a second candidate computing power card set whose fifth difference is greater than a preset threshold from the second computing power card subset; wherein the fifth difference includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the computing power consumption value of multiple types of environments.
[0014] The step of selecting a target computing power card that meets the fourth preset condition from the second set of candidate computing power cards and entering the step of creating the task to be created on the target computing power card comprises: selecting a target computing power card with the largest remaining resource value from the second set of candidate computing power cards and entering the step of creating the task to be created on the target computing power card.
[0015] In order to solve the above technical problems, another technical solution adopted by the present application is: to provide a computing power scheduling device, including: an acquisition module, used to obtain the type of task to be created, and a first computing power card subset containing tasks of the first type in a computing power card set; wherein the type of task to be created is the first type; a processing module, used to create the task to be created on the target computing power card in response to the first computing power card subset including a target computing power card that meets preset conditions.
[0016] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, comprising a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the computing power scheduling method mentioned in any of the above embodiments.
[0017] In order to solve the above technical problems, another technical solution adopted in the present application is: providing a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to implement the computing power scheduling method mentioned in any of the above embodiments.
[0018] Different from the prior art, the beneficial effect of the present application is that the computing power scheduling method provided by the present application includes: obtaining the type of the task to be created and the first computing power card subset containing the first type of tasks in the computing power card set; wherein, the type of the task to be created is the first type, and when the first computing power card subset includes a target computing power card that meets the preset conditions, the task to be created is created on the target computing power card. Through this design method, tasks of the same type can be created on the same computing power card as much as possible, which not only improves the memory utilization rate and CNN computing power utilization rate of the computing power card, thereby improving the remaining resource utilization rate of the computing power card, but also saves the additional memory consumption required for the first task creation. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0020] Figure 1 This is a schematic diagram corresponding to the hardware solution used by a typical video analysis server;
[0021] Figure 2 It is a flowchart of an implementation method of the computing power scheduling method of the present application;
[0022] Figure 3 yes Figure 2 A schematic flow chart of an implementation method of step S2 in FIG.
[0023] Figure 4 yes Figure 3 A schematic flow chart of an implementation method of step S11;
[0024] Figure 5 yes Figure 3 A schematic flow chart of another implementation of step S11;
[0025] Figure 6 yes Figure 1 A schematic diagram of a flow chart of an implementation method after step S4;
[0026] Figure 7 yes Figure 6 A schematic flow chart of an implementation method of step S21 in FIG.
[0027] Figure 8 It is a structural schematic diagram of an implementation method of a computing power scheduling device of the present application;
[0028] Fig. 9 It is a schematic diagram of a framework of an implementation method of an electronic device of the present application;
[0029] Fig.10 It is a schematic diagram of a framework of an implementation scheme of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] The following is an introduction to the hardware solutions used by typical video analysis servers. Figure 1 , Figure 1 This is a schematic diagram corresponding to the hardware solution adopted by a typical video analysis server. Specifically, a typical intelligent analysis platform consists of a host and several computing power cards. The host receives the video code stream data corresponding to the video analysis task through the network, pre-processes the code stream data, and distributes it to the computing power card through the PCIE high-speed bus to complete the video analysis task. After the computing power card completes the analysis, it returns the result to the host through the PCIE high-speed bus, and the host finally processes the result. The video analysis processing capability of the intelligent analysis platform is determined by the processing performance of a single computing power card and the total number of computing power cards. In an intelligent analysis platform, all computing power cards generally use the same hardware solution, with the same computing power, memory resources, CPU resources, etc. A single computing power card can generally process multiple video analysis tasks at the same time, but the resources consumed are different depending on the type of video analysis task, and the maximum number of channels that a single computing power card can process will also vary depending on the task type.
[0032] The current computing power scheduling strategy is generally: take the maximum weighted value of remaining resources as the basic criterion, and select the server with the largest weighted value to execute the new task. This method has a certain load balancing effect, so that some servers will not be very busy while some servers are very idle. It only considers the resource consumption estimated by the algorithm and the remaining resources of the server. Its major premise is that for an algorithm task, the resources consumed are a certain value. This idea cannot maximize the utilization of computing power cards, and there is still room for improvement.
[0033] In addition, the estimated resource consumption of the actual algorithm is different in different operating environments. For example, if a single computing power card only runs the face algorithm, assuming that the memory and CPU performance are sufficient, only from the perspective of CNN computing power limitations, it can process a maximum of 8 channels; if a single computing power card only runs the perimeter, it can process a maximum of 16 channels; but if the two algorithm services are mixed, in theory it can support a combination mode of 7-channel face + 2-channel perimeter, but in reality it cannot achieve this combination, and often shows insufficient computing power. This is because the same type of intelligent analysis tasks are generally managed by a software handle, and the internal sub-algorithms and data flow relationships can be uniformly scheduled and managed, but there is more or less disordered resource preemption between the two different task type handles, resulting in the failure to achieve the computing power utilization of a single intelligent analysis task.
[0034] In addition, from the perspective of memory resources, for an intelligent algorithm business, the memory resource consumption is the largest when the first path is created, and the memory consumption will be much smaller when the second path is created. The reason is that the model file and other necessary public resources need to be loaded when the first path is created, while the second path and later can share these resources without repeated creation. Therefore, from the perspective of efficient use of memory resources, the same type of algorithm tasks should be concentrated together as much as possible.
[0035] The following is an introduction to the computing power scheduling method provided by this application.
[0036] See also Figure 2 , Figure 2 This is a flow chart of an implementation method of the computing power scheduling method of the present application. The computing power scheduling method includes:
[0037] S1: Obtain the type of the task to be created and a first subset of computing power cards in the computing power card set that includes tasks of the first type.
[0038] Specifically, the intelligent analysis server obtains a request to create a new video analysis task, the type of the task to be created is the first type T0, and obtains the first computing power card subset that has opened tasks of the first type T0 from the computing power card set. In this embodiment, the first type T0 does not specifically refer to a certain type of task, but only refers to the type of the task to be created for the convenience of expression. At the same time, the intelligent analysis server obtains the computing power card set in the intelligent analysis platform. In this embodiment, the computing power card set includes at least one computing power card.
[0039] S2: Determine whether the first computing power card subset includes a target computing power card that meets a preset condition.
[0040] Specifically, in this embodiment, please refer to Figure 3 , Figure 3 yes Figure 2 Schematic diagram of a flow chart of an implementation method of step S2 in FIG. Specifically, step S2 includes:
[0041] S10: Obtain the single-channel resource consumption value of the task to be created and obtain the remaining resource value of each computing power card in the first computing power card subset.
[0042] Specifically, the single-channel resource consumption value includes the single-channel memory consumption value (M, M'), the single-channel CNN computing power consumption value (N, N') and the single-channel CPU occupancy value (C). The remaining resource value includes the remaining memory value M free 、Remaining CNN computing power value N free And the remaining CPU value C free Specifically, in this embodiment, the single-channel resource consumption values of the current T0 type task are acquired based on the single-channel resource consumption values of each type of task that are pre-stated.
[0043] In this embodiment, statistics and records are made in advance for the single-channel computing power card resource consumption details of all types of intelligent analysis tasks supported by the intelligent analysis server. Please refer to Tables 1-3, Table 1 is the statistics of single-channel memory consumption values, Table 2 is the statistics of single-channel CNN computing power consumption values, and Table 3 is the statistics of single-channel CPU occupancy values. The resource consumption of each type of video analysis task is divided into: the statistical method of the first start, non-first start and single type environment, and mixed environment, see Tables 1 and 2 for details. It should be noted that the memory consumption values and computing power consumption values in Tables 1 and 2 are only examples. Any other resource type consumption statistical method that uses the above 4 situations for distinction can be applied to this application and is not limited here.
[0044] Table 1: Single-channel memory consumption statistics
[0045]
[0046] As shown in Table 1, the memory consumption value M for the first time refers to the additional memory consumption value required to open the first channel in the current computing power card; the memory consumption value M' for non-first time refers to the additional memory consumption value when a new channel with the same analysis task is opened when there is already a channel in the current computing power card that has opened the same analysis task. Of course, because the model file and other necessary public resources need to be loaded when creating for the first time, and the second and subsequent channels can share these resources without repeated creation, the memory consumption value for non-first time opening must be smaller than the memory consumption value for first time opening.
[0047] Table 2: Statistics of single-channel CNN computing power consumption
[0048]
[0049] As shown in Table 2, CNN refers to the convolutional neural network hardware computing power core; the computing power consumption value N of a single-type environment refers to the computing power consumption value of a single CNN of this type measured in an environment where all current computing power cards only open the same type of intelligent analysis task; the computing power consumption value N' of a multi-type environment refers to the fact that the utilization efficiency of CNN computing power will decrease when different types of intelligent analysis tasks are mixed in the computing power card. The computing power consumption value at this time will be larger than the computing power consumption value of a single-type environment. This value can be obtained by multiplying the computing power consumption of a single-type environment by an empirical coefficient greater than 1. For example, the empirical coefficient can be a value greater than 1 such as 1.1, which is not limited in this application. The computing power consumption value of a multi-type environment is an empirical value, which is used to estimate whether the remaining CNN computing power value of the current computing power card is sufficient to start a new task in a scenario where multiple types of tasks are mixed. In addition, in this embodiment, the value ranges of the above-mentioned single-type environment computing power consumption value N and the multi-type environment computing power consumption value N' are both 0 to 1, indicating a proportion.
[0050] Table 3 Single-channel CPU occupancy statistics
[0051] type Single CPU consumption value Type 1 <![CDATA[C1]]> Type 2 <![CDATA[C2]]> Type <![CDATA[C n ]]>
[0052] As shown in Table 3, the value range of the single-socket CPU occupancy value C is 0 to 1, indicating a percentage.
[0053] In this embodiment, each remaining resource value of the target computing power card is greater than the corresponding single-channel resource consumption value. In addition, in this embodiment, the remaining resource value also includes the remaining memory value M free 、Remaining CPU value C free , the remaining memory value M free and the remaining CPU value C free The remaining resource value can be obtained by using the query command provided by the operating system, and this application will not repeat it here. Specifically, in this embodiment, the remaining resource value includes the remaining CNN computing power value N free Please continue reading Figure 3 , Figure 3 The step of obtaining the remaining resource value of each computing power card in the first computing power card subset in step S10 includes: when the current computing power card only contains tasks of the first type T0, obtaining a single-type environment computing power consumption value N corresponding to each task in the current computing power card T The third difference between the product of the number of tasks n and the number of tasks n is used as the remaining CNN computing power value N of the current computing power card. free , specifically, the above formula is: N free =1-N T *n, where N T is the computing power consumption value of a single type of environment corresponding to the task type, and n is the number of tasks currently opened.
[0054] Specifically, in this embodiment, please continue to refer to Figure 3 The step of obtaining the remaining resource value of each computing power card in the first computing power card subset in step S10 also includes: when the current computing power card includes tasks of the first type T0 and other types of tasks, obtaining a multi-type environment computing power consumption value N' corresponding to each task in the current computing power card i The fourth difference between the sum of and is used as the remaining CNN computing power value Nfree of the current computing power card. Specifically, the above formula is: Among them, n is the number of currently opened tasks, N' i is the multi-type environment computing power consumption value of each currently opened task, and the subscript i is used to distinguish different types of tasks. Of course, in other embodiments, the CNN remaining computing power value N is determined according to whether it is a single-type environment or a multi-type environment. free The method may also adopt other similar derivative methods, which are not limited in this application.
[0055] In addition, in this embodiment, the single-type environment computing power consumption value is the single-channel CNN computing power consumption value measured when the current computing power card only opens the first type T0 task; the multi-type environment computing power consumption value is the single-channel CNN computing power consumption value measured when the current computing power card opens the first type T0 task and the remaining types of tasks. In addition, the multi-type environment computing power consumption value is related to the single-type environment computing power consumption value. The specific relationship has been introduced in detail above and will not be repeated here.
[0056] S11: selecting a first candidate computing power card set that meets a first preset condition from the first computing power card subset according to the single-channel resource consumption value and the remaining resource value.
[0057] Specifically, in this embodiment, when the first sub-computing power card set includes computing power cards that only include tasks of the first type, refer to Figure 4 , Figure 4 yes Figure 3 Schematic diagram of a flow chart of an implementation method of step S11 in FIG. Specifically, step S11 includes:
[0058] S110: Obtain a first difference between the remaining resource value and the single-path resource consumption value of each computing power card in the first computing power card subset.
[0059] Specifically, the first difference in the above step S111 includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value that is not enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the single-type environment computing power consumption value. In this embodiment, the single-type environment computing power consumption value is the single-channel CNN computing power consumption value measured when the computing power card currently only enables the first type of task.
[0060] S111: Select a first candidate computing power card set whose first difference is greater than a preset threshold from the first computing power card subset. Specifically, in this embodiment, the remaining memory value M of each of the above computing power cards is free The difference between the single-channel memory consumption value M' that is not enabled for the first time is M free -M', remaining CPU value C free The difference between the single-socket CPU usage value and the single-socket CPU usage value is C free -C, and the remaining CNN computing power value N free The difference between the computing power consumption value N of the single-type environment is N free -N. Specifically, in this embodiment, because the computing power card only includes the first type of tasks, they are all single-type environments, and the first type of tasks are not started for the first time, so the single-channel memory consumption value and the single-channel computing power consumption value of the task to be created that participate in the calculation use the non-first start memory consumption value M' and the single-type environment computing power consumption value N respectively. In this embodiment, the preset thresholds in the above step S111 may include a first threshold Δm, a second threshold Δc, and a third threshold Δn. Therefore, it is allowed to start the task to be created, that is, the first preset condition is: the difference M free -M' is greater than the first threshold Δm and the difference C free -C is greater than the threshold Δc, and the difference N free -N is greater than the third threshold Δn, that is:
[0061] M free -M'>Δm and C free -C>Δc and N free -N>Δn, wherein the first threshold Δm, the second threshold Δc, and the third threshold Δn are values close to 0 or smaller values, which are determined according to actual conditions and are not limited in this application.
[0062] Through this design, tasks of the same type are placed on the same computing power card as much as possible, which improves the memory utilization of the computing power card. In addition, new tasks are not created for the first time, which can save the additional memory consumption required for the first creation.
[0063] If there is no computing power card that only includes the first type of tasks in the first computing power card subset, when the first sub-computing power card set includes computing power cards that include the first type of tasks and other types of tasks, please refer to Figure 5 , Figure 5 yes Figure 3 Schematic diagram of another implementation of step S11 in FIG. Specifically, step S11 includes:
[0064] S120: Obtain a second difference between the remaining resource value and the single-path resource consumption value of each computing power card in the first computing power card subset.
[0065] Specifically, the second difference in the above step S121 includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value that is not enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the multi-type environment computing power consumption value. Specifically, in this embodiment, the multi-type environment computing power consumption value is the single-channel CNN computing power consumption value measured when the current computing power card currently enables multiple types of tasks, and the multi-type environment computing power consumption value is related to the single-type environment computing power consumption value.
[0066] Specifically, when it is found in step S110 that the first candidate computing power card that meets the first preset condition is not included in the first computing power card subset, that is, the target computing power card that meets the preset condition cannot be found in the first computing power card subset, when the first computing power card subset includes computing power cards that include tasks of the first type T0 and tasks of other types, the second difference between the remaining resource value and the single-channel resource consumption value of each computing power card in the first computing power card subset is obtained. In this embodiment, the other types refer to any type except the first type T0.
[0067] S121: Selecting a first candidate computing power card set whose second difference is greater than a preset threshold from the first computing power card subset.
[0068] Specifically, in this embodiment, the remaining memory value M of each computing power card is free The difference between the single-channel memory consumption value M' that is not enabled for the first time is M free -M', remaining CPU value C free The difference between the single-socket CPU usage value and the single-socket CPU usage value is C free -C, and the remaining CNN computing power value N free The difference between the multi-type environment computing power consumption value N' is N free -N'.
[0069] Specifically, in this embodiment, because the computing power card includes the first type of tasks and other types of tasks, they are all multi-type environments, and the first type of tasks are not started for the first time, so the single-channel memory consumption value and the single-channel computing power consumption value of the task to be created that participate in the calculation use the non-first-start memory consumption value M' and the multi-type environment computing power consumption value N'. In this embodiment, the preset thresholds in the above step S111 may include a fourth threshold Δm', a fifth threshold Δc', and a sixth threshold Δn'. Therefore, it is allowed to start the task to be created, that is, the first preset condition is: the difference M free -M' is greater than the fourth threshold Δm' and the difference C free -C is greater than the fifth threshold Δc', and the difference N free -N' is greater than the sixth threshold Δn', that is:
[0070] M free -M'>Δm' and C free -C>Δc' and N free -N'>Δr', wherein the fourth threshold Δm', the fifth threshold Δc', and the sixth threshold Δn' are values close to 0 or smaller, which are determined according to actual conditions and are not limited in the present application.
[0071] Through this design, tasks of the same type are placed on the same computing power card as much as possible, which improves the memory utilization of the computing power card. In addition, new tasks are not created for the first time, which can save the additional memory consumption required for the first creation.
[0072] S12: Selecting a target computing power card that meets a second preset condition from the first candidate computing power card set.
[0073] In one embodiment, when the first sub-computing power card set includes computing power cards that only include tasks of the first type, a target computing power card with the smallest remaining resource value is selected from the first candidate computing power card set. In addition, in this embodiment, the method for determining the smallest remaining resource value is to take the remaining CNN computing power value N free Of course, this application does not limit the method for determining the minimum remaining resource value.
[0074] In another embodiment, if there is no computing power card that only includes the first type of tasks in the first computing power card subset, when the first sub-computing power card set includes computing power cards that include the first type of tasks and other types of tasks, the target computing power card with the largest number of currently opened tasks of the first type is selected from the first candidate computing power card set. In addition, in this embodiment, if there are multiple target computing power cards that meet the preset conditions, a target computing power card that meets the largest number of currently opened tasks of the first type is randomly selected.
[0075] S3: If yes, create the task to be created on the target computing power card.
[0076] Specifically, if the first computing power card subset includes a target computing power card that meets the preset conditions, it means that the target computing power card that meets the preset conditions can be found in the first computing power card subset, and then the step of creating a task to be created on the target computing power card is entered.
[0077] Through this design, tasks of the same type can be created on the same computing power card as much as possible. Not only can the memory utilization and CNN computing power utilization of the computing power card be improved, thereby improving the utilization of the remaining resources of the computing power card, but also saving the additional memory consumption required for the first task creation, thereby improving the single-card resource utilization when mixed intelligent analysis tasks, and overall improving the intelligent analysis task acceptance capacity of the intelligent analysis platform.
[0078] S4: Otherwise, obtain a second computing power card subset that does not include the first type of tasks from the computing power card set.
[0079] Specifically, when the target computing power card is not determined from the first computing power card subset, it means that the target computing power card that meets the preset conditions cannot be found, and then a second computing power card subset that does not include the first type of tasks is obtained from the computing power card set.
[0080] In one embodiment, when the second computing power card subset includes at least one idle computing power card, after the above step S4, the following steps are included: selecting any idle computing power card as a target computing power card, and entering the step of creating the task to be created on the target computing power card.
[0081] In this embodiment, no task is started on the idle computing power card. Specifically, if the computing power card set contains at least one idle computing power card, it means that an idle computing power card can be found in the computing power card set, and any idle computing power card is used as the target computing power card, and the step of creating a task to be created on the target computing power card is entered. In this way, the remaining resource utilization of the computing power card can be fully exploited.
[0082] In another embodiment, when the second computing power card subset includes at least one non-completely idle computing power card, refer to Figure 6 , Figure 6 yes Figure 1 A schematic diagram of a flow chart of an implementation method after step S4 in the above embodiment. After the above step S4, it also includes:
[0083] S20: Obtain the single-channel resource consumption value of the task to be created and the remaining resource value of each computing power card in the second computing power card subset.
[0084] In this embodiment, the second computing power card subset includes at least one non-completely idle computing power card that does not include a task of the first type. Specifically, the second computing power card subset that currently opens other types of tasks is obtained from the computing power card set.
[0085] S21: selecting a second candidate computing power card set that meets a third preset condition from the second computing power card subset according to the single-channel resource consumption value and the remaining resource value.
[0086] Specifically, in this embodiment, please refer to Figure 7 , Figure 7 yes Figure 6 Schematic diagram of a flow chart of an implementation method of step S21 in FIG. Specifically, the above step S21 includes:
[0087] S210: Obtain a fifth difference between the remaining resource value and the single-path resource consumption value of each computing power card in the second computing power card subset.
[0088] Specifically, the fifth difference includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the computing power consumption value of multiple types of environments.
[0089] S211: Selecting a set of second candidate computing power cards whose fifth difference is greater than a preset threshold from the second computing power card subset.
[0090] Specifically, obtain the remaining memory value M of each non-completely idle computing power card in the second computing power card subset free The difference between the single-channel memory consumption value M when it is first enabled is M free -M, remaining CPU value C free The difference between the single-socket CPU usage value and the single-socket CPU usage value is C free -C, and the remaining CNN computing power value N free The difference between the multi-type environment computing power consumption value N' is N free -N'.
[0091] Specifically, in this embodiment, because after the first type of task is opened in the above-mentioned non-completely idle computing power card, it belongs to a multi-type environment, and the first type of task is opened for the first time, the single-channel memory consumption value and the single-channel computing power consumption value of the task to be created that participate in the calculation use the first-time opened memory consumption value M and the multi-type environment computing power consumption value N' respectively. In this embodiment, the preset thresholds in the above-mentioned step S211 may include the seventh threshold Δm", the eighth threshold Δc", and the ninth threshold Δn". Therefore, there are remaining resources available, that is, the third preset condition is: the difference M free -M is greater than the seventh threshold Δm" and the difference C free -C is greater than the eighth threshold Δc", and the difference N free -N' is greater than the ninth threshold Δn", that is:
[0092] M free -M>Δm” and C free -C>Δc” and N free -N'>Δn", wherein the seventh threshold Δm", the eighth threshold Δc", and the ninth threshold Δn" are close to 0 or smaller values, which are determined according to actual conditions and are not limited in the present application.
[0093] S22: Select a target computing power card that meets the fourth preset condition from the second candidate computing power card set, and enter the step of creating a task to be created on the target computing power card.
[0094] Specifically, the target computing power card with the largest remaining resource value is selected from the second candidate computing power card set. In addition, in this embodiment, the method for determining the largest remaining resource value is to take the remaining CNN computing power value Nfree The largest target computing power card. In this way, the remaining resource utilization of the computing power card can be fully exploited. Of course, this application does not limit the method for determining the largest remaining resource value.
[0095] In this embodiment, after the above step S4, if no idle computing power card is found in the second computing power card subset, steps S20-S22 are entered to find a target computing power card that meets the conditions. Of course, in other embodiments, after the above step S5, an idle computing power card can be directly found in the second computing power card subset or steps S20-S22 can be directly entered to find a target computing power card that meets the conditions, and this application does not limit this.
[0096] Of course, depending on the different situations of the computing power card, the method for calculating whether the remaining resource value is available can also be determined by other similar derivative methods, which is not limited in this application.
[0097] In this way, when creating a new task, the focus is on balanced use of multiple cards. The strategy of giving priority to available computing power cards in a single-type environment that has tasks of the same type as the new task enabled, followed by computing power cards in multi-type environments that include tasks of the same type, then completely idle computing power cards, and finally computing power cards with available remaining resources, is adopted, so that the remaining resource utilization of the computing power cards can be fully utilized.
[0098] In this embodiment, the first threshold Δm, the fourth threshold Δm', and the seventh threshold Δm" may be the same or different, the second threshold Δc, the fifth threshold Δc', and the eighth threshold Δc" may be the same or different, the third threshold Δn, the sixth threshold Δn', and the ninth threshold Δn" may be the same or different, and the present application does not limit this.
[0099] See also Figure 8 , Figure 8 This is a schematic diagram of the structure of an implementation method of the computing power scheduling device of the present application. The computing power scheduling system specifically includes:
[0100] The acquisition module 10 is used to acquire the type of the task to be created and a first computing power card subset including the first type of tasks in the computing power card set; wherein the task to be created is a task of the first type.
[0101] The processing module 12 is coupled to the acquisition module 10 and is configured to create a task to be created on the target computing power card in response to the first computing power card subset including a target computing power card that meets a preset condition.
[0102] See also Fig. 9 , Fig. 91 is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device includes a memory 20 and a processor 22 coupled to each other. Specifically, in this embodiment, the memory 20 stores program instructions, and the processor 22 is used to execute the program instructions to implement the computing power scheduling method mentioned in any of the above embodiments.
[0103] Specifically, the processor 22 may also be referred to as a CPU (Central Processing Unit). The processor 22 may be an integrated circuit chip having the ability to process signals. The processor 22 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 22 may be implemented by a plurality of integrated circuit chips.
[0104] See also Fig.10 , Fig.10 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 30 stores a computer program 300, which can be read by a computer, and the computer program 300 can be executed by a processor to implement the computing power scheduling method mentioned in any of the above embodiments. Among them, the computer program 300 can be stored in the above-mentioned computer-readable storage medium 30 in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The computer-readable storage medium 30 with a storage function can be a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, RandomAccess Memory), a disk or an optical disk, etc., which can store program codes, or a terminal device such as a computer, a server, a mobile phone, and a tablet.
[0105] In summary, different from the prior art, the computing power scheduling method provided by the present application includes: obtaining the type of task to be created and a first computing power card subset containing tasks of the first type in the computing power card set; wherein, the type of task to be created is the first type, and when the first computing power card subset includes a target computing power card that meets the preset conditions, the task to be created is created on the target computing power card. Through this design method, tasks of the same type can be created on the same computing power card as much as possible, which not only improves the memory utilization rate and CNN computing power utilization rate of the computing power card, thereby improving the remaining resource utilization rate of the computing power card, but also saves the additional memory consumption required for the first task creation.
[0106] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A computing power scheduling method, characterized in that: include: Acquire the type of the task to be created and a first subset of computing power cards in the computing power card set that includes tasks of the first type; wherein the type of the task to be created is the first type; In response to the first computing power card subset including a target computing power card that meets a preset condition, creating the task to be created on the target computing power card; The step of obtaining a target computing power card that meets a preset condition in response to the first computing power card subset includes: Obtaining a single-path resource consumption value of the task to be created and a remaining resource value of each computing power card in the first computing power card subset; Selecting a first candidate computing power card set that meets a first preset condition from the first computing power card subset according to the single-channel resource consumption value and the remaining resource value; Selecting a target computing power card that meets a second preset condition from the first candidate computing power card set; The remaining resource value includes the remaining CNN computing power value; the step of obtaining the remaining resource value of each computing power card in the first computing power card subset includes: In response to the current computing power card only including the first type of tasks, obtaining a third difference value, the third difference value being equal to a value obtained by subtracting the product of the single-type environment computing power consumption value of each task in the current computing power card and the number of tasks from one, and using the third difference value as the remaining CNN computing power value of the current computing power card; and / or, In response to the current computing power card containing the first type of tasks and other types of tasks, a fourth difference is obtained, where the fourth difference is one minus the sum of the multi-type environment computing power consumption values of each task in the current computing power card, and the fourth difference is used as the remaining CNN computing power value of the current computing power card.
2. The computing power scheduling method according to claim 1, characterized in that: The step of selecting a first candidate computing power card set that meets a first preset condition from the first computing power card subset according to the single-path resource consumption value and the remaining resource value includes: In response to the first computing power card subset including computing power cards that only include the first type of tasks, a first difference between the remaining resource value and the single-channel resource consumption value of each computing power card in the first computing power card subset is obtained; wherein the first difference includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value that is not enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the single-type environment computing power consumption value, and the single-type environment computing power consumption value is the single-channel CNN computing power consumption value measured when the computing power card currently only enables the first type of tasks; Selecting a first candidate computing power card set whose first difference is greater than a preset threshold from the first computing power card subset; and / or, In response to the first computing power card subset including computing power cards including the first type of tasks and other types of tasks, a second difference between the remaining resource value and the single-channel resource consumption value of each computing power card in the first computing power card subset is obtained; wherein the second difference includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value that is not enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the multi-type environment computing power consumption value, wherein the multi-type environment computing power consumption value is a single-channel CNN computing power consumption value measured when the current computing power card currently enables multiple types of tasks, and the multi-type environment computing power consumption value is related to the single-type environment computing power consumption value; A first candidate computing power card set whose second difference is greater than a preset threshold is selected from the first computing power card subset.
3. The computing power scheduling method according to claim 1, characterized in that: The step of selecting a target computing power card that meets a second preset condition from the first candidate computing power card set includes: In response to the first computing power card subset including computing power cards that only include the first type of tasks, selecting a target computing power card with the smallest remaining resource value from the first candidate computing power card set; and / or, In response to the first computing power card subset including computing power cards that include the first type of tasks and other types of tasks, a target computing power card with the largest number of currently opened tasks of the first type is selected from the first candidate computing power card set.
4. The computing power scheduling method according to claim 1, characterized in that: The method further comprises: In response to not determining the target computing power card from the first computing power card subset, obtaining a second computing power card subset that does not include the first type of tasks from the computing power card set.
5. The computing power scheduling method according to claim 4, characterized in that: After the step of obtaining a second subset of computing power cards that does not include the first type of tasks from the computing power card set, the method further includes: In response to the second computing power card subset including at least one idle computing power card, any of the idle computing power cards is selected as the target computing power card, and the step of creating the task to be created on the target computing power card is entered; wherein the idle computing power card currently has no task opened.
6. The computing power scheduling method according to claim 4, characterized in that: After the step of obtaining a second subset of computing power cards that does not include the first type of tasks from the computing power card set, the method further includes: In response to the second computing power card subset including at least one non-completely idle computing power card, obtaining a single-path resource consumption value of the task to be created and a remaining resource value of each computing power card in the second computing power card subset; Selecting a second candidate computing power card set that meets a third preset condition from the second computing power card subset according to the single-channel resource consumption value and the remaining resource value; A target computing power card that meets a fourth preset condition is selected from the second candidate computing power card set, and the step of creating the task to be created on the target computing power card is entered.
7. The computing power scheduling method according to claim 6, characterized in that: The step of selecting a second candidate computing power card set that meets a third preset condition from the second computing power card subset according to the single-path resource consumption value and the remaining resource value includes: Obtaining a fifth difference between the remaining resource value and the single-path resource consumption value of each computing power card in the second computing power card subset; A second set of candidate computing power cards whose fifth difference is greater than a preset threshold is selected from the second computing power card subset; wherein the fifth difference includes at least one of the difference between the remaining memory value of the computing power card and the single-channel memory consumption value enabled for the first time, the difference between the remaining CPU value and the single-channel CPU occupancy value, and the difference between the remaining CNN computing power value and the computing power consumption value of multiple types of environments.
8. The computing power scheduling method according to claim 6, characterized in that: The step of selecting a target computing power card that meets the fourth preset condition from the second candidate computing power card set and creating the task to be created on the target computing power card includes: A target computing power card with the largest remaining resource value is selected from the second candidate computing power card set, and the step of creating the task to be created on the target computing power card is entered.
9. A computing power scheduling device, characterized in that: include: An acquisition module, used to acquire the type of the task to be created and a first subset of computing power cards in the computing power card set that includes tasks of the first type; wherein the type of the task to be created is the first type; a processing module, configured to, in response to the first computing power card subset including a target computing power card that meets a preset condition, create the task to be created on the target computing power card; The processing module is used to obtain the single-channel resource consumption value of the task to be created and the remaining resource value of each computing power card in the first computing power card subset; select a first candidate computing power card set that meets a first preset condition from the first computing power card subset according to the single-channel resource consumption value and the remaining resource value; and select a target computing power card that meets a second preset condition from the first candidate computing power card set; The remaining resource value includes the remaining CNN computing power value; the processing module is used to obtain a third difference in response to the current computing power card only containing the first type of tasks, the third difference being equal to one minus the product of the single-type environment computing power consumption value of each task in the current computing power card and the number of tasks, and using the third difference as the remaining CNN computing power value of the current computing power card; and / or, In response to the current computing power card containing the first type of tasks and other types of tasks, a fourth difference is obtained, where the fourth difference is one minus the sum of the multi-type environment computing power consumption values of each task in the current computing power card, and the fourth difference is used as the remaining CNN computing power value of the current computing power card.
10. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the computing power scheduling method described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to implement the computing power scheduling method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Task scheduling method and device, electronic equipment and storage medium
CN112905350A