Computing task processing method and device, storage medium and electronic equipment

By splitting computational tasks into workgroup subtasks and creating new thread processor instances, the problem of low processing efficiency of GPU computational tasks is solved, achieving faster computation speed and higher efficiency.

CN121501430APending Publication Date: 2026-02-10MOORE THREADS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511332404.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-17
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In existing technologies, GPU computing tasks are inefficient because threads wait for idle threads, resulting in long execution times and failing to effectively meet the exponentially growing functional and performance demands.

Method used

By splitting computational tasks into multiple workgroup subtasks, and utilizing the threads in the workgroup processor thread pool to satisfy the new thread creation strategy, new threads with workgroup processor instances are created, subtasks are distributed, and processing results are merged, thereby improving computational efficiency.

Benefits of technology

It shortens the runtime of computing tasks, improves the processing speed and efficiency of computing tasks, and meets the growing demand for functionality and performance in GPU design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121501430A_ABST
    Figure CN121501430A_ABST
Patent Text Reader

Abstract

The invention relates to a computing task processing method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining a target working group subtask, determining that a thread in a working group processor thread pool meets a preset new thread creation strategy, and creating a new thread with a working group processor instance, the target working group subtask is one of a plurality of working group subtasks obtained by splitting a target calculation task; distributing the target working group subtask to the new thread with the working group processor instance, and obtaining a calculation processing result of executing the target working group subtask by the new thread according to the working group processor instance; and determining calculation processing results of all the working group subtasks corresponding to the obtained target calculation task, and merging the calculation processing results of all the working group subtasks to obtain a calculation processing result of the target calculation task. The calculation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of semiconductor and integrated circuit technology, and more particularly to a computing task processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] With the development of Artificial Intelligence (AI) technology, Graphics Processing Units (GPUs), as core hardware for AI, need to meet increasingly demanding functionalities, such as exponentially growing computing power. Therefore, it is necessary to pre-evaluate the exponentially increasing capabilities and performance of GPUs to serve as a reference for subsequent GPU design, thereby meeting these growing functional and performance requirements and effectively avoiding corresponding design flaws. In related technologies, software developers typically utilize Electronic System Level (ESL) modeling techniques to build software modeling platforms. Through environmental simulation, they pre-evaluate the GPU's capabilities and performance based on computational tasks, and design the GPU according to the evaluation results. Simultaneously, the simulation environment in the pre-evaluation provides software developers with an early development platform for the GPU, promoting parallel development across multiple departments and accelerating the GPU design process. ESL modeling typically employs C++ frameworks such as SystemC, breaking down computational tasks into multiple sub-tasks, allocating threads to transfer these sub-tasks, and utilizing pre-configured GPU processors to simulate the GPU's hardware functions, obtaining parameters or metrics as a reference for design and optimization. However, when a new computational subtask needs to be computed, and all threads currently used to transfer the computational subtask are running, this method needs to wait for an idle thread to transfer the new computational subtask, resulting in a longer runtime and lower computational efficiency. Summary of the Invention

[0003] In view of the above, this disclosure provides a computing task processing method, apparatus, storage medium, and electronic device.

[0004] Specifically, this disclosure is achieved through the following technical solution:

[0005] According to a first aspect of this disclosure, a computational task processing method is provided, the computational task processing method comprising:

[0006] Obtain the target workgroup subtask, determine if the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy, and create a new thread with a workgroup processor instance. The target workgroup subtask is one of multiple workgroup subtasks obtained by splitting the target computing task.

[0007] The target workgroup subtask is distributed to the new thread with the workgroup processor instance, and the calculation result of the target workgroup subtask is obtained by the new thread based on the workgroup processor instance.

[0008] The calculation results of all working group subtasks corresponding to the target calculation task are obtained, and the calculation results of all working group subtasks are merged to obtain the calculation result of the target calculation task.

[0009] In one possible implementation, determining that the threads in the workgroup processor thread pool satisfy a pre-set new thread creation strategy includes:

[0010] In response to the absence of idle threads in the workgroup processor thread pool, the number of currently occupied threads is obtained;

[0011] If the number of currently occupied threads does not reach the pre-set upper limit threshold for the number of threads, it is determined that the new thread creation strategy is satisfied.

[0012] In one possible implementation, the method further includes:

[0013] The monitoring thread in the workgroup processor thread pool calls a scheduled task to determine the status of other threads in the workgroup processor thread pool besides the monitoring thread. The status includes occupied and idle. In response to the status of other threads being occupied, it is determined that there are no idle threads.

[0014] In one possible implementation, determining the state of threads other than the monitoring thread in the workgroup processor thread pool includes:

[0015] In response to obtaining the first status identifier of the idle thread sub-pool and the second status identifier of the occupied thread sub-pool in the workgroup processor thread pool, the status of other threads in the workgroup processor thread pool other than the monitoring thread is determined based on the first status identifier and the second status identifier.

[0016] In one possible implementation, the method further includes:

[0017] The monitoring thread monitors the runtime of all occupied threads in the workgroup processor thread pool. In response to the detection that the runtime of the target thread exceeds the preset thread-safe runtime, the target thread is destroyed, and an idle thread is selected from the workgroup processor thread pool to handle the workgroup subtask that the target thread failed to handle. The target thread is any one of all occupied threads in the workgroup processor thread pool.

[0018] In one possible implementation, the method further includes:

[0019] Using a thread flag set in global memory for updating thread status, in response to accessing the thread flag corresponding to the global memory, the status of all threads in the workgroup processor thread pool is obtained, including occupied and idle. In response to all threads being occupied, it is determined that there are no idle threads.

[0020] In one possible implementation, determining that the threads in the workgroup processor thread pool satisfy a pre-set new thread creation strategy includes:

[0021] In response to the fact that the number of idle threads in the workgroup processor thread pool is less than the number of workgroup subtasks corresponding to the target computing task, the number of currently occupied threads is obtained;

[0022] In response to the fact that the number of threads currently occupied in the workgroup processor thread pool has not reached the upper limit threshold of the number of threads, it is determined that the new thread creation strategy is satisfied.

[0023] In one possible implementation, the method further includes:

[0024] It was determined that the threads in the workgroup processor thread pool did not meet the pre-set new thread creation policy.

