A user arbitration system for GPU

By assigning reference weights to users of the GPU cloud service and conducting arbitration based on the total weight and priority, the problem of uneven resource usage in the GPU cloud service is solved and a more balanced resource allocation is achieved.

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

Patent Information

Application Number
CN202410874624.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-20
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

In the GPU cloud service scenario, the existing user arbitration method causes high-priority users to continue to occupy resources, resulting in uneven resource usage.

Method used

By assigning a reference weight to each user and arbitrating based on the total weight, priority and request status, the reference weight is updated to ensure a balanced allocation of resources.

Benefits of technology

It effectively improves the balance of user arbitration, prevents high-priority users from continuing to occupy resources, and ensures that all users can use the GPU chip evenly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118409870B
    Figure CN118409870B
Patent Text Reader

Abstract

The present application relates to the field of data processing technology, and in particular to a user arbitration system for a GPU. The system includes: a GPU chip, a user set, a processor, and a memory storing a computer program. When the computer program is executed by the processor, an initial value of a reference weight is allocated to each user according to a total weight and 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 a temporary user is obtained through arbitration, its reference weight is correspondingly updated, so that a user with a high priority cannot continuously occupy the GPU chip, thereby effectively improving the balance of user arbitration.
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 user arbitration system for a GPU. 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] Although GPU chips can provide services to multiple users, they usually do not provide services to multiple users at the same time. Instead, they provide services to different users in different time periods according to certain rules. The rules used to determine the users to be served in each time period are called user arbitration methods. Existing user arbitration methods usually assign different priorities to different users. Users with higher priorities can obtain the right to use first. However, if users with higher priorities continue to make requests, this user can be forced to occupy resources and other users cannot use them. Therefore, how to improve the balance of user 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 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. When the computer program is executed by the processor, the following steps are implemented:

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

[0007] S102, for a single call cycle of the GPU chip, at the i-th time point in 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, an arbitration is performed 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, and the initial value of i is 1.

[0008] S103: Update the reference weight corresponding to the temporary user.

[0009] S104, update i=i+1, return to execute steps S101 to S103, until i=C+1, and execute step S105.

[0010] S105, setting the reference weights corresponding to the M users to their corresponding initial values, setting i to 1, and returning to execute steps S102 to S104.

[0011] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solution, the user arbitration system for GPU 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:

[0012] 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 mis the user information corresponding to the mth user in A, the user information includes the priority of the corresponding user. When the computer program is executed by the processor, the following steps are implemented: S101, according to the preset total weight C and the user information corresponding to the M users, the initial values ​​of the reference weights corresponding to the M users are determined, and the sum of the M initial values ​​is equal to C; 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 corresponding to the M users at the i-th time point Weights and priorities are used to arbitrate the 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, and the initial value of i is 1; S103, the reference weight corresponding to the temporary user is updated; S104, i=i+1 is updated, and the execution of steps S101 to S103 is returned until i=C+1, and step S105 is executed; S105, the reference weights corresponding to the M users are set to their corresponding initial values, i is set to 1, and the execution of steps S102 to S104 is returned.

[0013] It can be seen that 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 high-priority users cannot continuously occupy the GPU chip, thereby effectively improving the balance of user arbitration. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] 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.

[0015] 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;

[0016] 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

[0017] 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.

[0018] 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:

[0019] 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;

[0020] 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;

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

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

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

[0024] 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.

[0025] 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.

[0026] 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.

[0027] 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.

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

[0029] 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:

[0030] 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.

[0031] 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.

[0032] 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.

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

[0034] Step S102 also includes the following steps:

[0035] 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.

[0036] 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.

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

[0038] 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.

[0039] 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.

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

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

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

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

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

[0045] 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.

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

[0047] 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;

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

[0049] 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.

[0050] 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 .

[0051] 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.

[0052] 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:

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

[0054] 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;

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

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

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

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

[0059] 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.

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

[0061] 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.

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

[0063] 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;

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

[0065] 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.

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

[0067] The sequential cycle method may refer to that the static weights corresponding to the N(k) tasks are maximized in turn in a sequential cycle manner.

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

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

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

[0071] 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;

[0072] 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.

[0073] Specifically, N(k)=3 is used as an example for explanation. There are tasks R1, R2 and R3. 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.

[0074] 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;

[0075] 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.

[0076] 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.

[0077] 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;

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

[0079] 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;

[0080] 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.

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

[0082] 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.

[0083] 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.

[0084] 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 user arbitration system for a GPU, characterized in that: The system includes: 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 the user set A, the user set A includes M users, m is an integer in the range [1, M], a m Corresponds to b m , b m is user information corresponding to the mth user in A, wherein the user information includes a priority of the corresponding user. When the computer program is executed by a processor, the following steps are implemented: 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, wherein the total weight C is the same as the number of time points included in a single call cycle of the GPU chip; 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 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 a time period corresponding to the i-th time point to the i+1-th time point, and the initial value of i is 1; Among them, the temporary user a k Corresponding to the task set E k , the task set includes N(k) tasks, and after the arbitration obtains the temporary user corresponding to the i-th time slice, the following steps are further performed: S201, assigning dynamic weights to N(k) tasks respectively, wherein the initial value corresponding to the dynamic weights is p=f[log2(N(k))]; S202, according to the dynamic weights corresponding to the N(k) tasks, arbitrating the target task from the N(k) tasks, the 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, determining the task as the target task; 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, arbitrating the target task from all the intermediate tasks according to the static weights corresponding to all the intermediate tasks respectively; S203, according to the dynamic weight corresponding to the target task, updating the dynamic weights corresponding to the N(k) tasks respectively, in step S203 further comprising 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 less than the initial value, the dynamic weights corresponding to the other intermediate tasks except the target task are increased by one respectively; S204, returning to execute steps S202 to S203; S103, updating the reference weight corresponding to the temporary user, wherein step S103 also includes the following steps: S1031, if the reference weight corresponding to the temporary user is zero, maintaining the reference weight corresponding to the temporary user; S104, update i=i+1, return to execute steps S101 to S103, until i=C+1, execute step S105; S105, setting the reference weights corresponding to the M users to their corresponding initial values, setting i to 1, and returning to execute steps S102 to S104.

2. The user arbitration system for a GPU according to claim 1, characterized in that: The user information also includes historical usage information; The determining the initial values ​​of the 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: 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.

3. The user arbitration system for a GPU according to claim 1, characterized in that: The request status includes a request status and a non-request status; Step S102 also includes the following steps: 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.

4. The user arbitration system for a GPU according to claim 3, characterized in that: Step S102 also includes the following steps: 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.

5. The user arbitration system for a GPU according to claim 1, characterized in that: Step S103 also includes the following steps: S1032: If the reference weight corresponding to the temporary user is not zero, subtract 1 from the reference weight corresponding to the temporary user.

6. The user arbitration system for a GPU according to claim 1, characterized in that: Step S105 also includes the following steps: 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, i is set to 1, and the process returns to step S102 to step S104; S1052, if the user information corresponding to any user is updated, i is set to 1, and the initial values ​​of the reference weights corresponding to the M users are determined according to the preset total weight C and the user information corresponding to the M users, and the process returns to step S102 to step S104.