Task arbitration system

By allocating and updating dynamic weights for tasks in GPU cloud services, the problem of task arbitration balance is solved, task execution balance without priority information is achieved, and fair processing of tasks is ensured.

CN118708322AActive Publication Date: 2024-09-27沐曦科技(成都)有限公司
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410874706.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-27
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

In the GPU cloud service scenario, multiple tasks of a single user lack priority information, making it difficult to achieve balance in task arbitration.

Method used

By assigning dynamic weights to each task and continuously updating these weights during the calculation process, round-robin arbitration is implemented without using priority information to ensure balanced execution of tasks.

Benefits of technology

It effectively improves the arbitration balance of tasks without priority or with the same priority, making task execution more fair and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708322A
    Figure CN118708322A
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a task arbitration system which comprises a GPU chip, a temporary user and a task set, and when a computer program is executed by a processor, the following steps are achieved: dynamic weights are allocated to N (k) tasks respectively, a target task is arbitrated from the N (k) tasks according to the dynamic weights corresponding to the N (k) tasks respectively, and the target task is selected from the N (k) tasks; according to the dynamic weight corresponding to the target task, updating the dynamic weights corresponding to the N (k) tasks respectively, setting the dynamic weights for the tasks with the same priority, arbitrating the target task according to the dynamic weights, and adjusting the dynamic weights along with the arbitration process, therefore, the arbitration process accords with a polling arbitration result under the condition that priority information is not used, so that the arbitration balance of tasks without priority or with the same priority is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a task arbitration system. Background Art

[0002] GPU cloud service is an elastic computing service that provides GPU computing power. Since GPU chips have powerful parallel computing capabilities, they can serve scenarios such as deep learning training, scientific computing, graphics and image processing, and video encoding and decoding. In the GPU cloud service scenario, GPU chips can provide services to users of multiple terminals, so that users do not need to deploy GPU chips locally.

[0003] When a GPU chip provides services to a single user, the single user may have multiple tasks to execute. These tasks usually do not have priority information, so it is difficult to use the existing arbitrator to arbitrate the tasks, which makes it difficult to ensure the balance of task arbitration. Therefore, how to improve the balance of task arbitration has become an urgent problem to be solved. Summary of the invention

[0004] In view of the above technical problems, the technical solution adopted by the present invention is:

[0005] A task arbitration system, the system comprising: a GPU chip, a temporary user a k 、a k The corresponding task set E k ={e k 1, e k 2, …, e k n(k) , e k N(k)},e k n(k) For temporary user a k The corresponding task set E k The n(k)th task in the task set E k The computer program includes N(k) tasks, where n(k) is an integer in the range of [1, N(k)]. When the computer program is executed by the processor, the following steps are implemented:

[0006] S201, assign dynamic weights to N(k) tasks respectively.

[0007] S202, arbitrating a target task from the N(k) tasks according to the dynamic weights respectively corresponding to the N(k) tasks, wherein the target task is executed by the GPU chip.

[0008] S203: Update the dynamic weights corresponding to the N(k) tasks respectively according to the dynamic weight corresponding to the target task.

[0009] S204, return to execute steps S202 to S203.

[0010] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solution, the task arbitration system provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects:

[0011] The present invention provides a task arbitration system, the system comprising: a GPU chip, a temporary user a k 、a k The corresponding task set E k ={e k 1, e k 2, …, e k n(k) , e k N(k)},e k n(k) For temporary user a k The corresponding task set E k The n(k)th task in the task set E k The method comprises N(k) tasks, where n(k) is an integer in the range of [1, N(k)]. When the computer program is executed by a processor, the following steps are implemented: S201, dynamic weights are respectively assigned to the N(k) tasks; S202, a target task is arbitrated from the N(k) tasks according to the dynamic weights respectively corresponding to the N(k) tasks, and the target task is executed by the GPU chip; S203, the dynamic weights respectively corresponding to the N(k) tasks are updated according to the dynamic weights respectively corresponding to the target task; S204, execution of steps S202 to S203 is returned.

[0012] It can be seen that dynamic weights are set for tasks with the same priority and adjusted during the arbitration process, so that the arbitration process conforms to the result of round-robin arbitration without using priority information, thereby effectively improving the balance of arbitration for tasks with no priority or the same priority. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A schematic diagram of a flow chart of a computer program being executed by a processor in a user arbitration system for a GPU provided in the first embodiment of the present invention;