[0025] In response to the presence of idle threads in the workgroup processor thread pool and the number of idle threads exceeding a preset idle thread threshold, the idle threads with workgroup processor instances are destroyed until the number of idle threads does not exceed the idle thread threshold.

[0026] In one possible implementation, the task of obtaining the target workgroup subtask includes:

[0027] Obtain the target computing task and determine the operating system kernel-related information of the operating system kernel used to run the target computing task;

[0028] Based on the operating system kernel information and the pre-set workgroup subtask size threshold, the target computing task is divided into multiple workgroup subtasks;

[0029] Select the target workgroup subtask from the multiple workgroup subtasks obtained from the splitting.

[0030] In one possible implementation, obtaining the computational processing result of the new thread executing the target workgroup subtask based on the workgroup processor instance includes:

[0031] In response to a new thread resource scheduling request, the available computing resource units contained in the graphics processing unit corresponding to the workgroup processor thread pool are obtained, and the available computing resource units for processing the target workgroup subtasks are allocated to the new thread in a time-division multiplexing manner, wherein the graphics processing unit contains multiple computing resource units;

[0032] In response to the computation processing request, the available computing resource unit allocated to the new thread is invoked to execute the target workgroup subtask based on the workgroup processor instance, and the computation processing result is obtained.

[0033] In one possible implementation, the merging of the computation results of all workgroup subtasks includes:

[0034] Obtain the workgroup subtask sequence number carried in each calculation result, and merge the calculation results corresponding to the workgroup subtask sequence number in order.

[0035] The computational task processing method in this technical solution involves obtaining a target workgroup subtask, determining that the threads in the workgroup processor thread pool meet a pre-set new thread creation strategy, and creating a new thread with a workgroup processor instance. The target workgroup subtask is one of multiple workgroup subtasks obtained by splitting a target computational task. The target workgroup subtask is then distributed to the new thread with the workgroup processor instance, and the computational processing result of the new thread executing the target workgroup subtask according to the workgroup processor instance is obtained. Finally, the computational processing results of all workgroup subtasks corresponding to the target computational task are determined and merged to obtain the computational processing result of the target computational task. In this method, by splitting the target computational task into multiple workgroup subtasks, and determining that the threads in the workgroup processor thread pool meet the new thread creation strategy, a new thread with a workgroup processor instance is created. This allows the workgroup subtasks to be distributed to the new thread, which then executes the workgroup subtask using the workgroup processor instance. This eliminates the need to wait for idle threads to process the workgroup subtask, thereby improving the processing speed of the target computational task, effectively shortening the execution time of the target computational task, and improving computational efficiency.

[0036] According to a second aspect of this disclosure, a computing task processing apparatus is provided, the computing task processing apparatus comprising:

[0037] The new thread creation module is used to obtain the target workgroup subtask, determine whether the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy, and create a new thread with a workgroup processor instance. The target workgroup subtask is one of multiple workgroup subtasks obtained by splitting the target computing task.

[0038] An instance creation module is used to distribute the target workgroup subtask to the new thread with a workgroup processor instance, and obtain the calculation results of the target workgroup subtask executed by the new thread according to the workgroup processor instance;

[0039] The calculation result acquisition module is used to determine the calculation processing results of all working group subtasks corresponding to the target calculation task, merge the calculation processing results of all working group subtasks, and obtain the calculation processing result of the target calculation task.

[0040] According to a third aspect of this disclosure, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the steps of the computational task processing method in any possible implementation of the first aspect.

[0041] According to a fourth aspect of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the computational task processing method in any possible implementation of the first aspect.

[0042] According to a fifth aspect of this disclosure, a computer program product is provided, comprising computer-readable code or a non-volatile computer-readable storage medium carrying the computer-readable code, characterized in that, when the computer-readable code is run in an electronic device, the processor in the electronic device executes the program to implement the steps of the computational task processing method in any possible implementation of the first aspect. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0044] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0045] Figure 1 A flowchart illustrating a computing task processing method provided in an embodiment of this disclosure;

[0046] Figure 2 This is a schematic diagram of the architecture simulator according to an embodiment of the present disclosure;

[0047] Figure 3 This is a schematic diagram of a GPU CORE simulation model according to an embodiment of the present disclosure;

[0048] Figure 4 This is another schematic flowchart of a computing task processing method provided in an embodiment of the present disclosure;

[0049] Figure 5 This is a schematic diagram of a computing task processing device provided in an embodiment of the present disclosure;

[0050] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0052] Terminology Explanation:

[0053] Kernel: refers to the program that runs in a single computing task, including kernel information and related status information.

[0054] WorkGroup: A Kernel contains multiple WorkGroups, which are subsets of the Kernel.

[0055] Firmware (FW).

[0056] Electronic System Level (ESL) modeling uses a high-level programming language, offering flexible modeling and rapid iteration. It can realize models at different levels of abstraction and can be applied to various fields.

[0057] PCIe (PCI-Express, Peripheral Component Interconnect Express) is a high-speed serial computer expansion bus standard.

[0058] In related technologies, ESL modeling is used to pre-evaluate the functions and performance of GPUs through environmental simulation and computational tasks. The calculation is performed using pre-set GPU processors to simulate the hardware functions of the GPU. Since the number of pre-set GPU processors is limited and there is a correspondence between threads and GPU processors, when a new computational subtask needs to be calculated, and all current threads are running, it is necessary to wait for an idle thread to execute the computational subtask, which makes the running time of completing the computational task long and the efficiency low.

[0059] In the early stages of GPU design, software modeling is crucial for verifying GPU functionality and performance. The verification process not only allows for the preliminary evaluation of the GPU's potential functions and performance, but also provides software developers with an early development platform through a simulation environment. This facilitates parallel development across multiple departments, accelerates the GPU development process, and ensures that the developed GPU meets functional and performance requirements. Therefore, effectively shortening the time required to verify GPU functionality and performance based on computational tasks, thereby improving verification and computational efficiency, is of great significance for improving GPU design development efficiency and reducing the GPU design development cycle.

[0060] This disclosure proposes a multi-threaded computing task processing method based on computing subtasks. By utilizing multi-threading and GPU processor instances, the processing speed of computing tasks can be improved, thereby shortening the running time of completing computing tasks and thus improving the computing efficiency of computing tasks.

[0061] See Figure 1 This disclosure provides a computing task processing method, which may include the following steps: S101, S102 and S103.

