Thread bundle scheduling method and device for GPU (Graphics Processing Unit) and medium
By decoding thread beam instructions and allocating them to the idle stream processor according to the operation type, the problem of thread beam scheduling serialization in traditional GPU architecture is solved, the parallel processing capability and resource utilization of the GPU are improved, and the overall performance is improved.
Patent Information
- Application Number
- CN202411279474.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-11-08
AI Technical Summary
The serialization of thread beam scheduling methods in traditional GPU architecture limits the parallel processing capabilities and resource utilization of the GPU and affects the overall performance.
By decoding the thread beam instruction sequence and storing it to the buffer instruction table entry, the idle state of the stream processor is determined according to the operation type, and the thread beam instruction is allocated to the corresponding SP array using preset instruction allocation rules to realize parallel scheduling of multi-threaded beam instruction.
It improves the parallel processing capability and resource utilization of the GPU, improves overall performance, and reduces the number of thread beam schedulers, saving hardware resources.
Smart Images

Figure CN118916178A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a thread warp scheduling method, device and medium for a graphics processing unit (GPU). Background Art
[0002] In the traditional GPU architecture, each programmable multiprocessor contains a thread warp scheduler, an instruction buffer, and a streaming processor (SP) array.
[0003] This design allows only one thread warp's instructions to be scheduled and executed at any given time, even if other stream processors may be idle. This serialized scheduling method limits the parallel processing capabilities of the GPU, especially when processing complex or computationally intensive tasks, which may lead to low resource utilization and affect overall performance. Summary of the invention
[0004] The embodiments of the present application provide a thread warp scheduling method, device and medium for a GPU, which are used to solve the problem that the current thread warp scheduling method limits the parallel processing capability of the GPU, which easily limits resource utilization and affects the overall performance of the GPU.
[0005] On the one hand, an embodiment of the present application provides a thread warp scheduling method for a GPU, the method comprising:
[0006] Decoding the cached thread warp instruction sequence and storing it in a buffered instruction table entry; wherein the buffered instruction table entry at least includes a valid field and a ready field of the thread warp instruction;
[0007] According to the operation type corresponding to the thread warp instruction in the buffer instruction table entry, the idle state of the corresponding multiple stream processor SP arrays is determined by the thread warp scheduler; wherein the idle state is obtained based on the busy state bit; the busy state bit of each operation unit of the SP array is stored in the busy state register corresponding to the thread warp scheduler; each operation unit of the same SP array corresponds to different operation types;
[0008] Based on each of the idle states and a preset instruction allocation rule, the ready warp instructions corresponding to the buffered instruction table entry are allocated to the corresponding SP array.
[0009] In one implementation of the present application, before decoding the cached thread warp instruction sequence and storing it in the buffer instruction table entry, the method further includes:
[0010] Determine each thread warp corresponding to the same thread block and the thread warp instruction stream corresponding to each thread warp;
[0011] Determining an executable instruction warp based on the instruction execution order of the warp instruction stream and / or the execution status of a previous warp instruction of the warp instruction to be executed;
[0012] According to the preset thread bundle sequence identifier, the to-be-executed thread bundle instructions corresponding to each of the executable instruction thread bundles are added to the corresponding thread bundle instruction sequence in sequence; wherein, each thread bundle instruction in the same thread bundle instruction sequence corresponds to a different thread bundle, and each thread bundle instruction in the same thread bundle instruction sequence is of the same operation type and is in the same instruction stream sequence position of the thread bundle instruction stream.
[0013] In one implementation of the present application, determining an executable instruction warp based on the instruction execution order of the warp instruction stream and / or the execution state of a previous warp instruction of the warp instruction to be executed specifically includes:
[0014] In a case where the to-be-executed thread warp instruction is the first thread warp instruction in the instruction execution sequence, using the thread warp corresponding to the to-be-executed thread warp instruction as the executable instruction thread warp;
[0015] Otherwise, according to the instruction execution order, determine the previous thread bundle instruction of the thread instruction to be executed, and determine the execution status of the previous thread bundle instruction, so as to determine whether the thread bundle corresponding to the thread instruction to be executed is the executable instruction thread bundle according to the execution status; the execution status includes at least: execution completed, not execution completed.
[0016] In one implementation of the present application, according to the operation type corresponding to the warp instruction in the buffer instruction table entry, the idle state of the corresponding plurality of stream processor SP arrays is determined by the warp scheduler, specifically including:
[0017] According to the operation type and the busy state register, the element values in the busy state bit matrix corresponding to each SP array are traversed by the thread warp scheduler; wherein one busy state bit matrix records the busy state bits of each operation unit of one SP array; the busy state bit of one operation unit corresponds to one element value; different element values correspond to different idle states;
[0018] The idle state of each SP array with respect to the operation type is determined according to each element value obtained by traversal.
[0019] In an implementation of the present application, based on each of the idle states and a preset instruction allocation rule, the ready warp instructions corresponding to the buffered instruction table entry are allocated to the corresponding SP array, specifically including:
[0020] Determine the number of idle SP arrays according to each of the idle states;
[0021] Comparing the number of ready instructions of the ready warp instructions with the number of free SP arrays;
[0022] When the number of ready instructions is less than or equal to the number of idle SP arrays, the plurality of ready warp instructions are respectively allocated to the corresponding SP arrays according to the correspondence between the preset warp sequence identifiers and the SP array sequence identifiers.
[0023] In one implementation of the present application, the method further includes:
[0024] In the case that the number of the ready instructions is greater than the number of the idle SP arrays, according to the preset thread warp sequence identifier, the number of the idle SP arrays is used as a segmentation index, the ready thread warp instructions of the segmentation index number are sequentially screened, and added to the first batch processing queue until each of the ready thread warp instructions is added to N batch processing sequences; wherein the Nth batch processing queue contains at most the ready thread warp instructions of the segmentation index number; N is a natural number;
[0025] According to each of the batch processing queues, a plurality of the ready warp instructions corresponding to each of the batch processing queues are sequentially allocated to each of the corresponding SP arrays.
[0026] In an implementation of the present application, in the thread warp instruction stream corresponding to the same thread block, the operation type of the same instruction stream sequence position is the same.
[0027] In an implementation of the present application, the operation unit of one of the SP arrays includes one or more of the following: a calculation unit, a double-precision floating-point operation unit, a load-store unit, and a special function unit.
[0028] On the other hand, an embodiment of the present application further provides a thread warp scheduling device for a GPU, the device comprising:
[0029] at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0030] Decoding the cached thread warp instruction sequence and storing it in a buffered instruction table entry; wherein the buffered instruction table entry at least includes a valid field and a ready field of the thread warp instruction;
[0031] According to the operation type corresponding to the thread warp instruction in the buffer instruction table entry, the idle state of the corresponding multiple stream processor SP arrays is determined by the thread warp scheduler; wherein the idle state is obtained based on the busy state bit; the busy state bit of each operation unit of the SP array is stored in the busy state register corresponding to the thread warp scheduler; each operation unit of the same SP array corresponds to different operation types;
[0032] Based on each of the idle states and a preset instruction allocation rule, the ready warp instructions corresponding to the buffered instruction table entry are allocated to the corresponding SP array.
[0033] On the other hand, the embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0034] Decoding the cached thread warp instruction sequence and storing it in a buffered instruction table entry; wherein the buffered instruction table entry at least includes a valid field and a ready field of the thread warp instruction;
[0035] According to the operation type corresponding to the thread warp instruction in the buffer instruction table entry, the idle state of the corresponding multiple stream processor SP arrays is determined by the thread warp scheduler; wherein the idle state is obtained based on the busy state bit; the busy state bit of each operation unit of the SP array is stored in the busy state register corresponding to the thread warp scheduler; each operation unit of the same SP array corresponds to different operation types;
[0036] Based on each of the idle states and a preset instruction allocation rule, the ready warp instructions corresponding to the buffered instruction table entry are allocated to the corresponding SP array.
[0037] Compared with the prior art, the present invention has the following significant effects:
[0038] Through the above technical solution, the present application can allocate multiple thread warp instructions at a time, effectively improving the throughput of the same programmable multiprocessor, and sharing a thread warp scheduler through multiple SP arrays, reducing the number of thread warp schedulers and saving hardware resources. In this way, thread warps can be flexibly scheduled, the GPU parallel processing capability and resource utilization are improved, and the overall performance of the GPU is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0040] Figure 1 A flowchart of a thread warp scheduling method for a GPU in an embodiment of the present application is shown;
[0041] Figure 2 A schematic diagram of a GPU system architecture corresponding to a thread warp scheduling method for a GPU in an embodiment of the present application;
[0042] Figure 3 Another flowchart of a thread warp scheduling method for a GPU in an embodiment of the present application is shown;
[0043] Figure 4 It is a structural schematic diagram of a thread warp scheduling method for a GPU in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0045] In modern GPU architecture, programmable multiprocessors are the basic units for parallel computing. Each programmable multiprocessor integrates many identical streaming processors (SP) to complete the computing requirements of multiple threads in a thread bundle. It also integrates multiple storage access units to execute memory access instructions. These streaming processors form a streaming processor array.
[0046] In the GPU programming model, thread block is an important layer. It consists of a group of threads or multiple thread bundles and is the basic task unit for the Compute Unified Device Architecture (CUDA) or Open Computing Language (OpenCL) program to assign tasks to programmable multiprocessors.
[0047] In the current mainstream GPU architecture programmable multiprocessors, usually one warp scheduler and instruction buffer corresponds to one SP array. This means that the warp scheduler can only schedule the instructions of the next warp after a specified execution is completed, thereby reducing the execution efficiency of tasks in the same thread block.
[0048] Based on this, the embodiments of the present application provide a thread warp scheduling method, device and medium for a GPU, which are used to solve the problem that the current thread warp scheduling method limits the parallel processing capability of the GPU, which easily limits resource utilization and affects the overall performance of the GPU.
[0049] The following describes in detail various embodiments of the present application in conjunction with the accompanying drawings.
[0050] The present application embodiment provides a thread warp scheduling method for a GPU, such as Figure 1 As shown, the method may include steps S101-S103:
[0051] S101, the GPU decodes the cached thread warp instruction sequence and stores it into a buffer instruction table entry.
[0052] The buffer instruction table entry at least includes a valid field and a ready field of the warp instruction.
[0053] It should be noted that the GPU is used as the execution subject of the thread bundle scheduling method for the GPU. The system architecture corresponding to the GPU of this application is as follows: Figure 2 As shown. It includes a programmable multiprocessor and a thread block; the programmable multiprocessor includes an instruction cache unit I-Cache, an instruction decoding buffer I-Buffer, a thread warp scheduler and multiple SP arrays. The computing unit of an SP array includes one or more of the following: a computing unit Core, a double precision floating-point arithmetic unit (Double Precision Floating-Point Arithmetic Unit, DP Unit), a load / store unit (load / store, LD / ST), and a special function unit (Special Function Units, SFU).
[0054] In the embodiment of the present application, before decoding the cached thread warp instruction sequence and storing it in the buffer instruction table entry, the method further includes:
[0055] Determine the thread bundles corresponding to the same thread block and the thread bundle instruction streams corresponding to the thread bundles. Determine the executable instruction thread bundle based on the instruction execution order of the thread bundle instruction stream and / or the execution status of the previous thread bundle instruction of the thread bundle instruction to be executed. According to the preset thread bundle sequence identifier, the thread bundle instructions to be executed corresponding to each executable instruction thread bundle are added to the corresponding thread bundle instruction sequence in sequence. Among them, each thread bundle instruction in the same thread bundle instruction sequence corresponds to a different thread bundle, and each thread bundle instruction in the same thread bundle instruction sequence is of the same operation type and is in the same instruction stream sequence position of the thread bundle instruction stream.
[0056] That is to say, the present application can determine the thread bundle instruction stream and determine whether the thread bundle instruction corresponding to the thread bundle instruction stream is an executable instruction thread bundle that can be executed by the SP array. Then, according to the preset thread bundle sequence identifier of the thread bundle, the corresponding thread bundle instruction to be executed is added to the thread bundle instruction sequence in sequence. The thread bundle instruction corresponding to the executable instruction thread bundle is the thread bundle instruction to be executed. In the thread bundle instruction stream corresponding to the same thread block, the operation type of the same instruction stream sequence position is the same.
[0057] In the embodiment of the present application, the above-mentioned determination of the executable instruction warp based on the instruction execution order of the warp instruction stream and / or the execution status of the previous warp instruction of the warp instruction to be executed specifically includes:
[0058] When the to-be-executed warp instruction is the first warp instruction in the instruction execution sequence, the warp corresponding to the to-be-executed warp instruction is used as the executable instruction warp.
[0059] In the case where the thread warp instruction to be executed is not the first thread warp instruction in the instruction execution sequence, the thread warp instruction before the thread warp instruction to be executed is determined according to the instruction execution sequence, and the execution state of the previous thread warp instruction is determined, so as to determine whether the thread warp corresponding to the thread warp instruction to be executed is an executable instruction thread warp according to the execution state. The execution state includes at least: execution completed and incomplete execution.
[0060] For example, a thread block is divided into four warps, with IDs 0, 1, 2, and 3. The warp instruction flow of each warp is Cx_1->LSx->Cx_2, where C represents a warp instruction whose operation type is operation, LS represents a warp instruction whose operation type is memory access, and x represents a warp ID. Assume that there are two SP arrays in a programmable multiprocessor, denoted as SPA0 and SPA1.
[0061] First, C0_1, C1_1, C2_1, and C3_1 are all the first thread bundle instructions in the instruction execution order, so the thread bundle instruction sequence is [C0_1, C1_1, C2_1, C3_1]. Since there are two SP arrays in the above example, the operations of C0_1 and C1_1 are executed first. After the operations are completed, LS0 and LS1 are not the first thread bundle instructions in the instruction execution order, and the execution status of the previous thread bundle instruction is completed. At this time, the new thread bundle instruction sequence is cached [LS0, LS1]. The thread bundle instruction sequence is cached in the instruction cache unit. The GPU of the present application can also decode the instructions in the instruction cache unit through the decoding unit, and then store them in the buffered instruction table entry in the instruction decoding buffer, wherein the instruction verification can be performed during decoding to determine whether it is valid, thereby setting the valid field to indicate that the instruction is valid, and implementing a ready check to determine whether the instruction can be emitted. If so, the ready field is set to indicate that the instruction is ready and waiting for selection and emission by the thread bundle scheduler.
[0062] S102, the GPU determines the idle states of the corresponding plurality of stream processor SP arrays through the warp scheduler according to the operation type corresponding to the warp instruction in the buffer instruction table entry.
[0063] The idle state is obtained based on the busy state bit. The busy state bit of each operation unit of the SP array is stored in the busy state register corresponding to the thread warp scheduler. Each operation unit of the same SP array corresponds to a different operation type.
[0064] In the embodiment of the present application, according to the operation type corresponding to the warp instruction in the buffer instruction table entry, the idle state of the corresponding plurality of stream processor SP arrays is determined by the warp scheduler, specifically including:
[0065] According to the operation type and the busy state register, the thread warp scheduler traverses the element values in the busy state bit matrix corresponding to each SP array. Among them, a busy state bit matrix records the busy state bits of each operation unit of an SP array. The busy state bit of an operation unit corresponds to an element value. Different element values correspond to different idle states. According to the traversed element values, the idle state of each SP array with respect to the operation type is determined.
[0066] In other words, a busy status register is provided in the GPU of the present application, and the busy status bits of each operation unit in the SP array are recorded in the form of a matrix. Each element in the matrix corresponds to an operation unit, and the specific element value of the element represents the busy status. For example, an element value of 1 represents that the operation unit is not idle; an element value of 0 represents that the corresponding operation unit is idle.
[0067] S103 , the GPU allocates the ready warp instructions corresponding to the buffered instruction table entries to the corresponding SP arrays based on the idle states and the preset instruction allocation rule.
[0068] In the embodiment of the present application, based on each idle state and a preset instruction allocation rule, the ready warp instructions corresponding to the buffered instruction table entry are allocated to the corresponding SP array, specifically including:
[0069] According to each idle state, the number of idle SP arrays is determined. The number of ready instructions of the ready warp instructions is compared with the number of idle SP arrays. When the number of ready instructions is less than or equal to the number of idle SP arrays, the plurality of ready warp instructions are respectively allocated to the corresponding SP arrays according to the correspondence between the preset warp sequence identifier and the SP array sequence identifier.
[0070] When the number of ready instructions is greater than the number of idle SP arrays, according to the preset thread warp sequence identifier, with the number of idle SP arrays as the segmentation index, the segmentation index number of ready thread warp instructions are sequentially screened and added to the first batch processing queue until each ready thread instruction is added to the N batch processing sequence. Among them, the Nth batch processing queue contains at most the segmentation index number of ready thread warp instructions. N is a natural number. According to each batch processing queue, the multiple ready thread warp instructions corresponding to each batch processing queue are sequentially allocated to the corresponding SP arrays.
[0071] In other words, the present application can determine the number of idle SP arrays according to the state of the busy state bit after the thread bundle instruction is stored in the instruction decoding buffer. If the number of ready instructions in the instruction decoding buffer is greater than or equal to the number of idle SP arrays, the same number of ready thread bundle instructions are selected from the instruction decoding buffer and sent to the idle SP arrays for execution in sequence. These ready thread bundle instructions should belong to different thread bundles, and the corresponding relationship on which the allocation principle depends is: the ready instructions with smaller thread bundle IDs are allocated to the stream processor arrays with smaller IDs, and the ready instructions with larger thread bundle IDs are allocated to the stream processor arrays with larger IDs. If there is no idle SP array, the thread bundle scheduler does not perform any operation. If the number of ready thread bundle instructions is less than the number of idle SP arrays, an SP array is allocated for each ready thread bundle instruction.
[0072] For example, C0_1, C1_1, C2_1, and C3_1 are fetched, decoded, and stored in the instruction decode buffer. Readiness check is performed. Since it is the first instruction, the ready fields of all thread warp instructions are ready. The thread warp scheduler determines that the number of idle SP arrays in the computing unit is 2 based on the state of the SP array calculation busy state bit. The calculation of the ready thread warp instructions is greater than the idle SP arrays of the computing unit. The thread warp scheduler selects instructions C0_1 and C1_1 from the instruction decode buffer and assigns them to SPA0 and SPA1 respectively. In the next instruction cycle, C0_1 and C1_1 have been executed, and LS0 and LS1 are fetched, decoded, and stored in the instruction decode buffer. At this time, the number of idle SP arrays for computing and memory access is 2. The thread warp scheduler selects instructions LS0 and LS1 from the instruction decode buffer and assigns them to the memory access units of SPA0 and SPA1 for execution. In the next instruction cycle, LS0 and LS1 are not executed, the number of free SP arrays for memory access is 0, and the number of free SP arrays for computation is 2. The warp scheduler sends C2_1 and C3_1 to the computation units of SPA0 and SPA1 for execution, and so on, until all instructions are executed. The above 2 is a segmentation indicator, and the batch processing sequence contains 2 ready warp instructions. The batch processing sequence contains [C0_1, C1_1], [C2_1, C3_1].
[0073] Figure 3 Another flowchart of a thread warp scheduling method for a GPU provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, including:
[0074] S301, fetch instructions, decode, store into instruction decoding buffer, and perform readiness check;
[0075] S302, the warp scheduler determines the number of idle SP arrays according to the state of the busy state bit;
[0076] S303, determine whether there is no idle SP array? If yes, continue to execute S303, otherwise execute S304;
[0077] S304, determine whether the ready instructions (i.e., the ready warp instructions) are greater than or equal to the idle SP array? If so, execute S305, otherwise execute S306;
[0078] S305, selecting the same number of ready instructions from the instruction decoding buffer and transmitting them sequentially to the idle SP array for execution;
[0079] S306, allocating a SP array for each ready instruction;
[0080] S307, determine whether the computing task is completed. If it is completed, otherwise execute S301.
[0081] Through the above technical solution, the present application can allocate multiple thread warp instructions at a time, effectively improving the throughput of the same programmable multiprocessor, and sharing a thread warp scheduler through multiple SP arrays, reducing the number of thread warp schedulers and saving hardware resources. In this way, thread warps can be flexibly scheduled, the GPU parallel processing capability and resource utilization are improved, and the overall performance of the GPU is improved.
[0082] Figure 4 A structural diagram of a thread warp scheduling device for a GPU provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the device includes:
[0083] At least one processor; and a memory in communication with the at least one processor. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0084] The cached thread warp instruction sequence is decoded and stored in the buffer instruction table entry. The buffer instruction table entry includes at least a valid field and a ready field of the thread warp instruction. According to the operation type corresponding to the thread warp instruction in the buffer instruction table entry, the idle state of the corresponding multiple stream processor SP arrays is determined by the thread warp scheduler. The idle state is obtained based on the busy state bit. The busy state bit of each operation unit of the SP array is stored in the busy state register corresponding to the thread warp scheduler. Each operation unit of the same SP array corresponds to a different operation type. Based on each idle state and a preset instruction allocation rule, the ready thread warp instruction corresponding to the buffer instruction table entry is allocated to the corresponding SP array.
[0085] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0086] The cached thread warp instruction sequence is decoded and stored in the buffer instruction table entry. The buffer instruction table entry includes at least a valid field and a ready field of the thread warp instruction. According to the operation type corresponding to the thread warp instruction in the buffer instruction table entry, the idle state of the corresponding multiple stream processor SP arrays is determined by the thread warp scheduler. The idle state is obtained based on the busy state bit. The busy state bit of each operation unit of the SP array is stored in the busy state register corresponding to the thread warp scheduler. Each operation unit of the same SP array corresponds to a different operation type. Based on each idle state and a preset instruction allocation rule, the ready thread warp instruction corresponding to the buffer instruction table entry is allocated to the corresponding SP array.
[0087] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0088] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0089] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0090] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A thread warp scheduling method for GPU, It is characterized in that The method comprises: Decoding the cached thread warp instruction sequence and storing it in a buffered instruction table entry; wherein the buffered instruction table entry at least includes a valid field and a ready field of the thread warp instruction; According to the operation type corresponding to the thread warp instruction in the buffer instruction table entry, the idle state of the corresponding multiple stream processor SP arrays is determined by the thread warp scheduler; wherein the idle state is obtained based on the busy state bit; the busy state bit of each operation unit of the SP array is stored in the busy state register corresponding to the thread warp scheduler; each operation unit of the same SP array corresponds to different operation types; Based on each of the idle states and a preset instruction allocation rule, the ready warp instructions corresponding to the buffered instruction table entry are allocated to the corresponding SP array.
2. The thread warp scheduling method for a GPU according to claim 1, It is characterized in that Before decoding the cached thread warp instruction sequence and storing it in the buffer instruction table entry, the method further includes: Determine each thread warp corresponding to the same thread block and the thread warp instruction stream corresponding to each thread warp; Determining an executable instruction warp based on the instruction execution order of the warp instruction stream and / or the execution status of a previous warp instruction of the warp instruction to be executed; According to the preset thread bundle sequence identifier, the to-be-executed thread bundle instructions corresponding to each of the executable instruction thread bundles are added to the corresponding thread bundle instruction sequence in sequence; wherein, each thread bundle instruction in the same thread bundle instruction sequence corresponds to a different thread bundle, and each thread bundle instruction in the same thread bundle instruction sequence is of the same operation type and is in the same instruction stream sequence position of the thread bundle instruction stream.
3. The thread warp scheduling method for GPU according to claim 2, It is characterized in that Determining an executable instruction warp based on the instruction execution order of the warp instruction stream and / or the execution state of a previous warp instruction of the warp instruction to be executed specifically includes: In a case where the to-be-executed thread warp instruction is the first thread warp instruction in the instruction execution sequence, using the thread warp corresponding to the to-be-executed thread warp instruction as the executable instruction thread warp; Otherwise, according to the instruction execution order, determine the previous thread bundle instruction of the thread instruction to be executed, and determine the execution status of the previous thread bundle instruction, so as to determine whether the thread bundle corresponding to the thread instruction to be executed is the executable instruction thread bundle according to the execution status; the execution status includes at least: execution completed, not execution completed.
4. The thread warp scheduling method for a GPU according to claim 1, It is characterized in that According to the operation type corresponding to the warp instruction in the buffer instruction table entry, the idle state of the corresponding plurality of stream processor SP arrays is determined by the warp scheduler, specifically including: According to the operation type and the busy state register, the element values in the busy state bit matrix corresponding to each SP array are traversed by the thread warp scheduler; wherein one busy state bit matrix records the busy state bits of each operation unit of one SP array; the busy state bit of one operation unit corresponds to one element value; different element values correspond to different idle states; The idle state of each SP array with respect to the operation type is determined according to each element value obtained by traversal.
5. The thread warp scheduling method for GPU according to claim 1, It is characterized in that Based on each of the idle states and the preset instruction allocation rule, the ready warp instructions corresponding to the buffered instruction table entry are allocated to the corresponding SP array, specifically including: Determine the number of idle SP arrays according to each of the idle states; Comparing the number of ready instructions of the ready warp instructions with the number of free SP arrays; When the number of ready instructions is less than or equal to the number of idle SP arrays, the plurality of ready warp instructions are respectively allocated to the corresponding SP arrays according to the correspondence between the preset warp sequence identifiers and the SP array sequence identifiers.
6. The thread warp scheduling method for GPU according to claim 5, It is characterized in that The method further comprises: In the case that the number of the ready instructions is greater than the number of the idle SP arrays, according to the preset thread warp sequence identifier, the number of the idle SP arrays is used as a segmentation index, the ready thread warp instructions of the segmentation index number are sequentially screened, and added to the first batch processing queue until each of the ready thread warp instructions is added to N batch processing sequences; wherein the Nth batch processing queue contains at most the ready thread warp instructions of the segmentation index number; N is a natural number; According to each of the batch processing queues, a plurality of the ready warp instructions corresponding to each of the batch processing queues are sequentially allocated to each of the corresponding SP arrays.
7. The thread warp scheduling method for a GPU according to claim 2, It is characterized in that In the thread warp instruction stream corresponding to the same thread block, the operation type of the same instruction stream sequence position is the same.
8. The thread warp scheduling method for a GPU according to claim 1, It is characterized in that The operation unit of one of the SP arrays includes one or more of the following: a calculation unit, a double-precision floating-point operation unit, a load-store unit, and a special function unit.
9. A thread warp scheduling device for a GPU, It is characterized in that The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a thread warp scheduling method for a GPU as described in any one of claims 1 to 8.
10. A non-volatile computer storage medium storing computer executable instructions, It is characterized in that The computer executable instructions can execute a thread warp scheduling method for a GPU as described in any one of claims 1 to 8.
Citation Information
Cited By
GPGPU (General Purpose Graphics Processing Unit) thread block synchronization method and equipment based on thread lock and medium
CN119557115A
RISC-V-based thread bundle scheduling method, equipment and medium
CN119559032A
Thread bundle scheduling method and device, graphics processor and computer equipment
CN119862010A
Thread bundle scheduling method and apparatus, graphics processor, and computer device
CN119862010B
Instruction scheduling device and method, processor, electronic equipment and storage medium
CN120125419A