[0015] Figure 2 This is a flowchart of a computer program being executed by a processor in a task arbitration system provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0017] Embodiment 1 of the present invention provides a user arbitration system for a GPU, the system comprising: a GPU chip, a user set A = {a1, a2, ..., a m , …, a M}, a processor and a memory storing a computer program, wherein a m is the mth user in user set A, where user set A includes M users, m is an integer in the range [1, M], and a m Corresponds to b m , b m is the user information corresponding to the mth user in A. The user information includes the priority of the corresponding user. Figure 1 , is a flow chart of a computer program executed by a processor in a user arbitration system for a GPU provided in Embodiment 1 of the present invention. When the computer program is executed by the processor, the following steps are implemented:

[0018] S101, determining initial values ​​of reference weights corresponding to the M users respectively according to a preset total weight C and user information corresponding to the M users respectively, wherein the sum of the M initial values ​​is equal to C;

[0019] S102, for a single call cycle of the GPU chip, at the i-th time point of the call cycle, according to the request states of the M users at the i-th time point, and the reference weights and priorities corresponding to the M users at the i-th time point, arbitrate to obtain a temporary user corresponding to the i-th time slice, where the i-th time slice is the time period corresponding to the i-th time point to the i+1-th time point;

[0020] S103, updating the reference weight corresponding to the temporary user;

[0021] S104, update i=i+1, return to execute step S101 to step S103, until i=C+1, execute step S105;

[0022] S105, setting the reference weights corresponding to the M users respectively as their corresponding initial values, and returning to execute steps S102 to S104.

[0023] Among them, the GPU chip mentioned in this embodiment is not limited to a single GPU chip, but can also be one or more threads in a single GPU chip, or a GPU chipset formed by multiple GPU chips, etc. The user may refer to a user who needs to call the GPU chip. In this embodiment, different users have different corresponding priorities.

[0024] The time point may refer to the moment when user arbitration starts. The temporary user obtained by arbitration at the i-th time point can call the GPU chip within the i-th time slice. The duration corresponding to the time slice may be a fixed value.

[0025] In a specific implementation, the total weight C is the same as the number of time points included in a single call cycle of the GPU chip.

[0026] Among them, C is the same as the number of time points included in a single call cycle of the GPU chip. Accordingly, the sum of the initial values ​​of the reference weights corresponding to the M users is the same as the number of time points included in a single call cycle of the GPU chip. When the M users have requests at each time point in a single call cycle, the user arbitration provided by this embodiment can enable users of different priorities to call the GPU chip, thereby improving the balance of user arbitration.

[0027] In a specific implementation, the user information also includes historical usage information;

[0028] Determining initial values ​​of reference weights corresponding to the M users respectively according to the preset total weight C and the user information corresponding to the M users respectively includes:

[0029] According to the priorities and historical usage information respectively corresponding to the C and M users, initial values ​​of the reference weights respectively corresponding to the M users are determined.

[0030] Among them, user information may include user priority, historical usage information, membership level, etc. Historical usage information may include historical usage duration, historical usage times, historical usage frequency, etc. The implementer may select one or more from the above-mentioned types of user information to determine the initial value of the reference weight according to actual needs. This embodiment only takes priority and historical usage information as an example. In this example, the historical usage information is the historical usage duration.

[0031] Specifically, in this embodiment, an initial value determination method is provided as an example. The implementer should know that no matter what initial value determination method is used to determine the initial value of the reference weight of each user according to the user information of each user, it is within the protection scope of the present invention. The initial value determination method can be: normalize the priority of each user with the maximum value of the priority of each user to obtain the normalized priority of each user, normalize the historical usage time of each user with the maximum value of the historical usage time of each user to obtain the historical usage time priority of each user, for any user, multiply the normalized priority of the user and the historical usage time priority to obtain an intermediate normalized result, sum all the intermediate normalized results to obtain a summed result, for any user, multiply the ratio of the intermediate normalized result of the user to the summed result by C and perform a rounding operation to obtain the initial value of the reference weight corresponding to the user. It should be noted that in order to satisfy that the sum of the initial values ​​of the reference weights corresponding to the M users is equal to C, the implementer can flexibly select the rounding operation of each user according to the actual situation, and the rounding operation may include rounding up and rounding down.