[0062] In step S101, the target workgroup subtask is obtained, and it is determined that the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy. A new thread with a workgroup processor instance is created. The target workgroup subtask is one of multiple workgroup subtasks obtained by splitting the target computing task.

[0063] In this embodiment of the disclosure, during the GPU development process, software developers pre-evaluate the functionality and performance of the GPU by providing an architecture simulator based on a simulation environment, i.e., a software model platform. Figure 2 This is a schematic diagram of the architecture simulator according to an embodiment of the present disclosure, such as... Figure 2As shown, the simulation environment (not shown in the figure) is packaged using Docker or other environment packaging tools. Within this simulation environment, a driver for the architecture emulator is configured. By starting the architecture emulator, the driver is injected into it to simulate GPU computing tasks. As an optional embodiment, the architecture emulator includes, but is not limited to, a simulated operating system and a virtual machine (VM). The simulated operating system is a guest operating system (GuestOS) used by software developers for simulation operations. The virtual machine is a GPU device used for simulation in the simulation environment, including but not limited to: a GPU firmware (GPU FW) simulation model, a GPU core (GPUCORE) simulation model, and a GPU memory (GPU Memory) simulation model. The software is connected to the GPU FW simulation model via a Peripheral Component Interconnect Express (PCIE) bus. As an optional embodiment, software developers submit the address of the target computing task to the GPU FW simulation model of the virtual machine through a simulated operating system, store the target computing task data in the GPU Memory simulation model, and the GPU CORE simulation model of the virtual machine obtains the corresponding address from the GPU FW simulation model based on the received target computing task identifier, obtains the corresponding data from the GPU Memory simulation model based on the address, performs calculation processing on the obtained data, and obtains the calculation result.

[0064] Figure 3 This is a schematic diagram of a GPU CORE simulation model according to an embodiment of this disclosure. Figure 3 As shown, the GPU CORE simulation model includes, but is not limited to: a computation task decoder, a dispatcher, a workgroup processor thread pool, and a result submitter, wherein the computation task decoder, dispatcher, workgroup processor thread pool, and result submitter constitute the computation task processing unit.

[0065] In this embodiment of the disclosure, as an optional embodiment, determining that the threads in the workgroup processor thread pool satisfy a pre-set new thread creation strategy includes:

[0066] In response to the absence of idle threads in the workgroup processor thread pool, the number of currently occupied threads is obtained;

[0067] If the number of currently occupied threads does not reach the pre-set upper limit threshold for the number of threads, it is determined that the new thread creation strategy is satisfied.

[0068] In this embodiment of the disclosure, as an optional embodiment, the new thread creation strategy includes, but is not limited to: no idle threads in the workgroup processor thread pool, and the number of currently occupied threads in the workgroup processor thread pool has not reached a preset thread count limit threshold. Thus, based on the obtained number of idle threads in the workgroup processor thread pool, the number of currently occupied threads, and the thread count limit threshold, it can be determined whether the threads in the workgroup processor thread pool meet the new thread creation strategy, and if the new thread creation strategy is met, the method of this embodiment of the disclosure is executed.

[0069] In this embodiment of the disclosure, as an optional implementation, one thread in the workgroup processor thread pool can be used as a monitoring thread to monitor the running status of other threads in the workgroup processor thread pool through a pre-set scheduled task, such as a task monitoring instance. Therefore, the method further includes:

[0070] The monitoring thread in the workgroup processor thread pool calls a scheduled task to determine the status of other threads in the workgroup processor thread pool besides the monitoring thread. The status includes occupied and idle. In response to the status of other threads being occupied, it is determined that there are no idle threads.

[0071] In this embodiment of the disclosure, the monitoring thread is used to monitor the thread state, which can be obtained in a timely manner.

[0072] In this embodiment, not every occupied thread is in a normal operating state. Therefore, to avoid resource consumption caused by abnormal threads in abnormal operating states, as another optional embodiment, a monitoring thread can be used to monitor the runtime of all occupied threads in the workgroup processor thread pool. In response to the detection that the runtime of a target thread exceeds a preset thread-safe runtime, the target thread is destroyed, and an idle thread is selected from the workgroup processor thread pool to handle the workgroup subtask that the target thread failed to process. The target thread is any one of all occupied threads in the workgroup processor thread pool. Thus, when an abnormal thread exists, destroying it—that is, deleting it from the workgroup processor thread pool—and releasing the resources occupied by the workgroup processor instance held by the abnormal thread can improve resource utilization efficiency.

[0073] In this embodiment of the disclosure, the state of a thread can also be obtained through other types of methods. As another optional embodiment, determining the state of other threads in the workgroup processor thread pool besides the monitoring thread includes:

[0074] In response to obtaining the first status identifier of the idle thread sub-pool and the second status identifier of the occupied thread sub-pool in the workgroup processor thread pool, the status of other threads in the workgroup processor thread pool other than the monitoring thread is determined based on the first status identifier and the second status identifier.

[0075] In this embodiment, an idle thread sub-pool and an occupied thread sub-pool are set up in the workgroup processor thread pool. The idle thread sub-pool is used to place idle threads, and the occupied thread sub-pool is used to place occupied threads. When the idle thread sub-pool has no idle threads, its status is set to empty. When the number of occupied threads in the occupied thread sub-pool reaches the thread count limit threshold, its status is set to full. For example, in response to the first status being empty, it is determined that there are no idle threads; in response to the second status being full, it is determined that the status of other threads is occupied. In this way, the status of other threads in the workgroup processor thread pool other than the monitoring thread can be determined based on the first status of the idle thread sub-pool and the second status of the occupied thread sub-pool. This allows the status of other threads in the workgroup processor thread pool other than the monitoring thread to be determined by only obtaining the status of the two thread sub-pools, resulting in a fast response.

[0076] In this embodiment, obtaining the thread state through other methods can also be achieved, for example, by using the active thread mask function `__activemask()` to obtain the mask of the currently active thread, thereby determining whether the thread is occupied or idle. Another example is obtaining the thread state based on atomic operations to mark the state. Alternatively, by setting a thread flag in global memory for thread state updates, the state of all threads in the workgroup processor thread pool can be obtained in response to accessing the corresponding thread flag in that global memory. The state includes occupied and idle; if all threads are occupied, it is determined that there are no idle threads. This embodiment does not limit this approach.

[0077] In this disclosure, as an optional embodiment, the method further includes:

