Computing device, method for performing computing tasks in a computing device, computer-readable storage medium, and computer program product

By performing the task cycle segment of the nuclear program on the GPU, the task distribution and task formation of the task is performed in advance, and the long -tail effect brought by the execution of the nuclear program in the AI ​​application has improved, and the resource utilization rate and calculation efficiency are improved.

CN118689658BActive Publication Date: 2025-01-24北京壁仞科技开发有限公司 +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411170791.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-01-24
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

When executing artificial intelligence (AI) applications in graphics processors (GPUs), the lack of resources required by the core program leads to a serious long-tail effect in the execution of the core program, and the utilization rate of time resources and hardware resources is low.

Method used

Through sections of the entire task cycle of the nuclear program, the task of calculating tasks will be issued in advance and the task formation of the task to reduce the long -tail effect and improve the resource utilization rate. The specific method includes the task allocation and task setting stage of the second -core program immediately after performing the task allocation phase of the first nuclear program, and start the part of the second nuclear program after the first nuclear program releases resources.

Benefits of technology

By performing mission distribution and task formation in advance, the long -tail effect is reduced, the utilization of time resources and hardware resources has been improved, and the calculation efficiency of AI applications on the GPU is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689658B_ABST
    Figure CN118689658B_ABST
Patent Text Reader

Abstract

The present disclosure provides a computing device, a method for allocating computing tasks in the computing device, a computer-readable storage medium, and a computer program product. The computing device includes: a task distributor, which is used to divide the work of a user into multiple computing tasks and issue them to a task assembler; and a task assembler, which is used to prepare resources for the computing tasks issued by the task distributor, wherein when using a continuous first core program and a second core program to perform continuous computing tasks, the task assembler is configured to: immediately execute the task distribution phase and the task assembly phase for the second core program after executing the task distribution phase for the first core program, wherein the task assembly phase for the second core program includes reserving the resources required for the operation of the second core program; and after the resources required for the operation of at least a part of the second core program are released by the first core program, start to run the at least part of the second core program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of processors, and more particularly, to a computing device, a method for performing computing tasks in a computing device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Currently, when executing artificial intelligence (AI) applications in a graphics processing unit (GPU), various computing tasks are performed through kernel programs. Since AI applications require the maximum use of computing device resources, due to the lack of resources required by kernel programs, a kernel program must be completed before the next kernel program can be issued and assembled, resulting in a serious long-tail effect caused by the execution of multiple kernel programs, and low utilization of time resources and hardware resources. Summary of the invention

[0003] In response to the above problems, the present disclosure provides a solution that divides the entire task cycle of the core program into segments to execute task distribution and task assembly of computing tasks in advance, thereby reducing the long tail effect and improving resource utilization.

[0004] According to one aspect of the present disclosure, a computing device is provided. The computing device includes: a task distributor, which is used to divide the user's work into multiple computing tasks and send them to a task assembler; and a task assembler, which is used to prepare resources for the computing tasks sent by the task distributor, wherein when using a continuous first core program and a second core program to perform continuous computing tasks, the task assembler is configured to: immediately execute the task allocation phase and the task assembly phase for the second core program after executing the task allocation phase for the first core program, wherein the task assembly phase for the second core program includes reserving the resources required for the operation of the second core program; and after the resources required for the operation of at least a part of the second core program are released by the first core program, start running the at least a part of the second core program.

[0005] In some implementations, the resources required for the execution of the second core program include local registers, shared memory, and computing unit task licenses of the computing device.

[0006] In some implementations, the task building phase for the second core program also includes complex resource descriptor prefetching, instruction prewarming, and task identifier allocation.

[0007] In some implementations, after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program includes: starting to run the second core program after the first core program finishes running and completes the resource release.

