Dynamic global thread beam reconstruction system and thread beam scheduling method and device
By establishing thread bundle pools in the GPGPU architecture and dynamically reconstructing thread bundles, the thread bundle imbalance and resource blocking problems caused by branch divergence are solved, and more efficient resource utilization and performance improvement are achieved.
Patent Information
- Application Number
- CN202510104493.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-02-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the GPGPU architecture, thread bundle imbalance and resource blockage caused by branch divergence affect the ability of streaming multiprocessors to hide memory access latency, thereby affecting the overall computing performance.
By establishing a thread bundle pool in a global grid, dynamically monitor and refactoring thread bundles, reorganize thread bundles with the same PC values according to execution requirements and resource availability, and assign them to stream multiprocessors for execution through a global scheduler.
It improves resource utilization, reduces performance losses caused by branch divergence, optimizes processing of different execution path lengths, and improves the overall performance of GPGPU applications.
Smart Images

Figure CN119536957A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of GPGPU technology, for example, to a dynamic global warp reconstruction system and a warp scheduling method and device based on the system. Background Art
[0002] GPGPU (General-purpose computing on graphics processing units, GPGPU for short) is a kind of general-purpose computing task that uses graphics processors that process graphics tasks to calculate general-purpose computing tasks that were originally handled by the central processing unit. These general-purpose calculations often have nothing to do with graphics processing. Due to the powerful parallel processing capabilities and programmable pipelines of modern graphics processors, stream processors can process non-graphics data. Especially in the face of single instruction stream multiple data streams (SIMD), when the amount of data processing is much greater than the need for data scheduling and transmission, general-purpose graphics processors greatly surpass traditional central processing unit applications in performance. GPGPU is a multi-core architecture that effectively handles memory and pipeline latency issues by using fine-grained multithreading. The threads of the application are organized into blocks, and the threads in different blocks do not share state, so they can be executed in parallel on independent stream multiprocessors, and these stream multiprocessors themselves do not interfere with each other. This design allows applications to fully utilize the parallel processing capabilities of GPGPU and improve overall computing efficiency. During execution, multiple blocks can be assigned to the same stream multiprocessor. Once a block is assigned, the resources it occupies will only be released after all threads in the block have been executed. This mechanism, if encountering significant differences in execution paths, may greatly affect the ability of the streaming multiprocessor to hide memory access latency. In particular, when many warps in the streaming multiprocessor have completed their tasks, while a few warps with long execution paths are still running, this will hinder resource reallocation, resulting in the streaming multiprocessor being unable to effectively mask the long latency of memory access.
[0003] In modern GPGPU architectures, the system assumes that there is no direct data contention between threads from different blocks. If threads do not involve the use of shared memory, thread synchronization is usually not required. Based on this, there is no direct data contention between threads in the entire application. Therefore, threads can be migrated between different streaming multiprocessors during the actual execution of the kernel.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0006] The disclosed embodiments provide a dynamic global warp reconstruction system and a warp scheduling method and device based on the system, aiming to optimize the execution efficiency of threads and improve the overall performance of GPGPU applications.
[0007] In some embodiments, the dynamic global thread warp reconstruction system includes: a thread warp pool and a global thread warp scheduler, the thread warp pool is used to collect threads diverged due to branch instructions and store and track the status of these threads, the global thread warp scheduler is connected to the thread warp pool, is used to monitor the status of the thread warp pool, and according to the current execution requirements and resource availability, reorganizes threads with the same PC value into new thread warps in the thread warp pool, and allocates the new thread warps to the streaming multiprocessor for execution.
[0008] Furthermore, the global warp scheduler assigns warps belonging to the same block to different streaming multiprocessors for execution.
[0009] Furthermore, the thread bundle pool includes a thread storage unit and a thread bundle dynamic management unit. The thread storage unit stores multiple threads, each thread contains a set of status information, and the thread bundle dynamic management unit is connected to the thread storage unit for dynamically managing the life cycle of the thread, including creating new thread bundles, scheduling existing thread bundles, and destroying thread bundles that have completed execution.
[0010] Furthermore, the global warp scheduler implements a load balancing strategy by continuously monitoring the execution status of the warp pool and warps.
[0011] Furthermore, the status information includes thread ID, PC value, register status, and execution status.
[0012] In some embodiments, the thread warp scheduling method is implemented based on the aforementioned dynamic global thread warp reconstruction system, and includes the following steps: S01, system startup and task allocation. After the system is powered on, the application is divided into multiple logical blocks. Each block generates multiple thread bundles. Each thread bundle consists of multiple threads for executing instruction streams. The CPU sends the tasks that need to be processed in parallel to the GPGPU and notifies the GPGPU to prepare for execution. S02, the thread bundle pool is initialized. The thread bundle pool completes the basic configuration of the thread storage unit according to the hardware parameters predefined by the system. At the same time, the thread bundle dynamic management unit loads the hardware logic of the dynamic thread bundle reconstruction and manages the status information in the thread storage unit; S03, local thread bundle scheduling, the local thread bundle scheduler of the stream multiprocessor polls the thread bundles to be processed in the thread bundle queue, and assigns them to the operation unit for execution, while monitoring the execution status of the thread bundle. If branch divergence occurs during the thread execution, the branch thread with the larger Next_PC value is selected from the two branch paths, and is moved out of the stream multiprocessor to which it belongs, and is placed in the global thread bundle pool, ready for reconstruction; S04, global thread warp scheduling and reconstruction, whenever a thread warp in the stream multiprocessor is executed or transferred to the global thread warp pool, its position is taken over by another thread warp in the global scheduler, and the global thread warp scheduler selects threads from the thread warp pool, including threads from the thread warp diverged from the current branch and other threads with the same PC value, to form a new complete thread warp; S05. Load balancing and thread migration. The global scheduler evaluates the load of each stream multiprocessor and migrates the thread bundles from the overloaded stream multiprocessor to the idle stream multiprocessor through the thread migration function to achieve load balancing.
[0013] Furthermore, in step S04, the thread warps that have completed reconstruction have the highest scheduling priority, followed by the newly formed thread warps.
[0014] Furthermore, if a complete warp is missing, the incomplete warp with the lowest PC value will be selected.
[0015] Furthermore, step S06 includes synchronization barrier processing. When a thread warp reaches the synchronization barrier, it is recalled from the streaming multiprocessor and replaced by a prepared thread warp. After all thread warps in the block touch the synchronization barrier, they are rescheduled back to the streaming multiprocessor to continue executing subsequent tasks. After the task is completed, the results are collected and returned to the CPU.
[0016] In some embodiments, the thread warp scheduling apparatus includes a processor and a memory storing program instructions, and the processor is configured to execute the aforementioned thread warp scheduling method when running the program instructions.
[0017] The dynamic global thread bundle reconstruction system and the thread bundle scheduling method and device based on the system provided by the embodiments of the present disclosure can achieve the following technical effects: The present invention reduces the impact of branch divergence on performance by establishing a thread bundle pool containing diverged threads in the global grid. Subsequently, the global thread scheduler will reorganize new thread bundles from this thread pool and schedule them for execution. This method helps to improve resource utilization and reduce performance losses caused by branch divergence. In order to improve the processing of different execution path lengths and reduce the dependence on the distribution of branch targets in the grid, through this mechanism, we aim to optimize the execution efficiency of threads and improve the overall performance of GPGPU applications.
[0018] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments, and in which: Figure 1 It is a block diagram of the principle of the dynamic global warp reconstruction system; Figure 2 This is the principle block diagram of the thread bundle pool; Figure 3 is a flowchart of a warp scheduling method; Figure 4 It is a principle block diagram of a thread warp scheduling device. DETAILED DESCRIPTION
[0020] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0021] The terms "first", "second", etc. in the embodiments of the present disclosure are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0022] Unless otherwise stated, the term "plurality" means two or more.
[0023] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0024] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0025] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0026] Example 1 In modern GPGPU architectures, the system assumes that there is no direct data contention between threads from different blocks. If the threads do not involve the use of shared memory, thread synchronization is usually not required. Based on this, there is no direct data contention between threads in the entire application. Therefore, threads can be migrated between different stream multiprocessors during the actual execution of the kernel.
[0027] Based on this, this embodiment provides a dynamic global thread warp reconstruction system, which reduces the impact of branch divergence on performance by establishing a pool of diverged threads in the global grid. Subsequently, the global thread scheduler reorganizes new thread warps from this thread pool and schedules them for execution. This method helps to improve resource utilization and reduce performance losses caused by branch divergence. In order to improve the handling of different execution path lengths and reduce the dependence on the distribution of branch targets in the grid, through this mechanism, we aim to optimize the execution efficiency of threads and improve the overall performance of GPGPU applications.
[0028] Specifically as described in 1, the system described in this embodiment includes a thread bundle pool and a global thread bundle scheduler. The thread bundle pool is used to collect threads diverged due to branch instructions and dynamically store and track the status of these threads. The global thread bundle scheduler is connected to the thread bundle pool and is used to monitor the status of the thread bundle pool. According to the current execution requirements and resource availability, threads with the same PC value in the thread bundle pool are reorganized into new thread bundles, and the new thread bundles are assigned to the stream multiprocessor for execution. In this way, it can be ensured that the execution unit is always active, the idle cycle is reduced, and resources are used more efficiently.
[0029] This embodiment designs the function of migrating threads across streaming multiprocessors, allowing warps belonging to the same block to be assigned to different streaming multiprocessors by a global scheduler. In specific implementation, the global thread warp scheduler assigns thread warps belonging to the same block to different streaming multiprocessors for execution. For cores that cannot perform thread migration due to the use of local shared memory, or when migrating threads will have negative effects, the global reconstruction function can be easily disabled. This flexibility enables the provision of optimal scheduling strategies in different execution environments.
[0030] like Figure 2 As shown, the thread bundle pool includes a thread storage unit and a thread bundle dynamic management unit. The thread storage unit stores N threads. Each thread contains a set of status information. The status information includes thread identification, PC value, register status, and execution status. The thread bundle dynamic management unit is connected to the thread storage unit and is used to dynamically manage the life cycle of the thread, including creating new thread bundles, scheduling existing thread bundles, and destroying thread bundles that have completed execution.
[0031] In this embodiment, the global warp scheduler implements a load balancing strategy by continuously monitoring the warp pool and the execution status of the warps, ensuring that the workload of all streaming multiprocessor cores is evenly distributed to avoid overloading some cores while other cores are idle.
[0032] Example 2 This embodiment discloses a thread warp scheduling method, which is implemented based on the dynamic global thread warp reconstruction system described in Embodiment 1. Figure 3 As shown, the following steps are included: S01, system startup and task allocation, after the system is powered on, the application is divided into multiple logical blocks, each block generates multiple thread bundles, each thread bundle consists of 32 threads, which are used to execute the same instruction stream, the CPU sends the tasks that need to be processed in parallel to the GPGPU, and notifies the GPGPU to prepare for execution. In other embodiments, the number of threads in each thread bundle is variable.
[0033] S02: Initialize the thread bundle pool. The thread bundle pool completes the basic configuration of the thread storage unit according to the predefined hardware parameters of the system, including size, depth, etc. At the same time, the thread bundle dynamic management unit loads the hardware logic of dynamic thread bundle reconstruction and manages the status information in the thread storage unit, such as thread identification, program counter (PC) value, execution ready status, etc.
[0034] S03. Local thread bundle scheduling. The local thread bundle scheduler of the streaming multiprocessor polls the thread bundles to be processed in the thread bundle queue and assigns them to the operation units for execution. At the same time, it monitors the execution status of the thread bundles. If branch divergence occurs during the thread execution, the branch thread with the larger Next_PC value is selected from the two branch paths and moved out of the streaming multiprocessor to which it belongs, and placed in the global thread bundle pool to prepare for reconstruction.
[0035] S04. Global thread bundle scheduling and reconstruction. Whenever a thread bundle in a stream multiprocessor is executed or transferred to the global thread bundle pool, its position is taken by another thread bundle in the global scheduler. The global thread bundle scheduler selects threads from the thread bundle pool, including threads from the thread bundle diverging from the current branch and other threads with the same PC value, to form a new complete thread bundle. The highest scheduling priority is the thread bundle that has been completely reconstructed, followed by the newly formed thread bundle. If a complete thread bundle is missing, the incomplete thread bundle with the lowest PC value will be selected to ensure that subsequent branches can be effectively processed by the global scheduler. This dynamic scheduling strategy improves the utilization of the stream processor and optimizes the overall performance of the program.
[0036] S05. Load balancing and thread migration. The global scheduler evaluates the load of each stream multiprocessor and migrates the thread bundles from the overloaded stream multiprocessor to the idle stream multiprocessor through the thread migration function to achieve load balancing.
[0037] S06, synchronization barrier processing, when the thread warp reaches the synchronization barrier, it is recalled from the streaming multiprocessor and replaced by the prepared thread warp; after all the thread warps in the block touch the synchronization barrier, they are rescheduled back to the streaming multiprocessor to continue executing subsequent tasks. After the task is completed, the results are collected and returned to the CPU.
[0038] Example 3 Combination Figure 4 As shown, the embodiment of the present disclosure provides a thread warp scheduling device 300, including a processor 304 and a memory 301. Optionally, the device may also include a communication interface 302 and a bus 303. The processor 304, the communication interface 302, and the memory 301 may communicate with each other through the bus 303. The communication interface 302 may be used for information transmission. The processor 304 may call the logic instructions in the memory 301 to execute a thread warp scheduling method.
[0039] In addition, the logic instructions in the memory 301 described above can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0040] The memory 301 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 304 executes the functional application and data processing by running the program instructions / modules stored in the memory 301, thereby implementing the above-mentioned thread warp scheduling method.
[0041] The memory 301 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 301 may include a high-speed random access memory and may also include a non-volatile memory.
[0042] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute a warp scheduling method.
[0043] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0044] The thread warp scheduling method described in this embodiment includes: S01, system startup and task allocation, after the system is powered on, the application is divided into multiple logical blocks, each block generates multiple thread bundles, each thread bundle consists of 32 threads, which are used to execute the same instruction stream, the CPU sends the tasks that need to be processed in parallel to the GPGPU, and notifies the GPGPU to prepare for execution. In other embodiments, the number of threads in each thread bundle is variable.
[0045] S02: Initialize the thread bundle pool. The thread bundle pool completes the basic configuration of the thread storage unit according to the predefined hardware parameters of the system, including size, depth, etc. At the same time, the thread bundle dynamic management unit loads the hardware logic of dynamic thread bundle reconstruction and manages the status information in the thread storage unit, such as thread identification, program counter (PC) value, execution ready status, etc.
[0046] S03. Local thread bundle scheduling. The local thread bundle scheduler of the streaming multiprocessor polls the thread bundles to be processed in the thread bundle queue and assigns them to the operation units for execution. At the same time, it monitors their execution status. If branch divergence occurs during the thread execution, the branch thread with the larger Next_PC value is selected from the two branch paths and moved out of the streaming multiprocessor to which it belongs, and placed in the global thread bundle pool to prepare for reconstruction.
[0047] S04. Global thread bundle scheduling and reconstruction. Whenever a thread bundle in a stream multiprocessor is executed or transferred to the global thread bundle pool, its position is taken by another thread bundle in the global scheduler. The global thread bundle scheduler selects threads from the thread bundle pool, including threads from the thread bundle diverging from the current branch and other threads with the same PC value, to form a new complete thread bundle. The highest scheduling priority is the thread bundle that has been completely reconstructed, followed by the newly formed thread bundle. If a complete thread bundle is missing, the incomplete thread bundle with the lowest PC value will be selected to ensure that subsequent branches can be effectively processed by the global scheduler. This dynamic scheduling strategy improves the utilization of the stream processor and optimizes the overall performance of the program.
[0048] S05. Load balancing and thread migration. The global scheduler evaluates the load of each stream multiprocessor and migrates the thread bundles from the overloaded stream multiprocessor to the idle stream multiprocessor through the thread migration function to achieve load balancing.
[0049] S06, synchronization barrier processing, when the thread warp reaches the synchronization barrier, it is recalled from the streaming multiprocessor and replaced by the prepared thread warp; after all the thread warps in the block touch the synchronization barrier, they are rescheduled back to the streaming multiprocessor to continue executing subsequent tasks. After the task is completed, the results are collected and returned to the CPU.
[0050] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0051] The logical basis of the present invention is: in the modern GPGPU architecture, the system defaults to no direct data competition between threads from different blocks, and if the threads do not involve the use of shared memory, thread synchronization is usually not required. Based on this point, there is no direct data competition between threads in the entire application. Therefore, the migration of threads between different stream multiprocessors can be achieved during the actual execution of the kernel. Based on this, a dynamic global thread bundle reconstruction system is first provided to reduce the impact of branch divergence on performance by establishing a pool containing diverged threads in the global grid. Subsequently, the global thread scheduler will reorganize new thread bundles from this thread pool and schedule them for execution. This method helps to improve resource utilization and reduce performance losses caused by branch divergence. In order to improve the processing of different execution path lengths and reduce the dependence on the distribution of branch targets in the grid, through this mechanism, we aim to optimize the execution efficiency of threads and improve the overall performance of GPGPU applications.
[0052] The present invention designs a function of migrating threads across streaming multiprocessors, allowing warps belonging to the same block to be assigned to different streaming multiprocessors by a global scheduler. For cores that cannot perform thread migration due to the use of local shared memory, or in cases where migrating threads will have negative effects, the global reconfiguration function can be easily disabled. This flexibility enables the provision of optimal scheduling strategies in different execution environments.
[0053] The global thread scheduler proposed in the present invention monitors the status of the thread bundle pool and reorganizes threads with the same PC value into new warps in the thread bundle pool according to the current execution requirements and resource availability. In this way, it can ensure that the execution unit always remains active, reduce idle cycles, and use resources more efficiently.
[0054] By continuously monitoring the execution status of the thread pool and warps, the global scheduler can implement a load balancing strategy to ensure that the workload is evenly distributed across all streaming multiprocessor cores, avoiding overloading some cores while leaving others idle.
[0055] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the scope of protection. As used in the description in the text, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0056] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. The technicians may clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0057] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit.
Claims
1. A dynamic global warp reconstruction system, characterized by: It includes a thread bundle pool and a global thread bundle scheduler. The thread bundle pool is used to collect threads diverged due to branch instructions and store and track the status of these threads. The global thread bundle scheduler is connected to the thread bundle pool and is used to monitor the status of the thread bundle pool. According to the current execution requirements and resource availability, the threads with the same PC value in the thread bundle pool are reorganized into new thread bundles, and the new thread bundles are assigned to the streaming multiprocessor for execution.
2. The dynamic global warp reconstruction system according to claim 1, characterized in that: The global warp scheduler assigns warps belonging to the same block to different streaming multiprocessors for execution.
3. The dynamic global warp reconstruction system according to claim 1, characterized in that: The thread bundle pool includes a thread storage unit and a thread bundle dynamic management unit. The thread storage unit stores multiple threads, each thread contains a set of status information. The thread bundle dynamic management unit is connected to the thread storage unit and is used to dynamically manage the life cycle of the thread, including creating new thread bundles, scheduling existing thread bundles, and destroying thread bundles that have completed execution.
4. The dynamic global warp reconstruction system according to claim 1, characterized in that: The global warp scheduler implements load balancing strategies by continuously monitoring the execution status of the warp pool and warps.
5. The dynamic global warp reconstruction system according to claim 3, characterized in that: The status information includes thread ID, PC value, register status, and execution status.
6. A thread warp scheduling method, characterized in that: This method is implemented based on the dynamic global warp reconstruction system according to any one of claims 1 to 5, and comprises the following steps: S01, system startup and task allocation. After the system is powered on, the application is divided into multiple logical blocks. Each block generates multiple thread bundles. Each thread bundle consists of multiple threads for executing instruction streams. The CPU sends the tasks that need to be processed in parallel to the GPGPU and notifies the GPGPU to prepare for execution. S02, the thread bundle pool is initialized. The thread bundle pool completes the basic configuration of the thread storage unit according to the hardware parameters predefined by the system. At the same time, the thread bundle dynamic management unit loads the hardware logic of the dynamic thread bundle reconstruction and manages the status information in the thread storage unit; S03, local thread bundle scheduling, the local thread bundle scheduler of the stream multiprocessor polls the thread bundles to be processed in the thread bundle queue, and assigns them to the operation unit for execution, while monitoring the execution status of the thread bundle. If branch divergence occurs during the thread execution, the branch thread with the larger Next_PC value is selected from the two branch paths, and is moved out of the stream multiprocessor to which it belongs, and is placed in the global thread bundle pool, ready for reconstruction; S04, global thread warp scheduling and reconstruction, whenever a thread warp in the stream multiprocessor is executed or transferred to the global thread warp pool, its position is taken over by another thread warp in the global scheduler, and the global thread warp scheduler selects threads from the thread warp pool, including threads from the thread warp diverged from the current branch and other threads with the same PC value, to form a new complete thread warp; S05. Load balancing and thread migration. The global scheduler evaluates the load of each stream multiprocessor and migrates the thread bundles from the overloaded stream multiprocessor to the idle stream multiprocessor through the thread migration function to achieve load balancing.
7. The thread warp scheduling method according to claim 6, characterized in that: In step S04 , the thread warps that have completed reconstruction have the highest scheduling priority, followed by the newly formed thread warps.
8. The thread warp scheduling method according to claim 7, characterized in that: If a complete warp is missing, the incomplete warp with the lowest PC value will be selected.
9. The thread warp scheduling method according to claim 6, characterized in that: The method comprises step S06 of synchronization barrier processing, wherein when a thread warp reaches the synchronization barrier, the thread warp is recalled from the streaming multiprocessor and is replaced by a prepared thread warp; After all the thread warps in the block hit the synchronization barrier, they are rescheduled back to the streaming multiprocessor to continue executing subsequent tasks. After the tasks are completed, the results are collected and returned to the CPU.
10. A thread warp scheduling device, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the thread warp scheduling method according to any one of claims 6 to 9 when running the program instructions.
Citation Information
Patent Citations
Dynamic adaptive adjustment method, system and equipment for thread pool and storage medium
CN117707758A
GPGPU (General Purpose Graphics Processing Unit) branch instruction scheduling method based on multistage redistribution mechanism
CN118012632A
GPGPU (General Purpose Graphics Processing Unit) pipeline instruction cache, GPGPU architecture and instruction fetching method
CN118656127A
File access method based on GPGPU multi-channel register and storage medium
CN118689538A
Thread recombination method and device based on GPGPU (General Purpose Graphics Processing Unit) and medium
CN118819868A