[0078] If it is determined that there are no idle threads in the workgroup processor thread pool and the number of currently occupied threads has reached the preset thread limit threshold, the current thread is exited, and a preset time slice is waited for the workgroup subtask executed by the workgroup processor instance corresponding to the current thread to be redistributed to the current thread.

[0079] In this embodiment of the disclosure, after the number of currently occupied threads reaches the upper limit threshold of the number of threads, the current thread is exited to release the computing resources of the corresponding workgroup processor instance, thereby reducing the risk of congestion that may occur during the computing process. After waiting for a time slice, the workgroup processor thread pool will reassign the workgroup subtasks that have exited the current thread but have not been completed to the current thread.

[0080] In this embodiment of the disclosure, as another optional embodiment, the method further includes:

[0081] If it is determined that there are idle threads in the workgroup processor thread pool, select one of the idle threads and distribute the workgroup subtask to the selected idle thread.

[0082] In this embodiment of the disclosure, if there are idle threads in the workgroup processor thread pool, an idle thread is selected to process the workgroup subtask. As an optional embodiment, a thread that meets the required computing resource size can be selected based on the computing resource size required by the workgroup subtask.

[0083] In this embodiment of the disclosure, when there are many idle threads in the workgroup processor thread pool, these idle threads, each with a workgroup processor instance, will consume a significant amount of computing resources. Therefore, as another optional embodiment, the method further includes:

[0084] It was determined that the threads in the workgroup processor thread pool did not meet the pre-set new thread creation policy.

[0085] In response to the presence of idle threads in the workgroup processor thread pool and the number of idle threads exceeding a preset idle thread threshold, the idle threads with workgroup processor instances are destroyed until the number of idle threads does not exceed the idle thread threshold.

[0086] In this embodiment, to effectively utilize computing resources and improve their utilization efficiency, an appropriate number of idle threads can be retained in the workgroup processor thread pool. By destroying the idle threads with workgroup processor instances (excluding the appropriate number of idle threads), the resources occupied by these idle threads are released. This satisfies the expansion of computing tasks to a certain extent while reducing the amount of computing resources used. As an optional embodiment, the idle thread threshold can be set according to actual needs, for example, it can be set to 3, 5, or other values.

[0087] In this embodiment of the disclosure, as an optional embodiment, obtaining the target workgroup subtask includes the following steps: A11, A12 and A13.

[0088] A11, Obtain the target computing task and determine the operating system kernel-related information for running the operating system kernel used to run the target computing task.

[0089] In this embodiment of the disclosure, the operating system kernel is the program that runs a computing task. As an optional embodiment, the operating system kernel-related information includes, but is not limited to, kernel information and related status information. The kernel information includes, but is not limited to, the code of the target computing task, the size of the target computing task, etc., and the related status information includes, but is not limited to, the memory configuration required for computing and other necessary conditions for completing the target computing task.

[0090] A12, based on the operating system kernel information and the pre-set workgroup subtask size threshold, the target computing task is split into multiple workgroup subtasks.

[0091] In this embodiment, after determining that the dynamic environment data corresponding to the workgroup processor thread pool meets the relevant state information, the kernel is split according to the workgroup subtask size threshold to obtain one or more workgroup subtasks, and the WorkGroup subtasks are sequentially distributed to the WorkGroup processor thread pool. The workgroup subtask size threshold can be determined based on the processing capability of the GPU CORE simulation model and the acceptable processing time for the computation task. For example, given a fixed processing capability of the GPU CORE simulation model, the shorter the required processing time, the smaller the set workgroup subtask size threshold.

[0092] In this embodiment, since the architecture simulator uses a Single Instruction Multiple Thread (SIMT) / Single Instruction Multiple Data (SIMD) programming model, when processing a target computation task, the architecture simulator decomposes the target computation task into multiple subsets, namely multiple WorkGroup subtasks. Correspondingly, based on virtual machine technology, the GPU workgroup thread pool can configure corresponding threads and WorkGroup processor instances according to the divided subtasks.

[0093] A13, Select the target workgroup subtask from the multiple workgroup subtasks obtained from the split.

[0094] In this embodiment, after the WorkGroup processor thread pool selects the target workgroup subtask, it performs the necessary configuration for computation to process the target workgroup subtask. As an optional embodiment, the target workgroup subtask can be selected based on the priority of each workgroup subtask, or it can be selected based on the response time of each workgroup subtask; this embodiment does not limit the selection in this way.

[0095] S102. Distribute the target workgroup subtask to the new thread with the workgroup processor instance, and obtain the calculation result of the new thread executing the target workgroup subtask according to the workgroup processor instance;

[0096] In this embodiment, the WorkGroup processor thread pool distributes the selected target WorkGroup subtask to a new thread with a WorkGroup processor instance. The new thread performs calculations on the WorkGroup subtask based on the WorkGroup processor instance. After the WorkGroup processor instance completes the calculation and processing of the WorkGroup subtask and obtains the calculation result, the calculation result is returned to the WorkGroup processor thread pool through the new thread.

[0097] In this embodiment of the disclosure, the WorkGroup processor thread pool is a thread pool, and each thread has an instance of a WorkGroup processor, that is, a WorkGroup processor instance. The WorkGroup processor thread pool detects the idle and busy status of all threads and sends the selected WorkGroup subtasks to the corresponding idle thread with a WorkGroup processor instance to perform computation processing.

[0098] In this embodiment of the disclosure, as an optional embodiment, obtaining the computational processing result of the new thread executing the target workgroup subtask based on the workgroup processor instance includes:

[0099] In response to a new thread resource scheduling request, the available computing resource units contained in the graphics processing unit corresponding to the workgroup processor thread pool are obtained, and the available computing resource units for processing the target workgroup subtasks are allocated to the new thread in a time-division multiplexing manner, wherein the graphics processing unit contains multiple computing resource units;

[0100] In response to the computation processing request, the available computing resource unit allocated to the new thread is invoked to execute the target workgroup subtask based on the workgroup processor instance, and the computation processing result is obtained.

[0101] In this embodiment of the disclosure, by sending a new thread resource scheduling request, available computing resource units are obtained for the thread with a WorkGroup processor instance corresponding to the selected WorkGroup subtask. The workgroup processor thread pool requests available computing resource units from the graphics processing unit, and the graphics processing unit allocates available computing resource units for the new thread to process the target workgroup subtask in a time-division multiplexing manner.