[0008] In some implementations, after resources required for at least a portion of the operation of the second core program are released by the first core program, starting to run the at least a portion of the second core program includes: during the task running phase of the first core program, continuously detecting whether the first core program has released resources; if it is detected that the first core program has released resources, determining whether currently available resources of the computing device meet the operation of at least a portion of the second core program; and if it is determined that the currently available resources of the computing device meet the operation of at least a portion of the computing task of the second core program, starting to run the at least a portion of the computing task of the second core program using the currently available resources of the computing device.

[0009] In some implementations, after the resources required for running at least a portion of the second core program are released by the first core program, starting to run the at least a portion of the second core program includes: dividing the computing tasks of the first core program and the second core program into corresponding at least two parts based on the programming models of the first core program and the second core program; and after the first part of the computing task of the first core program is completed and the resources are released, immediately using the currently available resources of the computing device to run the first part of the computing task of the second core program.

[0010] In some implementations, the task assembler is further configured to: execute the remaining portion of the computing task of the second core program after the computing task of the first core program is fully completed.

[0011] According to another aspect of the present invention, a method for allocating computing tasks in a computing device is provided. The method comprises: immediately executing a task allocation phase and a task formation phase for a second core program after executing a task allocation phase for a first core program, wherein the task formation phase for the second core program comprises reserving resources required for the operation of the second core program; and starting to operate at least a portion of the second core program after the resources required for the operation of at least a portion of the second core program are released by the first core program.

[0012] In some implementations, the resources required for the second core program to run include thread local registers and shared memory of the computing device.

[0013] In some implementations, the task building phase for the second core program also includes descriptor prefetching, instruction prewarming, and task identifier allocation.

[0014] In some implementations, after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program includes: starting to run the second core program after the first core program finishes running and completes the resource release.

[0015] In some implementations, after resources required for at least a portion of the operation of the second core program are released by the first core program, starting to run the at least a portion of the second core program includes: during the task running phase of the first core program, continuously detecting whether the first core program has released resources; if it is detected that the first core program has released resources, determining whether currently available resources of the computing device meet the operation of at least a portion of the second core program; and if it is determined that the currently available resources of the computing device meet the operation of at least a portion of the computing task of the second core program, starting to run the at least a portion of the computing task of the second core program using the currently available resources of the computing device.

[0016] In some implementations, after the resources required for running at least a portion of the second core program are released by the first core program, starting to run the at least a portion of the second core program includes: dividing the computing tasks of the first core program and the second core program into corresponding at least two parts based on the programming models of the first core program and the second core program; and after the first part of the computing task of the first core program is completed and the resources are released, immediately using the currently available resources of the computing device to run the first part of the computing task of the second core program.

[0017] In some implementations, the method further includes: executing the remaining portion of the computing task of the second core program after the computing task of the first core program is fully completed.

[0018] According to yet another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program code is stored. When the computer program code is executed, the method described above is executed.

[0019] According to yet another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program performs the method described above when executed by a machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The present disclosure will be better understood and other objects, details, features and advantages of the present disclosure will become more apparent through the description of specific embodiments of the present disclosure given with reference to the following drawings.

[0021] Figure 1 A schematic diagram of the structure of an exemplary computing device is shown.

[0022] Figure 2 A schematic diagram showing the running process of two consecutive kernel programs.

[0023] Figure 3 An exemplary flow chart of a method for executing a computing task in a computing device according to an embodiment of the present invention is shown.

[0024] Figure 4 A schematic diagram showing the running process of two consecutive kernel programs according to some embodiments of the present invention is shown.

[0025] Figure 5 A schematic diagram showing the running process of two consecutive kernel programs according to some other embodiments of the present invention is shown.

[0026] Figure 6 and Figure 7 Two exemplary flow charts of a process of executing at least a portion of a task running phase of a computing task of a second core program in advance according to different embodiments of the present invention are respectively shown. DETAILED DESCRIPTION

[0027] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0028] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "one embodiment" and "some embodiments" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects.