[0032] In a specific implementation, the request state includes a request state and a non-request state;

[0033] Step S102 also includes the following steps:

[0034] S1021: If at the i-th time point, only a single user's request status is a requested status, then the user is used as a temporary user corresponding to the i-th time slice.

[0035] Among them, if at the i-th time point, only a single user's request status is a requested state, there is no need to consider the user's priority and reference value. The GPU chip can be directly allocated to the user's call to avoid the GPU chip being idle.

[0036] In a specific implementation, step S102 also includes the following steps:

[0037] S1022: If at the i-th time point, at least two users have a request status of having a request, select a user with the highest priority from users whose reference weights are not zero as a temporary user corresponding to the i-th time slice.

[0038] Among them, a user's reference weight of zero indicates that all of its allocated time slices have been used, and a user's reference weight of non-zero indicates that there are remaining allocated time slices. If at the i-th time point, at least two users have a request status of requested, since the user with a reference weight of zero should have used up all of its allocated time slices, the user with the highest priority is selected from the users with a non-zero reference weight as the temporary user corresponding to the i-th time slice.

[0039] In a specific implementation, step S103 also includes the following steps:

[0040] S1031: If the reference weight corresponding to the temporary user is zero, the reference weight corresponding to the temporary user is maintained.

[0041] If the reference weight corresponding to the temporary user is zero, the reference weight corresponding to the temporary user is kept zero.

[0042] In a specific implementation, step S103 also includes the following steps:

[0043] S1032: If the reference weight corresponding to the temporary user is not zero, reduce the reference weight corresponding to the temporary user by 1.

[0044] If the reference weight corresponding to the temporary user is not zero, the reference weight corresponding to the temporary user is reduced by 1. For example, the reference weight corresponding to a user before being determined as a temporary user is 2, and after the user is determined as a temporary user, the reference weight is updated to 1.

[0045] In a specific implementation manner, step S105 also includes the following steps:

[0046] S1051, if the user information corresponding to the M users is not updated, then the reference weights corresponding to the M users are set to their corresponding initial values, and the process returns to step S102 to step S104;

[0047] S1052: If the user information corresponding to any user is updated, the process returns to step S101 to step S104.

[0048] There may be updates to user information during the calling cycle. In order to distribute the calls to the GPU chips more evenly, when there is an update to user information, the initial value needs to be re-determined.

[0049] In one implementation, if there is an update on the M users, such as adding a new user or deleting a user, the process returns to step S101 to step S104 .

[0050] In the first embodiment, an initial value of the reference weight is allocated to each user according to the total weight and the user information of each user. Different from the prior art, the arbitration result is determined jointly according to the priority, request status and reference weight instead of only the priority during arbitration. After the temporary user is obtained through arbitration, its reference weight is updated accordingly, so that the high-priority user cannot continuously occupy the GPU chip, thereby effectively improving the balance of user arbitration.

[0051] Embodiment 2 of the present invention provides a task arbitration system, the system comprising: a GPU chip, a temporary user a k 、a k The corresponding task set E k ={e k 1, e k 2, …, e k n(k) , e k N(k)},e k n(k) For temporary user a k The corresponding task set E k The n(k)th task in the task set E k Includes N(k) tasks, where n(k) is an integer in the range [1, N(k)], see Figure 2 , is a flowchart of a computer program executed by a processor in a task arbitration system provided by Embodiment 2 of the present invention. When the computer program is executed by the processor, the following steps are implemented:

[0052] S201, assigning dynamic weights to N(k) tasks respectively;

[0053] S202, arbitrating a target task from the N(k) tasks according to the dynamic weights corresponding to the N(k) tasks, wherein the target task is executed by the GPU chip;

[0054] S203, updating the dynamic weights corresponding to the N(k) tasks respectively according to the dynamic weight corresponding to the target task;

[0055] S204, return to execute steps S202 to S203.

[0056] Among them, the dynamic weights assigned to N(k) tasks are all the same.

[0057] In a specific implementation, the initial value corresponding to the dynamic weight is p=f[log2(N(k))], where f[] is a round-up function.

[0058] Among them, since the dynamic weight can be zero, the value range corresponding to the dynamic weight is [0, f[log2(N(k))]], that is, the dynamic weight can have f[log2(N(k))]+1 values.