[0102] In related technologies, a method simulating the hardware functionality of a GPU for computational tasks using a software model of transaction transfer involves processing computational subtasks through WorkGroup processors. Therefore, when threads used for transaction transfer in the software model are running, they must wait for the WorkGroup processors to finish processing the computational subtasks before being released and becoming idle, before resuming transaction transfer and computation. Since WorkGroup processors are hardware, the number of configured WorkGroup processors is limited. For architecture simulators with a preset number of WorkGroup processors, time-sharing multiplexing of WorkGroup processors is only possible according to pre-set rules. For example, if a kernel (computation task) is divided into 10 WorkGroup subtasks, and the maximum number of threads is set to 5, and the pre-set number of WorkGroup processors is 2, then for the first received WorkGroup subtask, one thread can be allocated for transaction (the first WorkGroup subtask) transmission and computation, and the first WorkGroup processor can be called for processing. For the second received WorkGroup subtask, another thread can be allocated for transaction (the second WorkGroup subtask) transmission and computation, and the second WorkGroup processor can be called for processing. When the third WorkGroup subtask is received, since the first and second WorkGroup processors are already running, even if a third thread is allocated, there will be no idle WorkGroup processors available for processing. Therefore, the 10 WorkGroup subtasks can only complete the computation by time-division multiplexing the first and second WorkGroup processors. This is equivalent to the two WorkGroup processors needing to execute 5 rounds each to complete the computation, resulting in a long computation time.

[0103] In this embodiment of the disclosure, in the SIMT / SIMD architecture, the computation task decoder splits the Kernel. The resulting WorkGroup subtasks are independent of each other and do not have direct memory exchange relationships. Therefore, by creating WorkGroup processor instances represented by programmatic code and associating them with the created threads, and since the WorkGroup processor instance is generated based on the WorkGroup processor (e.g., the functionality implemented by the WorkGroup processor), the computational processing function of the WorkGroup processor can be implemented based on the WorkGroup processor instance. This is based on the fact that each thread has a WorkGroup processor instance and the relationships between each WorkGroup subtask... Because of their independent nature, when the number of currently occupied threads has not reached the pre-set thread limit threshold, a new thread can be created and a WorkGroup processor instance can be created for the new thread. Thus, for the newly received WorkGroup subtask, the thread can be allocated for transaction (WorkGroup subtask) transmission and computation, and the WorkGroup processor instance created for the new thread can be called to perform computation processing. In this way, for the above-mentioned thread limit threshold of 5, 2 WorkGroup processors can be time-division multiplexed to form 5 computing resource units, which can be configured to complete the computation processing of the computing task by 5 WorkGroup processor instances. This is equivalent to completing the computation processing of the computing task in only 2 rounds.

[0104] In this embodiment of the disclosure, since creating new threads and GPU processor instances in real time requires a certain amount of time, as an optional embodiment, to avoid the overall processing time of the computing task being extended due to real-time creation, after distributing the workgroup subtask to the new thread with the workgroup processor instance, the method further includes:

[0105] In response to the situation where the number of idle threads in the workgroup processor thread pool is less than the idle thread count threshold and the total number of threads has not reached the pre-set thread count limit threshold, a new thread with a workgroup processor instance is created.

[0106] In this embodiment of the disclosure, the threshold for the number of idle threads can be set according to actual needs. As an optional embodiment, it can be set to 1, 2 or other values. For example, when it is set to 1, it indicates that after the workgroup subtask is distributed to a new thread, there are no idle threads in the workgroup processor thread pool. Therefore, before receiving a new workgroup subtask, the creation of a new thread and the corresponding GPU processor instance can effectively shorten the waiting time. When it is set to 2, it ensures that there is always an idle thread in the workgroup processor thread pool. Although it requires a certain amount of computing resources, after receiving the workgroup subtask, an idle thread can be directly allocated for processing, thereby improving computing efficiency.

[0107] S103. Determine that the calculation processing results of all working group subtasks corresponding to the target calculation task have been obtained, and merge the calculation processing results of all working group subtasks to obtain the calculation processing result of the target calculation task.

[0108] In this embodiment, each WorkGroup processor instance performs calculations on its corresponding workgroup subtasks, obtains the calculation results, and returns the results to the WorkGroup processor thread pool. The WorkGroup processor thread pool aggregates, sorts, and concatenates the calculation results to obtain the calculation result of the target calculation task. As an optional embodiment, the calculation results of all workgroup subtasks are merged, including:

[0109] Obtain the workgroup subtask sequence number carried in each calculation result, and merge the calculation results corresponding to the workgroup subtask sequence number in order.

[0110] In this embodiment of the disclosure, the calculation results corresponding to the workgroup subtask sequence numbers can be merged sequentially according to the workgroup subtask sequence numbers carried in each calculation result, either in ascending order or descending order.

[0111] In this disclosure, as an optional embodiment, the method further includes:

[0112] In response to obtaining the computational processing result of the target computational task, the development and design of the graphics processing unit used for the target computational task are adjusted.

[0113] In this embodiment of the disclosure, the computational processing results are used as a reference for GPU development and design.

[0114] Figure 4 This is another schematic flowchart illustrating a computational task processing method provided in an embodiment of this disclosure. Figure 4 As shown, it may include the following steps:

[0115] S401, The distributor enters a waiting state;

[0116] In this embodiment of the disclosure, after the dispatcher has dispatched a WorkGroup subtask, if all WorkGroup subtasks of the target computation task have been dispatched, it enters a waiting state.

[0117] S402, Receive the target computation task;

[0118] In this embodiment of the disclosure, upon receiving the target computing task, the required operating system kernel-related information is determined based on the target computing task, including but not limited to: the code of the target computing task, the size of the target computing task, the memory configuration required for computing, and other necessary conditions for completing the target computing task. After receiving the kernel, the dispatcher releases its waiting state.

[0119] S403. Divide the target calculation task into multiple WorkGroup subtasks;

[0120] In this embodiment of the disclosure, splitting the data facilitates computational processing using multiple threads.

[0121] S404. Send a WorkGroup subtask to the WorkGroup processor thread pool;

[0122] In this embodiment of the disclosure, the dispatcher interacts with the WorkGroup processor thread pool using interface functions, and as an optional embodiment, sequentially sends the multiple WorkGroup subtasks obtained from the splitting.