[0029] Figure 1 FIG. 1 shows a schematic diagram of the structure of an exemplary computing device 100. Figure 1 As shown in FIG. , the computing device 100 may include one or more task distributors 110 ( Figure 1Only one task distributor 110 is shown exemplarily in the figure, each task distributor 110 is used to divide a user's job into multiple computing tasks (task, such as thread group). The task distributor 110 sends one computing task to a task assembler 120 at a time. The task assembler 120 prepares resources for the computing tasks sent down so that one or more computing units 130 corresponding to it complete the computing task through parallel computing. In some instances, the computing device 100 may be an AI chip, a GPU (Graphic Processing Unit), a general purpose GPU (GPGPU), etc. The computing unit 130 may be a tensor computing unit for performing tensor calculations and / or a vector computing unit for performing vector calculations, etc.

[0030] In addition, each computing unit 130 also has one or more associated local registers 140 for use by threads running on the computing unit 110. In addition, multiple computing units 130 corresponding to a task builder 120 also have a shared memory 150 for these computing units 130 to exchange data.

[0031] In addition, the computing device 100 may further include a global memory 160 for exchanging data between the computing units 130 of all task schedulers 120. Compared with the local registers 140 and the shared memory 150, the global memory 160 is farther away from the computing unit 130 and has a narrower transmission bandwidth, so that the data transmission speed is slower.

[0032] Here, the local register 140, the shared memory 150, and the global memory 160 are all on-chip memories of the computing device 100, which can usually be implemented by static random access memory (SRAM). In addition, the computing device 100 may also have an associated off-chip memory (not shown in the figure), which can usually be implemented by dynamic random access memory (DRAM) or high bandwidth memory (HBM). Compared with the on-chip memory, the off-chip memory is farther away from the computing unit 130, has a narrower transmission bandwidth, and a slower data transmission speed.

[0033] The computing device 100 can perform various computing tasks through a kernel. For each computing task of a kernel, a complete task cycle includes a task dispatch phase, a task construct phase, a task running phase, and a resource release phase. In the task dispatch phase, the task dispatcher 110 can divide the work into multiple computing tasks and send the task descriptor to each task assembler 120. In the task construction phase, each task assembler 120 performs resource preparation for the corresponding computing task. For example, the task assembler 120 can obtain the task descriptor and determine the resources required for the computing task when it is executed by the corresponding computing unit 130 according to the task descriptor, such as the required local register 140, shared memory 150, computing unit task license, etc. Here, since the number of computing tasks that can be executed concurrently by each computing unit 130 is limited, the computing unit task license is used to indicate whether the currently available computing unit meets the execution needs of the computing task. In addition, during the task building phase, the task assembler 120 also performs instruction preheating and complex resource descriptor prefetching for the computing task, so as to prefetch complex resource descriptors, instructions, constants, etc. from the global memory 160 to the vicinity of the computing unit 130 (such as in the shared memory 150). In addition, during the task building phase, the task assembler 120 also assigns a task identifier (Task_ID) to the computing task.

[0034] In the task running phase, the computing device 100 completes the corresponding computing task by running the corresponding kernel program. In the resource release phase, the computing device 100 writes the data generated by the computing task execution into the shared memory 150, the global memory 160 or the off-chip memory (not shown in the figure) and releases the occupied resources.

[0035] Figure 2 FIG. 1 shows a schematic flow chart of the operation process of two consecutive kernel programs. Figure 2 As shown in , for the first core program 210, its complete task cycle includes the task distribution stage 212, the task assembly stage 214, the task running stage 216 and the resource release stage 218; similarly, for the next core program of the first core program 210, that is, the second core program 220, its complete task cycle includes the task distribution stage 222, the task assembly stage 224, the task running stage 226 and the resource release stage 228.

[0036] For AI applications, it is hoped that the execution of a computing task can occupy all resources of the computing device 100 to the maximum extent, so as to achieve the best performance. This means that only after the previous computing task is completely completed can the next computing task be issued and organized to avoid insufficient resources. Figure 2As shown in , the task distribution phase 222 of the second core program 220 can only start after the resource release phase 218 of the first core program 210 ends.

[0037] It can be seen that in this implementation, each kernel program needs to occupy a complete task cycle, and multiple consecutive kernel programs need to occupy multiple consecutive complete task cycles, resulting in a serious long-tail effect and low utilization of time resources and hardware resources of computing devices.

[0038] In view of the above problems, considering that the task distribution and task formation phase of the core program does not need to actually occupy the resources of the computing device 100, the task distribution and task formation phase of the core program can be performed in advance (before the previous core program is completed). According to the solution of the present invention, by segmenting the entire task cycle of the core program, task distribution and task formation are performed in advance for the computing tasks of the next core program during the operation of the previous core program, so as to reserve the required resources for the operation of the next core program in advance, thereby improving the utilization rate of time resources and hardware resources of the computing device.

[0039] In addition, in many cases, during the task running phase of the previous core program, as the computing tasks are executed, some resources will be released gradually. If the released resources can meet the needs of some computing tasks of the subsequent core program, then some computing tasks of the subsequent core program can be further executed in advance, thereby further improving the utilization of time resources and hardware resources of the computing equipment.

[0040] Figure 3 An exemplary flow chart of a method 300 for executing a computing task in a computing device 100 according to an embodiment of the present invention is shown. Figure 4 A schematic diagram showing the running process of two consecutive kernel programs according to some embodiments of the present invention is shown. Figure 5 A schematic diagram showing the running process of two consecutive kernel programs according to some other embodiments of the present invention is shown.

[0041] like Figure 3 As shown in FIG. 3 , in block 310 , after executing the task distribution phase 212 for the first core program 210 , the task distribution phase 222 and the task assembly phase 224 for the second core program 220 are immediately executed, as shown in FIG. Figure 4 and Figure 5Here, the task distribution stage 222 for the second core program 220 can be executed by the task distributor 110, and the task assembly stage 224 can be executed by the task assembler 120 that receives the computing task issued by the task distributor 110. The task distribution stage 222 includes the segmentation and issuance of the computing task, and the task assembly stage 224 includes the resources required for the operation of the second core program 220. As described above, the resources required for the operation of the second core program 220 may include, for example, the required local registers 140, shared memory 150, and computing unit task licenses. In some embodiments, in the task assembly stage 224, the task assembler 120 also performs instruction preheating and complex resource descriptor prefetching for the computing task.

[0042] That is, the task distribution phase 222 and the task assembly phase 224 of the second core program 220 can be separated from the task running phase 226, and the task assembler 120 can pre-allocate the required resources for the second core program 220 without waiting for the first core program 210 to be fully completed.

[0043] In block 320 , after resources required for at least a portion of the second core program 220 to run are released by the first core program 210 , the at least a portion of the second core program 220 starts to run.

[0044] Due to the characteristics of AI applications, each core program will occupy as many hardware resources as possible. Therefore, when the task assembly phase 224 of the second core program 220 is completed, the first core program 210 may not have been completed, and there may not be sufficient hardware resources to continue the task running phase 226 of the second core program 220. Therefore, it is necessary to wait until the required resources are met before continuing the task running phase 226 of the second core program 220.

[0045] In some embodiments, Figure 4 As shown in , the second core program 220 can be started after the first core program 210 is completely finished (ie, the resource release phase 218 is completed).

[0046] That is to say, the entire task cycle of the second core program 220 is divided into two sections. The first section is the task distribution stage 222 and the task assembly stage 224 of the computing task of the second core program 220, which are executed after the task distribution stage 212 of the first core program 210. The second section is the task running stage 226 (and the subsequent resource release stage 228) of the computing task of the second core program 220, which is executed after the first core program 210 is completely completed (that is, the resource release stage 218 is completed).

[0047] Furthermore, in the task running stage 216 of the computing task of the first core program 210, some resources may be released as the computing task is executed, and these resources may meet the needs of at least a part of the computing task of the second core program 220. Therefore, in other embodiments, at least a part of the task running stage 226 of the computing task of the second core program 220 may be advanced according to the resources released by the computing task of the first core program 210.

[0048] Figure 6 and Figure 7 Two exemplary flow charts of a process (block 320 ) of executing at least a portion of the task running phase 226 of the computing task of the second core program 220 in advance according to different embodiments of the present invention are respectively shown.

[0049] like Figure 6 As shown in , in box 322, the task assembler 120 can continuously detect whether the first core program 210 has released resources during the task running stage 216 of the first core program 210. As mentioned above, for some computing tasks, in the task running stage 216, the resources used by some computing tasks can be released after the completion of the tasks. For example, in the case where the computing task includes both tensor calculation and vector calculation, the tensor calculation unit in the multiple computing units 130 first performs tensor calculation, and then the vector calculation unit performs vector calculation on the result of the tensor calculation. In this case, after the tensor calculation is completed, the tensor calculation unit and the corresponding local register 140 and shared memory 150 will be released, and the released resources can be used for the tensor calculation part in the computing task of the second core program 220.

[0050] If it is detected in block 322 that the first core program 210 has released resources (such as Figure 5 2162 ), then in box 324 , the task assembler 120 can determine whether the current available resources of the computing device 100 meet the requirements for running at least a portion of the second core program 220 .

[0051] Here, the task assembler 120 pre-allocates the resources required for the computing tasks of the second core program 220 (such as which computing units 130, which local registers 140, and which shared memories 150 need to be occupied) in the task assembly stage 224 of the second core program 220. Therefore, when it is detected that the first core program 210 has released resources, the task assembler 120 can determine whether the currently available resources after the resource release meet at least a portion of the operation of the second core program 220 according to the resource allocation in the task assembly stage 224.

[0052] For example, Figure 5As shown in , when the task assembler 120 detects at label 2162 that the first core program 210 has released resources, the task assembler 120 may determine whether the current available resources of the computing device 100 meet the running of at least a part of the second core program 220 .

[0053] If it is determined in box 324 that the currently available resources of the computing device 100 meet the requirements for running at least a portion of the computing task of the second core program 220 , then in box 326 , the currently available resources of the computing device 100 are used to start running at least a portion of the computing task of the second core program 220 .

[0054] That is, the computing task of the second core program 220 can be divided into multiple parts, and the part can be executed in advance by detecting whether the currently available resources during the task running phase 216 of the computing task of the first core program 210 meet the needs of one of the parts.

[0055] For example, Figure 5 As shown in , the computing task of the second core program 220 is divided into a first part 220-1 and a second part 220-2. Accordingly, the task running stage 226 can be divided into a first task running stage 226-1 and a second task running stage 226-2 for the first part 220-1 and the second part 220-2, respectively. The first task running stage 226-1 can be started immediately when the task assembler 120 detects that the currently available resources meet the needs of the first part 220-1. If there is a remaining part ( Figure 5 The second part 220-2 in the figure) can be executed after the computing task of the first core program 210 is completely completed. Of course, the present invention is not limited to this. The computing task of the second core program 220 can be divided into more than two parts. In this case, the task assembler 120 can continue to execute the above blocks 322 to 326, that is, continue to detect whether the first core program 210 has released resources, and whether the current available resources after the resource release meet the needs of a part of the computing task of the second core program 220, and execute the part in advance when the needs are met.

[0056] On the other hand, if it is not detected in block 322 that the first core program 210 has released resources, or it is determined in block 324 that the currently available resources do not satisfy the operation of any part of the second core program 220 ( Figure 6 (not shown), the task assembler 120 may start the task running phase 226 of the computing task of the second core program 220 only after the computing task of the first core program 210 is completely completed, that is, similar to Figure 4 The situation shown in .

[0057] In some cases, the first core program 210 and the second core program 220 are used for the same or similar AI applications and are built based on the same programming model. In this case, there is a corresponding relationship between the computing tasks of the first core program 210 and the various parts of the computing tasks of the second core program 220, so the computing tasks of the first core program 210 and the computing tasks of the second core program 220 can be divided in advance according to the corresponding relationship.

[0058] Specifically, Figure 7 As shown in FIG. 3 , in block 322′, the computing tasks of the first core program 210 and the second core program 220 may be divided into corresponding at least two parts based on the programming models of the first core program 210 and the second core program 220. For example, the computing tasks of the first core program 210 may be divided into a first part and a second part (not shown in the figure), and the computing tasks of the second core program 220 may be correspondingly divided into a first part 220-1 and a second part 220-2 (as shown in FIG. 3 ). Figure 5 ).

[0059] In block 324 ′, after the first part of the computing task of the first core program 210 is completed and the resources are released, the first part 220 - 1 of the computing task of the second core program 220 is immediately executed using the currently available resources of the computing device 100 .

[0060] Similarly, when the computing task of the second core program 220 is divided into more than two parts, the task assembler 120 can continue to execute the above-mentioned box 324', that is, after the corresponding part of the computing task of the first core program 210 is completed and the resources are released, immediately use the current available resources of the computing device to run the corresponding part of the computing task of the second core program 220.

[0061] Afterwards, if there are still some remaining parts of the computing tasks of the second core program 220 that cannot be executed in advance (such as Figure 5 The second part 220-2 shown in FIG. 2 may be executed after the computing task of the first core program 210 is completely completed.

[0062] By using the solution of the present invention, by segmenting the entire task cycle of the computing task of the core program, task distribution and task assembly are performed in advance for the computing task of the core program during the operation of the previous core program, so as to reserve the required resources for the operation of the core program in advance, thereby improving the utilization rate of time resources and hardware resources of the computing device. In addition, in some solutions, the computing task can also be executed in segments to further improve the utilization rate of time resources and hardware resources of the computing device.

[0063] Those skilled in the art will appreciate that the computing device 100 shown in the figure is merely illustrative and may include more or fewer components.

[0064] The computing device 100 and the task component method 300 executed in the computing device 100 according to the present disclosure are described above in conjunction with the accompanying drawings. However, those skilled in the art will appreciate that the computing device 100 does not necessarily include all the components shown in the drawings, and may only include some or more components necessary to perform the functions described in the present disclosure, and the connection method of these components is not limited to the form shown in the drawings, and the method 200 may also include more steps not shown in the drawings.

[0065] The present invention may be implemented as a method, a computing device, a computer-readable storage medium and / or a computer program product. A computer-readable storage medium stores a computer program code, which is used to execute the method of the present disclosure when it is executed. The computer program product includes a computer program, which executes the method of the present disclosure when it is executed. The computing device and / or the computing device may include at least one processor and at least one memory coupled to the at least one processor, and the memory may store instructions for execution by the at least one processor. When the instruction is executed by the at least one processor, the computing device and / or the control device may execute the above method.

[0066] In one or more exemplary designs, the functions described in the present disclosure may be implemented using hardware, software, firmware, or any combination thereof. For example, if implemented using software, the functions may be stored as one or more instructions or codes on a computer-readable medium, or transmitted as one or more instructions or codes on a computer-readable medium.

[0067] Those skilled in the art should also understand that the various illustrative logical blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments of the present disclosure may be implemented as electronic hardware, computer software, or a combination of the two.

[0068] The above description of the present disclosure is intended to enable any person of ordinary skill in the art to implement or use the present disclosure. Various modifications of the present disclosure are obvious to those of ordinary skill in the art, and the general principles defined herein may also be applied to other variations without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the examples and designs described herein, but is consistent with the broadest scope of the principles and novel features disclosed herein.

Claims

1. A computing device, comprising: The task distributor is used to divide the user's work into multiple computing tasks and send them to the task assembler; as well as A task assembler is used to prepare resources for the computing tasks issued by the task distributor, wherein each computing task is executed by a core program, and the complete task cycle of the computing task of each core program includes a task distribution phase, a task assembly phase, a task running phase and a resource release phase, When the continuous first core program and the second core program are used to execute the continuous computing tasks, the task assembler is configured as follows: After executing the task distribution phase for the first core program, immediately executing the task distribution phase and the task assembly phase for the second core program, wherein the task assembly phase for the second core program includes reserving resources required for the operation of the second core program; as well as After resources required for at least a portion of the second core program to run are released by the first core program, the at least a portion of the second core program starts to run.

2. The computing device of claim 1, wherein the resources required for the second core program to run include local registers, shared memory, and computing unit task licenses of the computing device.

3. The computing device of claim 1, wherein the task building phase for the second core program further includes complex resource descriptor prefetching, instruction warm-up, and task identifier allocation.

4. The computing device of claim 1 , wherein after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program comprises: After the first core program finishes running and completes resource release, the second core program starts running.

5. The computing device of claim 1 , wherein after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program comprises: During the task running phase of the first core program, continuously detecting whether the first core program has released resources; If it is detected that the first core program has released resources, determining whether currently available resources of the computing device are sufficient for at least a portion of the operation of the second core program; as well as If it is determined that currently available resources of the computing device satisfy at least a portion of the computing task of the second core program, then the currently available resources of the computing device are used to start running at least a portion of the computing task of the second core program.

6. The computing device of claim 1 , wherein after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program comprises: Dividing the computing tasks of the first core program and the second core program into at least two corresponding parts respectively based on the programming models of the first core program and the second core program; as well as After the first part of the computing task of the first core program is completed and the resources are released, the first part of the computing task of the second core program is immediately executed using the currently available resources of the computing device.

7. The computing device of claim 5 or 6, wherein the task builder is further configured to: After the computing task of the first core program is completely completed, the remaining portion of the computing task of the second core program is executed.

8. A method for executing a computing task in a computing device, when executing the consecutive computing tasks using a consecutive first core program and a consecutive second core program, comprising: After executing the task distribution phase for the first core program, immediately executing the task distribution phase and the task assembly phase for the second core program, wherein the task assembly phase for the second core program includes reserving resources required for the operation of the second core program; as well as After resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program, The complete task cycle of the computing task of each core program includes the task distribution stage, the task formation stage, the task running stage and the resource release stage, and the task distribution stage is used to divide the user's work into multiple computing tasks and issue them.

9. The method of claim 8, wherein the resources required for the second core program to run include local registers, shared memory, and computing unit task licenses of the computing device.

10. The method of claim 8, wherein the task building phase for the second core program further comprises complex resource descriptor prefetching, instruction warm-up, and task identifier allocation.

11. The method of claim 8, wherein after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program comprises: After the first core program finishes running and completes resource release, the second core program starts running.

12. The method of claim 8, wherein after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program comprises: During the task running phase of the first core program, continuously detecting whether the first core program has released resources; If it is detected that the first core program has released resources, determining whether currently available resources of the computing device are sufficient for at least a portion of the operation of the second core program; as well as If it is determined that currently available resources of the computing device satisfy at least a portion of the computing task of the second core program, then the currently available resources of the computing device are used to start running at least a portion of the computing task of the second core program.

13. The method of claim 8, wherein after resources required for at least a portion of the second core program to run are released by the first core program, starting to run the at least a portion of the second core program comprises: Based on the programming models of the first core program and the second core program, the computing tasks of the first core program and the second core program are divided into at least two corresponding parts respectively; as well as After the first part of the computing task of the first core program is completed and the resources are released, the first part of the computing task of the second core program is immediately executed using the currently available resources of the computing device.

14. The method according to claim 12 or 13, further comprising: After the computing task of the first core program is completely completed, the remaining portion of the computing task of the second core program is executed.

15. A computer-readable storage medium having a computer program code stored thereon, wherein the computer program code executes the method according to any one of claims 8 to 14 when executed.

16. A computer program product, comprising a computer program, which, when executed by a machine, performs the method according to any one of claims 8 to 14.

Citation Information

Patent Citations

  • Resource allocation in a parallel processing system

    CN113342513A