[0059] In a specific implementation, step S202 also includes the following steps:

[0060] S2021: If the maximum value of the dynamic weights corresponding to the N(k) tasks corresponds to a single task, then the task is determined to be the target task.

[0061] In a specific implementation, the N(k) tasks each have a static weight, and step S202 further includes the following steps:

[0062] S2022, if the maximum value among the dynamic weights corresponding to the N(k) tasks corresponds to multiple tasks, determine that the multiple tasks corresponding to the maximum value among the dynamic weights corresponding to the N(k) tasks are all intermediate tasks;

[0063] S2023: arbitrate the target task from all the intermediate tasks according to the static weights corresponding to all the intermediate tasks.

[0064] Among them, when the maximum value of the dynamic weights corresponding to N(k) tasks corresponds to multiple tasks, the balance of task arbitration cannot be guaranteed by dynamic weights alone, so arbitration is performed through static weights.

[0065] In a specific implementation, the static weights corresponding to the N(k) tasks are updated in a sequential cycle manner.

[0066] The sequential cycle method may refer to that the static weights corresponding to the N(k) tasks are maximized in sequence according to the sequential cycle method.

[0067] In a specific implementation manner, step S203 also includes the following steps:

[0068] S2031, updating the dynamic weight corresponding to the target task to zero.

[0069] In a specific implementation manner, step S203 also includes the following steps:

[0070] S2031, if the dynamic weights corresponding to the other intermediate tasks except the target task are the initial values, maintaining the dynamic weights corresponding to the other intermediate tasks except the target task;

[0071] S2032: If the dynamic weights corresponding to the other intermediate tasks except the target task are smaller than the initial value, the dynamic weights corresponding to the other intermediate tasks except the target task are increased by one respectively.

[0072] Specifically, N(k)=3 is used as an example for explanation. There are tasks R1, R2 and R3, and the initial value corresponding to the dynamic weight is 3. The polling mechanism is sequentially cycled in the order of R1, R2 and R3. The static weight of the initial R1 is the largest. In this embodiment, the value of the static weight is limited to 0 and 1. The static weight of the initial R1 is 1, and the static weights of R2 and R3 are 0. The dynamic weights of the initial R1, R2 and R3 are all 3. Therefore, the static weight is used for arbitration, and R1 is the result of the first round of arbitration.

[0073] Before the second round of arbitration, the static weight of R2 is changed to 1, and the static weights of R1 and R3 are 0. At the same time, the dynamic weight of R1 is updated to 0, and the dynamic weights of R2 and R3 are 3. At this time, the intermediate tasks are R2 and R3. Since the dynamic weights of R2 and R3 are the same, arbitration is performed according to the static weights of R2 and R3, and R2 is the result of the second round of arbitration;

[0074] Before the third round of arbitration, the static weight of R3 is changed to 1, and the static weights of R1 and R2 are 0. At the same time, the dynamic weight of R2 is updated to 0, the dynamic weight of R1 is 1, and the dynamic weight of R3 is 3. At this time, according to the dynamic weights, R3 is the result of the third round of arbitration.

[0075] It can be seen that the task arbitration system provided in this embodiment can implement arbitration in a polling manner without using the priorities corresponding to the tasks, thereby ensuring the balance of arbitration of tasks with no priority or the same priority.

[0076] In a specific implementation, the system further includes a user set A = {a1, a2, ..., a m , …, a M}, where a m is the mth user in the user set A, the user set A includes M users, m and k are both integers in the range of [1, M], a m Corresponds to b m , b m is the user information corresponding to the mth user in A, where the user information includes the priority of the corresponding user;

[0077] When the computer program is executed by a processor, the following steps are also implemented:

[0078] S301, determining initial values ​​of reference weights corresponding to the M users respectively according to a preset total weight C and user information corresponding to the M users respectively;

[0079] S302, at the jth time point, according to the request states of the M users at the jth time point, and the reference weights and priorities corresponding to the M users at the jth time point, the temporary user a is obtained by arbitration. k , j is a positive integer.

[0080] The process of user arbitration is described in the first embodiment and will not be described in detail here.