[0123] In this embodiment of the disclosure, as an optional embodiment, the above steps are performed on the distributor side.

[0124] S405, WorkGroup processor thread pool is waiting for interface function calls;

[0125] In this embodiment of the disclosure, the WorkGroup processor thread pool determines that a WorkGroup subtask has been sent based on the setting information in the interface function, and makes an interface function call to receive the WorkGroup subtask.

[0126] S406. Upon receiving the WorkGroup subtask, determine if there is an idle thread. If yes, proceed to step S407; otherwise, proceed to step S408.

[0127] In this embodiment of the disclosure, as an optional embodiment, the monitoring thread calls a timed task to determine the status of other threads in the WorkGroup processor thread pool besides the monitoring thread, and the status includes occupied and idle.

[0128] In this embodiment of the disclosure, as another optional embodiment, the monitoring thread can also be used to monitor the runtime of all occupied threads. If the runtime of the target thread exceeds the preset thread-safe runtime, it indicates that the target thread may be abnormal. In order not to affect the normal processing of the computing task, the target thread is destroyed, and an idle thread is selected from the WorkGroup processor thread pool to handle the WorkGroup subtask that the target thread failed to handle. Thus, the thread can be adjusted according to the preset abnormal operation handling rules to handle the abnormality in a timely manner.

[0129] S407. Distribute the WorkGroup subtasks to idle threads and execute step S411;

[0130] In this embodiment of the disclosure, when there is an idle thread, an idle thread with a workgroup processor instance is directly selected.

[0131] S408. Determine whether the number of occupied threads has reached the upper limit threshold of the number of threads. If yes, proceed to step S409; otherwise, proceed to step S410.

[0132] In this embodiment of the disclosure, if there are no idle threads, the number of running threads is counted to determine whether the thread count upper limit threshold has been reached. As an optional embodiment, the thread count upper limit threshold can be determined based on the platform processing capability of the running architecture simulator.

[0133] S409. After executing the yield process, return to step S406.

[0134] In this embodiment of the disclosure, the Yield process refers to freeing up the current thread and waiting for a time slice to be reassigned to the current thread.

[0135] S410. Create a new thread with a workgroup processor instance, and proceed to step S407.

[0136] In this embodiment of the disclosure, a thread with a WorkGroup processor instance is created for the received WorkGroup subtask.

[0137] S411. Execute the WorkGroup subtask, and execute steps S412 and S415 respectively;

[0138] In this embodiment of the disclosure, after executing the WorkGroup subtask, step S415 is executed, and after executing the WorkGroup subtask and obtaining the calculation result, step S412 is executed.

[0139] S412. Submit the calculation results to the result cache of the WorkGroup processor thread pool;

[0140] In this embodiment of the disclosure, after the WorkGroup processor instance obtains the calculation result, it submits the calculation result through a thread.

[0141] S413. Determine whether all WorkGroup subtasks have been completed. If yes, proceed to step S414; otherwise, proceed to step S405.

[0142] In this embodiment of the disclosure, if all WorkGroup subtasks included in the target computing task have been executed, the computing result of the target computing task can be obtained based on the computing result of each WorkGroup subtask.

[0143] S414. Submit the cached results through the result submitter of the WorkGroup processor thread pool;

[0144] In this embodiment of the disclosure, the calculation results of each WorkGroup subtask in the cache are sorted and concatenated according to the order of the workgroup subtask sequence number to obtain the calculation result of the target calculation task and submit it.

[0145] S415. Return information to the dispatcher that the WorkGroup subtask has been started;

[0146] In this embodiment of the disclosure, after the WorkGroup subtask is run, it sends feedback information to the dispatcher so that the dispatcher can send the next WorkGroup subtask.

[0147] S416. The dispatcher determines whether it has received information that all WorkGroup subtasks have been started. If yes, proceed to step S401; otherwise, proceed to step S404.

[0148] In this embodiment of the disclosure, the distributor enters a waiting state after sending all WorkGroup subtasks of the target computing task.

[0149] The computing task processing method of this disclosure splits the target computing task into multiple workgroup subtasks. After determining that the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy, a new thread with a workgroup processor instance is created. This effectively expands the number of WorkGroup processor instances used to process computing tasks, thereby enabling the computing processing of the split workgroup subtasks to be executed based on the expanded new thread with a workgroup processor instance, which greatly improves the processing speed of computing tasks.

[0150] Based on the same inventive concept, such as Figure 5 As shown in the embodiments of this disclosure, a computing task processing apparatus is also provided, the apparatus comprising:

[0151] The new thread creation module 501 is used to obtain the target workgroup subtask, determine that the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy, and create a new thread with a workgroup processor instance. The target workgroup subtask is one of multiple workgroup subtasks obtained by splitting the target computing task.

[0152] In this embodiment of the disclosure, as an optional embodiment, the new thread creation module 501 includes:

[0153] The first response unit (not shown in the figure) obtains the number of currently occupied threads in response to the absence of idle threads in the workgroup processor thread pool.

[0154] The second response unit determines that the new thread creation strategy is satisfied when the number of currently occupied threads does not reach the preset thread number limit threshold.

[0155] In this embodiment of the disclosure, as an optional embodiment, the second response unit is further configured to: obtain the number of currently occupied threads in response to the number of idle threads in the workgroup processor thread pool being less than the number of workgroup subtasks corresponding to the target computing task; and determine that the new thread creation strategy is satisfied in response to the number of currently occupied threads in the workgroup processor thread pool not reaching the upper limit threshold of the number of threads.

[0156] In this embodiment of the disclosure, as an optional embodiment, the new thread creation module 501 further includes:

[0157] The computing task acquisition unit is used to acquire the target computing task and determine the operating system kernel-related information of the operating system kernel used to run the target computing task.

[0158] The splitting unit is used to split the target computing task into multiple workgroup subtasks based on the operating system kernel-related information and a pre-set workgroup subtask size threshold;

[0159] The subtask acquisition unit is used to select the target workgroup subtask from the multiple workgroup subtasks obtained from the splitting.

[0160] In this embodiment of the disclosure, as another optional embodiment, the new thread creation module 501 further includes:

[0161] The status monitoring unit is used to call a timed task using the monitoring thread in the workgroup processor thread pool to determine the status of other threads in the workgroup processor thread pool besides the monitoring thread. The status includes running status and idle status. In response to the status of other threads being occupied, it is determined that there are no idle threads.

