A scheduling method and device for intelligent algorithm
By creating a corresponding thread group for each intelligent algorithm and scheduling it to the corresponding execution unit, the problem of insufficient available threads in the thread group in the existing technology is solved, and the execution efficiency of multiple intelligent algorithms is improved.
Patent Information
- Application Number
- CN202010565995.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-19
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2040-06-19
AI Technical Summary
In the prior art, when multiple intelligent algorithms are scheduled through a single thread group, there are insufficient available threads, resulting in low overall execution efficiency of multiple intelligent algorithms.
By reading the identifier of each intelligent algorithm, creating a thread group corresponding to it, and scheduling the intelligent algorithm to the corresponding execution unit to improve scheduling efficiency.
This method improves the overall execution efficiency of multiple intelligent algorithms, avoids waiting situations caused by thread exhaustion, and improves the overall performance of the system.
Smart Images

Figure CN111796919B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and in particular to a scheduling method and device for an intelligent algorithm. Background Art
[0002] At present, when applying artificial intelligence technology to specific business scenarios, a combination of multiple intelligent algorithms is usually used to solve specific problems in the business scenario. In the prior art, no matter which execution unit the above-mentioned multiple intelligent algorithms are running on, for example, a central processing unit (CPU) or a graphics processing unit (GPU), they are all scheduled through the same thread group. Considering certain business scenarios, such as tracking a moving target based on a video, for example, the moving target is a person, some of the multiple intelligent algorithms used to implement mobile target tracking need to be executed at high speed, so they need to be scheduled frequently, and the number of threads available in the same thread group is limited, so it may happen that when scheduling some intelligent algorithms, all available threads in the thread group are exhausted, so that other intelligent algorithms need to wait when scheduling, resulting in low overall execution efficiency of multiple intelligent algorithms.
[0003] It can be seen that in the prior art, when different intelligent algorithms are scheduled based on the same thread group, the available threads may be insufficient, resulting in low overall execution efficiency of multiple intelligent algorithms executed sequentially. This provides technical inspiration for technicians in this field to improve the existing scheduling method from the perspective of thread groups. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for scheduling an intelligent algorithm, which can make up for the deficiency of scheduling multiple intelligent algorithms through a single thread group in the prior art, thereby improving the overall execution efficiency of the multiple intelligent algorithms.
[0005] In a first aspect, an embodiment of the present invention provides a scheduling method of an intelligent algorithm, the method comprising:
[0006] Reading a first identifier corresponding to each first intelligent algorithm among a plurality of first intelligent algorithms to be executed, where the first identifier is used to indicate an execution unit corresponding to each first intelligent algorithm, and the combination of the plurality of first intelligent algorithms to be executed is used to solve a first business problem in a first business scenario;
[0007] Creating a thread group corresponding to the first identifier according to the first identifier, wherein the thread group corresponds to an execution unit of the first intelligent algorithm;
[0008] The first intelligent algorithm is scheduled to an execution unit corresponding to the thread group based on any idle thread in the thread group, so as to execute the first intelligent algorithm through the execution unit.
[0009] In an embodiment of the present invention, multiple first intelligent algorithms to be executed can be considered to be designed to solve the first business problem in the first business scenario. By reading the first identifier corresponding to each of the multiple first intelligent algorithms, the specific execution unit of each first intelligent algorithm can be known. Then, before executing the first intelligent algorithm through the execution unit, a thread group corresponding to the first identifier can be created according to the first identifier corresponding to the first intelligent algorithm. The thread group can be considered to be a thread group corresponding to the execution unit of the first intelligent algorithm, so that the first intelligent algorithm can be scheduled to a specific execution unit for execution through any idle thread in the thread group. This method can make up for the deficiency of scheduling multiple first intelligent algorithms through a single thread group in the prior art, thereby improving the overall execution efficiency of multiple first intelligent algorithms used to solve the first business problem.
[0010] Optionally, the first identifier includes a first part and a second part, the first part is used to indicate a type of the execution unit, and the second part is used to indicate a number of the execution unit, and creating a thread group corresponding to the first identifier according to the first identifier includes:
[0011] If the execution unit indicated by the first part is a central processing unit CPU, and the number of the execution unit indicated by the second part is M, then a first thread group is created, and the first thread group corresponds to the Mth core of the CPU, wherein M is a positive integer not greater than the number of cores of the CPU;
[0012] If the execution unit indicated by the first part is a graphics processor GPU, and the execution unit indicated by the second part is numbered N, a second thread group is created, and the second thread group corresponds to the Nth GPU, where N is a positive integer not greater than the number of the GPUs.
[0013] In an embodiment of the present invention, the first identifier corresponding to the first intelligent algorithm can be considered to be divided into two parts: the first part can be used to indicate the type of the execution unit, and the second part can indicate the specific number of the execution unit. That is to say, if the execution unit is determined to be a CPU through the first part, then the second part can be used to further determine in which core of the CPU the first intelligent algorithm needs to be executed, for example, the first intelligent algorithm needs to be executed in the Mth core, so that a thread group corresponding to the Mth core of the CPU can be created, and based on the thread group, the first intelligent algorithm can be scheduled to the Mth core of the CPU for execution. Or, if the execution unit is determined to be a GPU through the first part, then the second part can be used to further determine in which GPU the first intelligent algorithm needs to be executed, for example, the first intelligent algorithm needs to be executed in the Nth GPU, so that a thread group corresponding to the Nth GPU can be created, and based on the thread group, the first intelligent algorithm can be scheduled to the Nth GPU for execution. In an embodiment of the present application, by creating corresponding thread groups for different execution units, the first intelligent algorithm is scheduled to a specific execution unit based on the thread group, thereby improving the overall scheduling efficiency and execution efficiency of multiple first intelligent algorithms.
[0014] Optionally, the first intelligent algorithm is provided with a backup algorithm, the backup algorithm is different from a first identifier carried by the first intelligent algorithm, the first intelligent algorithm and the backup algorithm have the same second identifier, and the second identifier is used to indicate that the first intelligent algorithm has the same function as the backup algorithm, further comprising:
[0015] If it is determined that the GPU indicated by the first part does not exist, a backup algorithm corresponding to the first intelligent algorithm is determined according to the second identifier of the first intelligent algorithm, and a third thread group is created based on the first identifier of the backup algorithm, the third thread group corresponds to the Lth core of the CPU, the Lth core is a core in the CPU whose running frequency is greater than or equal to a preset frequency, wherein L is a positive integer not greater than the number of cores of the CPU.
[0016] In an embodiment of the present invention, if it is determined that the first part of the first identifier of a first intelligent algorithm indicates a GPU, that is, the first intelligent algorithm needs to be executed in the GPU, but in fact the current computing device does not include a GPU, in order to ensure that the first intelligent algorithm can still be executed normally, then the backup algorithm corresponding to the first intelligent algorithm can be found according to the second identifier corresponding to the first intelligent algorithm. Since the first identifier of the first intelligent algorithm and the backup algorithm corresponding to the first intelligent algorithm are different, it can be considered that the execution units corresponding to the two are different, so a third thread group is created according to the first identifier of the backup algorithm. Since the first intelligent algorithm needs to run on the GPU, that is, the first intelligent algorithm has a high requirement for execution efficiency, the created third thread group can correspond to the core with a higher running frequency in the CPU, so as to ensure the execution efficiency of the first intelligent algorithm as much as possible.
[0017] Optionally, creating a thread group corresponding to the first identifier according to the first identifier includes:
[0018] If both the first part and the second part are default values, a fourth thread group is created, wherein the fourth thread group corresponds to a core of each core of the CPU whose load is less than a preset threshold.
[0019] In an embodiment of the present invention, if the first part and the second part of the first identifier of the first intelligent algorithm are both default values, it indicates that the first intelligent algorithm has not pre-specified a specific execution unit, and thus it can be considered that the first intelligent algorithm has a low requirement for execution efficiency, and thus a thread group corresponding to the core with lower load in the CPU can be created based on the current load conditions of each core of the CPU.
[0020] In a second aspect, an embodiment of the present invention provides a scheduling device of an intelligent algorithm, the device comprising:
[0021] A reading unit, used to read a first identifier corresponding to each first intelligent algorithm in a plurality of first intelligent algorithms to be executed, wherein the first identifier is used to indicate an execution unit corresponding to each first intelligent algorithm, and the combination of the plurality of first intelligent algorithms to be executed is used to solve a first business problem in a first business scenario;
[0022] a creating unit, configured to create a thread group corresponding to the first identifier according to the first identifier, wherein the thread group corresponds to an execution unit of the first intelligent algorithm;
[0023] A scheduling unit is used to schedule the first intelligent algorithm to an execution unit corresponding to the thread group based on any idle thread in the thread group, so as to execute the first intelligent algorithm through the execution unit.
[0024] Optionally, the first identifier includes a first part and a second part, the first part is used to indicate the type of the execution unit, the second part is used to indicate the number of the execution unit, and the creation unit is specifically used to:
[0025] If the execution unit indicated by the first part is a central processing unit CPU, and the number of the execution unit indicated by the second part is M, then a first thread group is created, and the first thread group corresponds to the Mth core of the CPU, wherein M is a positive integer not greater than the number of cores of the CPU;
[0026] If the execution unit indicated by the first part is a graphics processor GPU, and the execution unit indicated by the second part is numbered N, a second thread group is created, and the second thread group corresponds to the Nth GPU, where N is a positive integer not greater than the number of the GPUs.
[0027] Optionally, the first intelligent algorithm is provided with a backup algorithm, the backup algorithm is different from a first identifier carried by the first intelligent algorithm, the first intelligent algorithm and the backup algorithm have the same second identifier, the second identifier is used to indicate that the first intelligent algorithm has the same function as the backup algorithm, and the creation unit is further specifically used to:
[0028] If it is determined that the GPU indicated by the first part does not exist, a backup algorithm corresponding to the first intelligent algorithm is determined according to the second identifier of the first intelligent algorithm, and a third thread group is created based on the first identifier of the backup algorithm, the third thread group corresponds to the Lth core of the CPU, the Lth core is a core in the CPU whose running frequency is greater than or equal to a preset frequency, wherein L is a positive integer not greater than the number of cores of the CPU.
[0029] Optionally, the creation unit is further configured to:
[0030] If both the first part and the second part are default values, a fourth thread group is created, wherein the fourth thread group corresponds to a core of each core of the CPU whose load is less than or equal to a preset threshold.
[0031] In a third aspect, an embodiment of the present invention provides a scheduling device for an intelligent algorithm, the device comprising a processor and a memory, the processor being used to execute a computer program stored in the memory to implement the steps of the method described in the embodiment of the first aspect.
[0032] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of an architecture for scheduling of an intelligent algorithm provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of another intelligent algorithm scheduling architecture provided by an embodiment of the present invention;
[0035] Figure 3 A schematic diagram of a flow chart of a scheduling method of an intelligent algorithm provided in an embodiment of the present invention;
[0036] Figure 4 A schematic diagram of the structure of a scheduling device of an intelligent algorithm provided by an embodiment of the present invention;
[0037] Figure 5 A schematic diagram of the structure of a scheduling device of an intelligent algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0039] See also Figure 1 , which is a schematic diagram of the scheduling architecture of the existing intelligent algorithm. Figure 1 In the example, intelligent algorithm A, intelligent algorithm B, intelligent algorithm C and intelligent algorithm D can be considered as a combination of algorithms that need to be executed in sequence to complete a specific task, that is, the initial data can be executed by intelligent algorithm A to obtain output data A, and the output data A is used as the input data of intelligent algorithm B to obtain output data B; output data B is used as the input data of intelligent algorithm C to obtain output data C; output data C is used as the input data of intelligent algorithm D to obtain the final output result. It should be understood that the initial data will continuously enter intelligent algorithm A for execution, so intelligent algorithm A will also continuously generate output data A, and so on. At the same time, intelligent algorithms AD are arranged in the task queue of the same thread group, waiting for idle threads to schedule them to different execution units for execution. For example, if intelligent algorithm A has a high requirement for execution efficiency, intelligent algorithm A will be scheduled to any GPU or CPU core with a higher running frequency, such as CPU_0, so as to ensure the execution efficiency of intelligent algorithm A as much as possible.
[0040] As can be seen from the above, in the prior art, only the same thread group is used to schedule the intelligent algorithms AD to different execution units at the same time, and the number of threads available in the same thread group is limited. If some intelligent algorithms have a high execution efficiency, they need to be scheduled frequently, so it may happen that scheduling some intelligent algorithms will exhaust all the available threads in the thread group, so that other intelligent algorithms with low execution efficiency need to wait when being scheduled, resulting in low overall execution efficiency of multiple intelligent algorithms.
[0041] In view of this, an embodiment of the present invention provides a scheduling method for an intelligent algorithm. The method creates a corresponding thread group for the intelligent algorithm to be executed, and then schedules the intelligent algorithm to be executed to the corresponding execution unit through the thread group. This not only improves the overall scheduling efficiency of multiple intelligent algorithms, but also does not cause the execution unit to wait, that is, it also improves the overall execution efficiency of multiple execution algorithms.
[0042] For ease of understanding, an application scenario of an embodiment of the present invention is first introduced. Figure 2 , is a schematic diagram of the scheduling architecture of an intelligent algorithm provided for the implementation of the present invention. Figure 2 and Figure 1 The difference is that Figure 2 In the example, multiple thread groups corresponding to different execution units are created, so that the intelligent algorithms that need to be executed in different execution units are scheduled to specific execution units based on the created thread groups. For example, the intelligent algorithm A is scheduled to CPU_0 through the newly created thread group.
[0043] based on Figure 2 The following is a schematic diagram of the scheduling architecture of the intelligent algorithm shown in FIG. 1 , and the technical solution provided by the embodiment of the present invention is introduced in conjunction with the accompanying drawings. Figure 3 The embodiment of the present invention provides a scheduling method of an intelligent algorithm, and the process of the method is described as follows:
[0044] Step 301: read a first identifier corresponding to each first intelligent algorithm among a plurality of first intelligent algorithms to be executed, where the first identifier is used to indicate an execution unit corresponding to each first intelligent algorithm.
[0045] The multiple first intelligent algorithms to be executed can be considered as a combination of algorithms designed to solve the first business problem in the first business scenario. For example, the first business scenario can be a passenger station or a high-speed rail station and other public places with dense traffic. The scope of the first business scenario is not particularly limited here. The first business problem can be to track a mobile target (such as a person) based on a surveillance video. Once a suspicious and dangerous behavior of the mobile target is found, an alarm is immediately issued to prompt the relevant staff. Then the multiple first intelligent algorithms to be executed can be used to complete target detection, target tracking, target classification and alarm tasks respectively. Among them, the first intelligent algorithm used to complete the target detection, target tracking and target classification tasks has a high requirement for execution efficiency and needs to be dispatched to an execution unit with higher computing performance; while the first intelligent algorithm used for alarm has a low requirement for execution efficiency and can be dispatched to an execution unit with lower computing performance. In other words, the execution unit corresponding to each of the multiple first intelligent algorithms to be executed is predetermined, so a corresponding first identifier can be set for each first intelligent algorithm, and the first identifier can be used to indicate the execution unit of each first intelligent algorithm.
[0046] In order to avoid the problem of insufficient available threads when scheduling multiple first intelligent algorithms based on a single thread group, in an embodiment of the present application, when scheduling multiple first intelligent algorithms, multiple thread groups can be created, and each thread group can be considered to correspond to a specific execution unit. That is, the first intelligent algorithm can be scheduled to a specific execution unit through the thread group. Therefore, before creating a thread group to schedule the first intelligent algorithm, it is necessary to obtain the specific execution unit specified in advance by the first intelligent algorithm, that is, to obtain the first identifier of the first intelligent algorithm.
[0047] As a possible implementation, a first identifier corresponding to each first intelligent algorithm among multiple first intelligent algorithms to be executed may be read.
[0048] Step 302: Create a thread group corresponding to the first identifier according to the first identifier, and the thread group corresponds to the execution unit of the first intelligent algorithm.
[0049] Since the first identifier indicates the execution unit corresponding to each first intelligent algorithm, after obtaining the first identifier of each first intelligent algorithm, it can be considered that the execution unit of each first intelligent algorithm is known. On this basis, in order to be able to schedule each first intelligent algorithm to the corresponding execution unit, a thread group corresponding to different execution units can be created, so that each first intelligent algorithm can be scheduled based on the created thread group. Since the scheduling efficiency of each first intelligent algorithm is improved, the execution unit is constantly executing computing tasks, thereby improving the overall execution efficiency of multiple first intelligent algorithms.
[0050] In a possible implementation manner, a thread group corresponding to the first identifier may be created according to the first identifier, and the thread group corresponds to the execution unit of the first intelligent algorithm.
[0051] Considering that the execution units are usually divided into CPU and GPU, when the execution unit is CPU, it is also necessary to further determine which core of the CPU is used as the specific execution unit according to the first intelligent algorithm's own requirements for execution efficiency; when the execution unit is GPU, it is also necessary to further determine which GPU is used as the specific execution unit. Therefore, the first identifier corresponding to the first intelligent algorithm not only needs to indicate the type of execution unit, but also needs to indicate the specific number of the execution unit. As a possible implementation method, the first identifier can be divided into two parts, such as the first part and the second part. The first part is used to indicate the type of execution unit, and the second part is used to indicate the number of the execution unit. Then, based on the contents indicated by the first part and the second part of the first identifier, a thread group corresponding to the specific execution unit can be created, thereby scheduling the first intelligent algorithm. The following describes how to create a thread group when the first part and the second part of the first identifier indicate different contents.
[0052] The first case: when the execution unit indicated by the first part is a CPU, and the number of the execution unit indicated by the second part is M, it can be considered that the first intelligent algorithm needs to be executed in the Mth core of the CPU. At this time, a first thread group can be created, and the first thread group corresponds to the Mth core of the CPU, so that the first intelligent algorithm can be scheduled to the Mth core of the CPU based on the first thread group, and M is a positive integer not greater than the number of cores of the CPU. It should be understood that the operating frequencies of the several cores included in the CPU are different, that is, the computing performance is different, so the Mth core of the CPU can be considered as a core with higher computing performance or a core with lower computing performance.
[0053] In the second case, when the execution unit indicated by the first part is a GPU, and the execution unit number indicated by the second part is N, it can be considered that the first intelligent algorithm needs to be executed in the Nth GPU. At this time, a second thread group can be created, and the second thread group corresponds to the Nth GPU, so that the first intelligent algorithm can be scheduled to the Nth GPU based on the second thread group, and N is a positive integer not greater than the number of GPUs.
[0054] It should be understood that a computing device is usually configured with a CPU but may not be configured with a GPU, so a thread group corresponding to the GPU cannot be created, resulting in the inability to execute the first intelligent algorithm that needs to be executed in the GPU.
[0055] In an embodiment of the present invention, a backup algorithm is provided for a first intelligent algorithm that needs to be executed in a GPU. The backup algorithm corresponds to a different first identifier from the first intelligent algorithm, that is, the execution unit of the backup algorithm is different from that of the first intelligent algorithm. For example, the execution unit of the first intelligent algorithm is a GPU, that is, the first intelligent algorithm needs to be executed efficiently. Then, the execution efficiency of the first intelligent algorithm is guaranteed as much as possible. The execution unit of the backup algorithm can be the Lth core in the CPU, where L is a positive integer not greater than the number of cores of the CPU. The Lth core can be considered as a core with a higher operating frequency and a higher computing performance among the cores of the CPU. Since the backup algorithm and the first intelligent algorithm both receive the same input data and obtain the same output data, that is, the backup algorithm and the first intelligent algorithm are the same in terms of the functions implemented. Therefore, a second identifier can be provided for both the first intelligent algorithm and the corresponding backup algorithm. The second identifier is used to indicate that the first intelligent algorithm and the corresponding backup algorithm have the same algorithm functions. Once it is determined that the GPU indicated by the first part does not exist, the backup algorithm corresponding to the first intelligent algorithm can be queried based on the second identifier of the first intelligent algorithm, so that a third thread group can be created based on the first identifier of the backup algorithm, and then the backup algorithm of the first intelligent algorithm can be scheduled to the Lth core of the CPU based on the third thread group.
[0056] The third case: When the contents indicated by the first part and the second part are both default values, it can be considered that the first intelligent algorithm has a low requirement for execution efficiency. At this time, a fourth thread group can be created. The fourth thread group corresponds to the cores of the CPU whose load is less than a preset threshold. Therefore, the first intelligent algorithm can be scheduled to the cores with smaller loads in the CPU based on the fourth thread group.
[0057] Step 303: scheduling the first intelligent algorithm to an execution unit corresponding to the thread group based on any idle thread in the thread group, so as to execute the first intelligent algorithm through the execution unit.
[0058] In an embodiment of the present invention, after creating a thread group corresponding to an execution unit according to the content indicated by the first identifier, the first intelligent algorithm to be executed is added to the task queue of the thread group, so that the thread group is used to schedule the first intelligent algorithm to a specific execution unit for execution to obtain the output result of the first intelligent algorithm.
[0059] As a possible implementation, the first intelligent algorithm may be scheduled to an execution unit corresponding to the thread group based on any idle thread in the thread group, so as to execute the first intelligent algorithm through the execution unit.
[0060] See also Figure 4 , based on the same inventive concept, and combined with Figure 2The schematic diagram of the architecture of the scheduling of the intelligent algorithm is shown. An embodiment of the present invention provides a scheduling device for the intelligent algorithm, which includes: a reading unit 401, a creation unit 402 and a scheduling unit 403.
[0061] A reading unit 401 is used to read a first identifier corresponding to each first intelligent algorithm in a plurality of first intelligent algorithms to be executed, where the first identifier is used to indicate an execution unit corresponding to each first intelligent algorithm, and a combination of the plurality of first intelligent algorithms to be executed is used to solve a first business problem in a first business scenario;
[0062] A creating unit 402, configured to create a thread group corresponding to the first identifier according to the first identifier, wherein the thread group corresponds to an execution unit of the first intelligent algorithm;
[0063] The scheduling unit 403 is used to schedule the first intelligent algorithm to the execution unit corresponding to the thread group based on any idle thread in the thread group, so as to execute the first intelligent algorithm through the execution unit.
[0064] Optionally, the first identifier includes a first part and a second part, the first part is used to indicate the type of the execution unit, and the second part is used to indicate the number of the execution unit. The creation unit 402 is specifically used to:
[0065] If the execution unit indicated by the first part is a central processing unit CPU, and the number of the execution unit indicated by the second part is M, then a first thread group is created, and the first thread group corresponds to the Mth core of the CPU, where M is a positive integer not greater than the number of cores of the CPU;
[0066] If the execution unit indicated by the first part is a graphics processor GPU, and the number of the execution unit indicated by the second part is N, a second thread group is created, and the second thread group corresponds to the Nth GPU, where N is a positive integer not greater than the number of GPUs.
[0067] Optionally, the first intelligent algorithm is provided with a backup algorithm, the backup algorithm is different from a first identifier carried by the first intelligent algorithm, the first intelligent algorithm and the backup algorithm have the same second identifier, and the second identifier is used to indicate that the first intelligent algorithm has the same function as the backup algorithm. The creation unit 402 is further specifically used to:
[0068] If it is determined that the GPU indicated by the first part does not exist, a backup algorithm corresponding to the first intelligent algorithm is determined according to the second identifier of the first intelligent algorithm, and a third thread group is created based on the first identifier of the backup algorithm, and the third thread group corresponds to the Lth core of the CPU, and the Lth core is a core in the CPU whose running frequency is greater than or equal to a preset frequency, where L is a positive integer not greater than the number of cores of the CPU.
[0069] Optionally, the creating unit 403 is further configured to:
[0070] If both the first part and the second part are default values, a fourth thread group is created, wherein the fourth thread group corresponds to a core of each core of the CPU whose load is less than or equal to a preset threshold.
[0071] See also Figure 5 Based on the same inventive concept, an embodiment of the present invention provides a scheduling device for an intelligent algorithm, the device comprising at least one processor 501, the processor 501 is used to execute a computer program stored in a memory, and implement the following provided by the embodiment of the present invention: Figure 3 The steps of the scheduling method of the intelligent algorithm are shown.
[0072] Optionally, the processor 501 may specifically be a central processing unit, a specific ASIC, or one or more integrated circuits for controlling program execution.
[0073] Optionally, the scheduling device of the intelligent algorithm may further include a memory 502 connected to at least one processor 501, and the memory 502 may include ROM, RAM and disk storage. The memory 502 is used to store data required by the processor 501 when it is running, that is, it stores instructions that can be executed by at least one processor 501. At least one processor 501 executes the instructions stored in the memory 502 to execute the following. Figure 3 The method shown. The number of the memory 502 is one or more. The memory 502 is Figure 5 However, it should be noted that the memory 502 is not a mandatory functional module, so Figure 5 Shown by dotted lines.
[0074] The physical devices corresponding to the reading unit 401, the creating unit 402 and the scheduling unit 403 can all be the aforementioned processor 501. The scheduling device of the intelligent algorithm can be used to execute Figure 3 Therefore, for the functions that can be realized by each functional module in the device, please refer to Figure 3 The corresponding description in the illustrated embodiment will not be repeated here.
[0075] The embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes the following Figure 3 The method described.
[0076] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A scheduling method of an intelligent algorithm, characterized in that: The method comprises: Reading a first identifier corresponding to each first intelligent algorithm among a plurality of first intelligent algorithms to be executed, the first identifier being used to indicate an execution unit corresponding to each first intelligent algorithm, the first identifier comprising a first part and a second part, the first part being used to indicate a type of the execution unit, the second part being used to indicate a number of the execution unit, the types of the execution units comprising a central processing unit CPU and a graphics processing unit GPU, the combination of the plurality of first intelligent algorithms to be executed being used to solve a first business problem in a first business scenario; Creating a thread group corresponding to the first identifier according to the first identifier, wherein the thread group corresponds to an execution unit of the first intelligent algorithm; Scheduling the first intelligent algorithm to an execution unit corresponding to the thread group based on any idle thread in the thread group, so as to execute the first intelligent algorithm through the execution unit; The first intelligent algorithm is provided with a backup algorithm, the backup algorithm is different from a first identifier carried by the first intelligent algorithm, the first intelligent algorithm and the backup algorithm have the same second identifier, and the second identifier is used to indicate that the first intelligent algorithm has the same function as the backup algorithm, and further includes: If it is determined that the GPU indicated by the first part does not exist, a backup algorithm corresponding to the first intelligent algorithm is determined according to the second identifier of the first intelligent algorithm, and a third thread group is created based on the first identifier of the backup algorithm, the third thread group corresponds to the Lth core of the CPU, the Lth core is a core in the CPU whose running frequency is greater than or equal to a preset frequency, wherein L is a positive integer not greater than the number of cores of the CPU.
2. The method according to claim 1, characterized in that Creating a thread group corresponding to the first identifier according to the first identifier includes: If the execution unit indicated by the first part is a central processing unit CPU, and the number of the execution unit indicated by the second part is M, then a first thread group is created, and the first thread group corresponds to the Mth core of the CPU, wherein M is a positive integer not greater than the number of cores of the CPU; If the execution unit indicated by the first part is a graphics processor GPU, and the execution unit indicated by the second part is numbered N, a second thread group is created, and the second thread group corresponds to the Nth GPU, where N is a positive integer not greater than the number of the GPUs.
3. The method according to claim 1, characterized in that Creating a thread group corresponding to the first identifier according to the first identifier includes: If both the first part and the second part are default values, a fourth thread group is created, wherein the fourth thread group corresponds to a core of each core of the CPU whose load is less than a preset threshold.
4. A scheduling device of an intelligent algorithm, characterized in that: The device comprises: A reading unit, used to read a first identifier corresponding to each first intelligent algorithm in a plurality of first intelligent algorithms to be executed, wherein the first identifier is used to indicate an execution unit corresponding to each first intelligent algorithm, wherein the first identifier includes a first part and a second part, wherein the first part is used to indicate a type of the execution unit, and the second part is used to indicate a number of the execution unit, wherein the types of the execution units include a central processing unit CPU and a graphics processing unit GPU, and wherein the combination of the plurality of first intelligent algorithms to be executed is used to solve a first business problem in a first business scenario; a creating unit, configured to create a thread group corresponding to the first identifier according to the first identifier, wherein the thread group corresponds to an execution unit of the first intelligent algorithm; a scheduling unit, configured to schedule the first intelligent algorithm to an execution unit corresponding to the thread group based on any idle thread in the thread group, so as to execute the first intelligent algorithm through the execution unit; The first intelligent algorithm is provided with a backup algorithm, the backup algorithm is different from a first identifier carried by the first intelligent algorithm, the first intelligent algorithm and the backup algorithm have the same second identifier, the second identifier is used to indicate that the first intelligent algorithm has the same function as the backup algorithm, and the creation unit is further used to: If it is determined that the GPU indicated by the first part does not exist, a backup algorithm corresponding to the first intelligent algorithm is determined according to the second identifier of the first intelligent algorithm, and a third thread group is created based on the first identifier of the backup algorithm, the third thread group corresponds to the Lth core of the CPU, the Lth core is a core in the CPU whose running frequency is greater than or equal to a preset frequency, wherein L is a positive integer not greater than the number of cores of the CPU.
5. The device according to claim 4, characterized in that The creation unit is specifically used for: If the execution unit indicated by the first part is a central processing unit CPU, and the number of the execution unit indicated by the second part is M, then a first thread group is created, and the first thread group corresponds to the Mth core of the CPU, wherein M is a positive integer not greater than the number of cores of the CPU; If the execution unit indicated by the first part is a graphics processor GPU, and the execution unit indicated by the second part is numbered N, a second thread group is created, and the second thread group corresponds to the Nth GPU, where N is a positive integer not greater than the number of the GPUs.
6. The device according to claim 4, characterized in that The creation unit is further specifically used for: If both the first part and the second part are default values, a fourth thread group is created, wherein the fourth thread group corresponds to a core of each core of the CPU whose load is less than or equal to a preset threshold.
7. A scheduling device using an intelligent algorithm, characterized in that: The device comprises at least one processor and a memory connected to the at least one processor, and the at least one processor is configured to implement the steps of the method according to any one of claims 1 to 3 when executing a computer program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Video analysis and accelerating method based on thread level flow line
CN106358003A
fluid machinery simulation program heterogeneous acceleration method based on a GPU
CN109522127A