[0081] It should be noted that the above-mentioned embodiment 1 can be applied to arbitration between objects with different priorities, and the above-mentioned embodiment 2 can be applied to arbitration between objects with the same priority. The implementer can adjust the application scenarios of different embodiments according to actual conditions. For example, if arbitration is performed on several users with the same priority, the process provided in embodiment 2 can also be used for implementation. If arbitration is performed on several tasks with different priorities, the process provided in embodiment 1 can also be used for implementation.

[0082] The second embodiment of the present invention sets dynamic weights for tasks with the same priority and adjusts the dynamic weights during the arbitration process so that the arbitration process conforms to the result of round-robin arbitration without using priority information, thereby effectively improving the balance of arbitration for tasks with no priority or the same priority.

[0083] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A task arbitration system, It is characterized in that The system includes: GPU chip, temporary user a k 、a k The corresponding task set E k ={e k 1 , e k 2 ,…,e k n(k) , e k N(k) },e k n(k) For temporary user a k The corresponding task set E k The n(k)th task in the task set E k The computer program includes N(k) tasks, where n(k) is an integer in the range of [1, N(k)]. When the computer program is executed by the processor, the following steps are implemented: S201, assigning dynamic weights to N(k) tasks respectively; S202, arbitrating a target task from the N(k) tasks according to the dynamic weights corresponding to the N(k) tasks, wherein the target task is executed by the GPU chip; S203, updating the dynamic weights corresponding to the N(k) tasks respectively according to the dynamic weight corresponding to the target task; S204, return to execute steps S202 to S203.

2. The user arbitration system for a GPU according to claim 1, It is characterized in that The initial value corresponding to the dynamic weight is p=f[log 2 (N(k))], where f[] is the ceiling function.

3. The user arbitration system for a GPU according to claim 2, It is characterized in that Step S202 also includes the following steps: S2021: If the maximum value among the dynamic weights corresponding to the N(k) tasks corresponds to a single task, then the task is determined to be the target task.

4. The user arbitration system for a GPU according to claim 3, It is characterized in that The N(k) tasks each have a corresponding static weight, and step S202 further includes the following steps: S2022, if the maximum value among the dynamic weights corresponding to the N(k) tasks corresponds to multiple tasks, determine that the multiple tasks corresponding to the maximum value among the dynamic weights corresponding to the N(k) tasks are all intermediate tasks; S2023: arbitrate the target task from all the intermediate tasks according to the static weights corresponding to all the intermediate tasks.

5. The user arbitration system for a GPU according to claim 4, It is characterized in that The static weights corresponding to the N(k) tasks are updated in a sequential cycle.

6. The user arbitration system for a GPU according to claim 4, It is characterized in that Step S203 also includes the following steps: S2031, updating the dynamic weight corresponding to the target task to zero.

7. The user arbitration system for a GPU according to claim 6, It is characterized in that Step S203 also includes the following steps: S2031, if the dynamic weights corresponding to the other intermediate tasks except the target task are the initial values, maintaining the dynamic weights corresponding to the other intermediate tasks except the target task; S2032: If the dynamic weights corresponding to the other intermediate tasks except the target task are smaller than the initial value, the dynamic weights corresponding to the other intermediate tasks except the target task are increased by one respectively.

8. The user arbitration system for a GPU according to claim 1, It is characterized in that The system also includes a user set A = {a 1 , a 2 , …, a m , …, a M }, where a m is the mth user in the user set A, the user set A includes M users, m and k are both integers in the range of [1, M], a m Corresponds to b m , b m is the user information corresponding to the mth user in A, where the user information includes the priority of the corresponding user; When the computer program is executed by a processor, the following steps are also implemented: S301, determining initial values ​​of reference weights corresponding to the M users respectively according to a preset total weight C and user information corresponding to the M users respectively; S302, at the jth time point, according to the request states of the M users at the jth time point, and the reference weights and priorities corresponding to the M users at the jth time point, the temporary user a is obtained by arbitration. k , j is a positive integer.

Citation Information

Patent Citations

  • Bus arbitration method and bus arbitration apparatus

    CN101510181A

  • Reliability demand-based arbitration method in network on chip

    CN102394829A

  • Method and equipment for managing tasks

    CN103353851A

  • Configurable multi-priority scheduling method

    CN105376177A

  • Weighted polling arbiter and polling arbitration method and chip thereof

    CN115080474A