[0162] In this embodiment of the disclosure, as an optional embodiment, determining the state of threads other than the monitoring thread in the workgroup processor thread pool includes:

[0163] In response to obtaining the first status identifier of the idle thread sub-pool and the second status identifier of the occupied thread sub-pool in the workgroup processor thread pool, the status of other threads in the workgroup processor thread pool other than the monitoring thread is determined based on the first status identifier and the second status identifier.

[0164] In this embodiment of the disclosure, as another optional embodiment, the new thread creation module 501 further includes:

[0165] The duration monitoring unit is used to monitor the runtime of all occupied threads in the workgroup processor thread pool using the monitoring thread. In response to the detection that the runtime of the target thread exceeds the preset thread-safe runtime, the target thread is destroyed, and an idle thread is selected from the workgroup processor thread pool to handle the workgroup subtask that the target thread failed to handle.

[0166] In this embodiment of the disclosure, as another optional embodiment, the new thread creation module 501 further includes:

[0167] The new thread creation unit creates a new thread with a workgroup processor instance in response to the absence of idle threads in the workgroup processor thread pool and the fact that the number of currently occupied threads has not reached the pre-set upper limit threshold for the number of threads.

[0168] In this embodiment of the disclosure, as an optional embodiment, the new thread creation unit is further configured to:

[0169] In response to the absence of idle threads in the workgroup processor thread pool and the current number of occupied threads reaching a preset thread limit threshold, the current thread is exited, a preset time slice is waited, and the workgroup subtask executed by the workgroup processor instance corresponding to the current thread is redistributed to the current thread.

[0170] In this embodiment of the disclosure, as another optional embodiment, the new thread creation unit is further configured to:

[0171] It was determined that the threads in the workgroup processor thread pool did not meet the pre-set new thread creation policy.

[0172] In response to the presence of idle threads in the workgroup processor thread pool and the number of idle threads exceeding a pre-set idle thread threshold, the idle threads with workgroup processor instances are destroyed until the number of idle threads does not exceed the idle thread threshold.

[0173] In this embodiment of the disclosure, as another optional embodiment, the new thread creation unit is further configured to:

[0174] In response to the availability of idle threads in the workgroup processor thread pool, an idle thread is selected from the pool, and the workgroup subtask is distributed to the selected idle thread.

[0175] The instance creation module 502 is used to distribute the target workgroup subtask to the new thread with the workgroup processor instance, and obtain the calculation results of the new thread executing the target workgroup subtask according to the workgroup processor instance;

[0176] In this embodiment, the WorkGroup processor thread pool distributes the selected WorkGroup subtasks to new threads. The new threads then invoke the WorkGroup processor instance to perform calculations on the WorkGroup subtasks. After the WorkGroup processor instance completes the calculation and processing of the WorkGroup subtasks and obtains the calculation result, it returns the result to the WorkGroup processor thread pool through the new thread.

[0177] In this embodiment of the disclosure, as an optional embodiment, the instance creation module 502 includes:

[0178] A distribution unit is configured to distribute the target workgroup subtask to the new thread having a workgroup processor instance;

[0179] The scheduling request unit, in response to a new thread resource scheduling request, obtains the available computing resource units contained in the graphics processing unit corresponding to the workgroup processor thread pool, and allocates the available computing resource units for processing the target workgroup subtasks to the new thread in a time-division multiplexing manner, wherein the graphics processing unit contains multiple computing resource units;

[0180] The result acquisition unit, in response to the computation processing request, calls the available computation resource unit allocated to the new thread, executes the target workgroup subtask according to the workgroup processor instance, and obtains the computation processing result.

[0181] In this embodiment of the disclosure, after the instance creation module 502 distributes the workgroup subtask to a new thread with a workgroup processor instance, it is further configured to:

[0182] In response to the situation where the number of idle threads in the workgroup processor thread pool is less than the idle thread count threshold and the total number of threads has not reached the pre-set thread count limit threshold, a new thread with a workgroup processor instance is created.

[0183] The calculation result acquisition module 503 is used to determine the calculation processing results of all working group subtasks corresponding to the target calculation task, merge the calculation processing results of all working group subtasks, and obtain the calculation processing result of the target calculation task.

[0184] In this embodiment of the disclosure, each WorkGroup processor instance performs calculation processing on the corresponding workgroup subtask, obtains the calculation processing results, and returns the calculation processing results to the WorkGroup processor thread pool. The WorkGroup processor thread pool summarizes, sorts, and concatenates the calculation processing results to obtain the calculation processing result of the target calculation task.

[0185] In this embodiment of the disclosure, as an optional embodiment, the calculation result acquisition module 503 includes:

[0186] The processing completion confirmation unit is used to determine the processing results of all workgroup subtasks corresponding to the target computing task.

[0187] The result merging unit is used to obtain the workgroup subtask sequence number carried in each calculation result, and merge the calculation results corresponding to the workgroup subtask sequence number according to the order of the workgroup subtask sequence number.

[0188] In this embodiment of the disclosure, as an optional embodiment, the device further includes:

[0189] The result feedback module (not shown in the figure) adjusts the development and design of the graphics processing unit used for the target computing task in response to obtaining the computing results of the target computing task.

[0190] Based on the same inventive concept, this disclosure also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the computational task processing method in any of the above possible implementations.

[0191] Alternatively, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0192] Based on the same inventive concept, this disclosure also proposes a computer program including computer-readable code, wherein when the computer-readable code is run in an electronic device, the processor in the electronic device executes the above-described method.

[0193] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in an electronic device, the processor in the electronic device executes the above-described method.

[0194] Based on the same inventive concept, see [link to inventive concept] Figure 6This disclosure also provides an electronic device, including a memory 101 (e.g., non-volatile memory), a processor 102, and a computer program stored on the memory 101 and executable on the processor 102. When the processor 102 executes the program, it implements the steps of the computational task processing method in any of the above possible implementations, which can be equivalent to the aforementioned computational task processing device. Of course, the processor can also be used to process other data or perform calculations. This electronic device can be a PC, server, terminal, or other similar device.

[0195] like Figure 6 As shown, the electronic device may also include: memory 103, network interface 104, and internal bus 105. In addition to these components, other hardware may also be included, which will not be described in detail here.

[0196] It should be noted that the above-mentioned computing task processing device can be implemented by software. As a device in a logical sense, it is formed by the processor 102 of the electronic device in which it is located reading the computer program instructions stored in the non-volatile memory into the memory 103 for execution.

[0197] The embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.

[0198] The processing and logic flow described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logic flow can also be executed by special-purpose logic circuitry—such as FPGAs (Field-Programmable Gate Arrays) or ASICs (Application-Specific Integrated Circuits), and the device can also be implemented as special-purpose logic circuitry.

[0199] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.

[0200] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.

[0201] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily used to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.

[0202] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the decomposition of various system modules and components in the above embodiments should not be construed as requiring such decomposition in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

[0203] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.

[0204] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0205] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for processing computational tasks, characterized in that, include: Obtain the target workgroup subtask, determine if the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy, and create a new thread with a workgroup processor instance. The target workgroup subtask is one of multiple workgroup subtasks obtained by splitting the target computing task. The target workgroup subtask is distributed to the new thread with the workgroup processor instance, and the calculation result of the target workgroup subtask is obtained by the new thread based on the workgroup processor instance. The calculation results of all working group subtasks corresponding to the target calculation task are obtained, and the calculation results of all working group subtasks are merged to obtain the calculation result of the target calculation task.

2. The computational task processing method according to claim 1, characterized in that, The process of determining whether the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy includes: In response to the absence of idle threads in the workgroup processor thread pool, the number of currently occupied threads is obtained; If the number of currently occupied threads does not reach the pre-set upper limit threshold for the number of threads, it is determined that the new thread creation strategy is satisfied.

3. The computational task processing method according to claim 2, characterized in that, The method further includes: The monitoring thread in the workgroup processor thread pool calls a scheduled task to determine the status of other threads in the workgroup processor thread pool besides the monitoring thread. The status includes occupied and idle. In response to the status of other threads being occupied, it is determined that there are no idle threads.

4. The computational task processing method according to claim 3, characterized in that, Determining the state of threads other than the monitoring thread in the workgroup processor thread pool includes: In response to obtaining the first status identifier of the idle thread sub-pool and the second status identifier of the occupied thread sub-pool in the workgroup processor thread pool, the status of other threads in the workgroup processor thread pool other than the monitoring thread is determined based on the first status identifier and the second status identifier.

5. The computational task processing method according to claim 3, characterized in that, The method further includes: The monitoring thread monitors the runtime of all occupied threads in the workgroup processor thread pool. In response to the detection that the runtime of the target thread exceeds the preset thread-safe runtime, the target thread is destroyed, and an idle thread is selected from the workgroup processor thread pool to handle the workgroup subtask that the target thread failed to handle. The target thread is any one of all occupied threads in the workgroup processor thread pool.

6. The computational task processing method according to claim 2, characterized in that, The method further includes: Using a thread flag set in global memory for updating thread status, in response to accessing the thread flag corresponding to the global memory, the status of all threads in the workgroup processor thread pool is obtained, including occupied and idle. In response to all threads being occupied, it is determined that there are no idle threads.

7. The computational task processing method according to claim 2, characterized in that, The step of determining whether the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy includes: In response to the fact that the number of idle threads in the workgroup processor thread pool is less than the number of workgroup subtasks corresponding to the target computing task, the number of currently occupied threads is obtained; In response to the fact that the number of threads currently occupied in the workgroup processor thread pool has not reached the upper limit threshold of the number of threads, it is determined that the new thread creation strategy is satisfied.

8. The computational task processing method according to any one of claims 1 to 7, characterized in that, The method further includes: It was determined that the threads in the workgroup processor thread pool did not meet the pre-set new thread creation policy. In response to the presence of idle threads in the workgroup processor thread pool and the number of idle threads exceeding a preset idle thread threshold, the idle threads with workgroup processor instances are destroyed until the number of idle threads does not exceed the idle thread threshold.

9. The computational task processing method according to any one of claims 1 to 7, characterized in that, The subtask of obtaining the target workgroup includes: Obtain the target computing task and determine the operating system kernel-related information of the operating system kernel used to run the target computing task; Based on the operating system kernel information and the pre-set workgroup subtask size threshold, the target computing task is divided into multiple workgroup subtasks; Select the target workgroup subtask from the multiple workgroup subtasks obtained from the splitting.

10. The computational task processing method according to any one of claims 1 to 7, characterized in that, The step of obtaining the computational processing result of the new thread executing the target workgroup subtask based on the workgroup processor instance includes: In response to a new thread resource scheduling request, the available computing resource units contained in the graphics processing unit corresponding to the workgroup processor thread pool are obtained, and the available computing resource units for processing the target workgroup subtasks are allocated to the new thread in a time-division multiplexing manner, wherein the graphics processing unit contains multiple computing resource units; In response to the computation processing request, the available computing resource unit allocated to the new thread is invoked to execute the target workgroup subtask based on the workgroup processor instance, and the computation processing result is obtained.

11. The computational task processing method according to any one of claims 1 to 7, characterized in that, The merging of calculation results for all workgroup subtasks includes: Obtain the workgroup subtask sequence number carried in each calculation result, and merge the calculation results corresponding to the workgroup subtask sequence number in order.

12. A computing task processing device, characterized in that, The computing task processing device includes: The new thread creation module is used to obtain the target workgroup subtask, determine whether the threads in the workgroup processor thread pool meet the pre-set new thread creation strategy, and create a new thread with a workgroup processor instance. The target workgroup subtask is one of multiple workgroup subtasks obtained by splitting the target computing task. An instance creation module is used to distribute the target workgroup subtask to the new thread with a workgroup processor instance, and obtain the calculation results of the target workgroup subtask executed by the new thread according to the workgroup processor instance; The calculation result acquisition module is used to determine the calculation processing results of all working group subtasks corresponding to the target calculation task, merge the calculation processing results of all working group subtasks, and obtain the calculation processing result of the target calculation task.

13. A storage medium, characterized in that, A program or instruction is stored on a storage medium, and the program or instruction is executed by a processor to implement the steps of the computing task processing method as described in any one of claims 1 to 11.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the computing task processing method according to any one of claims 1 to 11.

15. A computer program product comprising computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, characterized in that, When the computer-readable code is run in an electronic device, the processor in the electronic device performs the steps of the computing task processing method according to any one of claims 1 to 11.