Thread block processing system and method, and related device

By decomposing the thread block into two sub-thread blocks and utilizing local shared memory for data transmission, the time delay problem when the graphics processor loads data from external storage space is solved and processing efficiency is improved.

WO2024174504A1PCT designated stage expired Publication Date: 2024-08-29HYGON INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/118779
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-23
Filing Date
2023-09-14
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

There is a large time delay when the graphics processor loads data from external storage space, which affects its execution efficiency.

Method used

By decomposing the thread block into two sub-thread blocks, which are processed on different computing units respectively, and using local shared memory for data transmission, the time delay of loading data from external storage space is reduced.

Benefits of technology

It effectively reduces the time delay of data loading within the thread block and improves the processing efficiency of the graphics processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023118779_29082024_PF_FP_ABST
    Figure CN2023118779_29082024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a thread block processing system and method, and a related device. The processing system comprises a first computing unit used for running a first sub-thread block and a second computing unit used for running a second sub-thread block. The first computing unit is used for acquiring data to be processed of the thread blocks, and the second computing unit is used for executing a processing task of the thread blocks according to the data to be processed acquired by the first computing unit. The thread block processing system provided by the embodiments of the present disclosure can effectively reduce the time delay of loading data to be processed, particularly, reduce the time delay of loading, from an external storage space, data to be processed, and improve the processing efficiency of thread blocks.
Need to check novelty before this filing date? Find Prior Art

Description

Thread block processing system, method and related equipment

[0001] This application claims priority to Chinese patent application No. 202310165825.8 filed on February 23, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field

[0002] Embodiments of the present disclosure relate to a thread block processing system, method, and related devices. Background Art

[0003] A graphics processing unit (GPU) is a microprocessor that specializes in image and graphics-related computing tasks. Due to its high parallel processing capability, it has great advantages in performing data block parallel processing algorithms.

[0004] Before performing parallel data processing, a graphics processor usually needs to load a large amount of data from an external storage space to a local storage space. For example, the data is loaded from the main memory (global memory) outside the graphics processor to the data shared space of the Streaming MultiProcessor (SM) inside the graphics processor.

[0005] However, the time delay of loading data from external storage space is very large, which will seriously affect the execution efficiency of the graphics processor. Therefore, how to provide a task processing system to improve the execution efficiency of the graphics processor has become a technical problem that those skilled in the art need to solve urgently.

[0006] Summary of the Invention

[0007] In view of this, the embodiments of the present disclosure provide a thread block processing system, method and related equipment, which can reduce the time delay of loading data to be processed, especially reduce the time delay of loading data to be processed from external storage space, and improve the processing efficiency of thread blocks.

[0008] To achieve the above objectives, the embodiments of the present disclosure provide the following technical solutions.

[0009] In a first aspect, an embodiment of the present invention provides a thread block processing system, wherein the thread block includes a first sub-thread block and a second sub-thread block decomposed therefrom, and the processing system includes:

[0010] a first computing unit for running the first sub-thread block, and a second computing unit for running the second sub-thread block;

[0011] The first computing unit is used to obtain the data to be processed of the thread block, and the second computing unit is used to execute the processing task of the thread block according to the data to be processed obtained by the first computing unit.

[0012] Optionally, the first computing unit is further configured to load the acquired data to be processed into the second computing unit.

[0013] Optionally, the first computing unit includes:

[0014] a first warp scheduling module, configured to receive an instruction scheduling request issued by the second computing unit, wherein the instruction scheduling request is used to instruct to insert a remote load instruction into an instruction queue of the first warp scheduling module;

[0015] The first local shared memory is used to send the to-be-processed data pre-stored in the first local shared memory to the second computing unit according to instruction information of the remote load instruction.

[0016] Optionally, the second calculation unit includes:

[0017] a second warp scheduling module, configured to send an instruction scheduling request to the first computing unit, and send a remote write request instruction to the second local shared memory;

[0018] The second local shared memory is used to wait for data to be written from the first computing unit according to instruction information of the remote write request instruction.

[0019] Optionally, the first computing unit and the second computing unit are independently running computing units located in the same parallel processor.

[0020] Optionally, the data to be processed is stored in a storage space outside the parallel processor.

[0021] Optionally, the parallel processor is a graphics processor.

[0022] In a second aspect, an embodiment of the present disclosure further provides a thread block processing method, which is applied to a parallel processor, and the method includes:

[0023] Decomposing the thread block into at least a first sub-thread block and a second sub-thread block, wherein the first sub-thread block is used to obtain data to be processed by the thread block, and the second sub-thread block is used to execute tasks of the thread block according to the data to be processed obtained by the first sub-thread block;

[0024] The first sub-thread block is assigned to a first computing unit, and the second sub-thread block is assigned to a second computing unit.

[0025] Optionally, the first computing unit and the second computing unit are independently running computing units located in the same parallel processor, and the data to be processed is stored in a storage space located outside the parallel processor.

[0026] Optionally, the method further includes: the first computing unit acquiring the data to be processed of the thread block, and loading the data to be processed into the second computing unit.

[0027] Optionally, the step of the first computing unit loading the data to be processed into the second computing unit includes:

[0028] In response to an instruction scheduling request issued by the second computing unit, inserting a remote load instruction into an instruction queue of a warp scheduling module of the first computing unit;

[0029] According to the instruction information of the remote load instruction, the warp scheduling module of the first computing unit notifies the local shared memory of the first computing unit to send the to-be-processed data to the local shared memory of the second computing unit.

[0030] In a third aspect, an embodiment of the present disclosure further provides a processor, including a processing system of the thread block.

[0031] In a fourth aspect, an embodiment of the present disclosure further provides an electronic device comprising the processor.

[0032] Embodiments of the present invention provide a thread block processing system, method, and related devices. In this system, a thread block to be processed is decomposed into at least two sub-thread blocks, wherein a first sub-thread block is used to obtain data to be processed by the thread block, and a second sub-thread block is used to execute the thread block's tasks based on the data to be processed obtained by the first sub-thread block. It can be seen that the thread block processing system provided by this embodiment can effectively reduce the time delay in loading data to be processed, especially reducing the time delay in loading data to be processed from external storage space, thereby improving thread block processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are merely embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0034] Figure 1 is a schematic diagram of a decomposition method for computing tasks;

[0035] FIG2 is a schematic diagram of a graphics processor structure including multiple computing units;

[0036] FIG3 is a schematic structural diagram of a thread block processing system provided by an embodiment of the present disclosure;

[0037] FIG4 is a flowchart of a thread block processing method provided by an embodiment of the present disclosure;

[0038] FIG5 is a flowchart of a thread block processing method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.

[0040] It is understandable that when a parallel processor (eg, a graphics processor) processes a computing task in parallel, it may decompose the computing task into corresponding task items, thereby enabling each component in the parallel processor for data processing to perform corresponding calculations based on each task item.

[0041] Figure 1 illustrates an exemplary decomposition method for computing tasks. Task packets, issued by an upper-level software driver, are distributed by a task dispatch unit and then assigned in the form of thread blocks to independently executable computing units within a parallel processor, such as the streaming multiprocessors (SMs) within a graphics processor (GPU). The GPU can be a general-purpose graphics processing unit (GPGPU). A GPGPU is a specialized graphics processor that is more focused on general-purpose rather than graphics rendering. It contains a large number of streaming multiprocessor hardware units, which are the hardware units that execute tasks within the GPGPU. Specifically, within the streaming multiprocessor, a thread block is split into multiple thread warps for scheduling and execution. A thread warp is the smallest schedulable unit within a GPU. A thread warp consists of multiple bundled threads, which are the smallest execution objects within a GPU. These bundled threads execute the same instructions together, but operate on different data. This model is also known as the Single Instruction Multiple Thread (SIMT) architecture. This means that all threads in a warp execute the same instructions. Furthermore, all threads in a thread block also execute the same instructions, differing only in the data they operate on. Each warp in a thread block completes a portion of the overall task, and all warps within the block work together to complete the entire task.

[0042] FIG2 exemplarily illustrates a schematic diagram of the structure of a graphics processor 100 including multiple computing units. As shown in the figure, the graphics processor 100 includes a streaming multiprocessor 110, a level 2 cache (L2 cache) 120, and a global shared memory 130. Specifically, a streaming multiprocessor 110 further includes a warp scheduler 111, registers 113, compute resources 114, local shared memory 115, and a level 1 cache (L1 cache) 116.

[0043] Before performing data computation, a warp typically needs to perform a large number of external data loading operations to load data that the warp may subsequently use from storage space outside the GPU 100 into storage space within the GPU 100. Specifically, the data that may be used later is first loaded from external memory (global memory) 200 into the local shared memory 115 where the warp resides. The warp can then move the required data from local shared memory 115 to the corresponding registers 113 for the warp to perform data computation. Furthermore, during this data loading process from external memory 200 to local shared memory 115, the data is not loaded directly from external memory 200 to local shared memory 115. Instead, it is first loaded from external memory 200 to second-level cache 120, then from second-level cache 120 to first-level cache 116, and finally from first-level cache 116 to local shared memory 115. Each step of the above loading process will generate a time delay. The time delay generated by the process of loading data from the external memory 200 to the register 113 corresponding to the thread warp is the sum of the time delays of the above loading steps.

[0044] As can be seen, the data loading operation from external storage in a warp results in significant latency. Furthermore, because instructions within a warp execute serially, if a subsequent data load operation from external memory occurs while the warp is performing data computation, the data load cannot proceed simultaneously with the computation and must wait until the preceding computation is complete. This serial execution of instructions within a warp prevents the latency between the computation and external data loading operations within the warp from being fully hidden, further impacting warp execution efficiency.

[0045] In response to the above problems, an embodiment of the present invention provides a thread block processing system, method and related equipment. The embodiment of the present invention decomposes a thread block into a first sub-thread block and a second sub-thread block. The first sub-thread block is loaded into a first computing unit to obtain the data to be processed of the thread block. The second sub-thread block is loaded into a second computing unit to load the data to be processed from the first computing unit and execute the processing task of the thread block.

[0046] It can be seen that the thread block processing system provided by the embodiment of the present invention can reduce the time delay for the thread warps in the thread block to load data from the external storage space, thereby improving the execution efficiency of the thread warps.

[0047] The thread block processing system provided by an embodiment of the present invention is described in detail below.

[0048] In an optional implementation, FIG3 shows a schematic diagram of the structure of a thread block processing system according to an embodiment of the present invention. The thread block includes a first sub-thread block and a second sub-thread block, and the processing system includes a first computing unit 110a and a second computing unit 110b. The first computing unit 110a is configured to execute the first sub-thread block, and the second computing unit 110b is configured to execute the second sub-thread block. The first computing unit 110a is configured to obtain data to be processed for the thread block, and the second computing unit 110b is configured to execute the processing task of the thread block based on the data to be processed obtained by the first computing unit 110a.

[0049] In this embodiment, to improve task execution efficiency, a thread block is decomposed into two sub-thread blocks: a first sub-thread block and a second sub-thread block, each of which completes a portion of the entire thread block's task. Specifically, in this embodiment, the first sub-thread block is used to retrieve data to be processed by the thread block from external memory, while the second sub-thread block is used to process the data retrieved by the first sub-thread block. It will be appreciated that in other examples, a thread block can be decomposed into even more sub-thread blocks, with each sub-thread block collaborating to complete the task corresponding to the entire thread block.

[0050] The first computing unit 110a and the second computing unit 110b may be independently operating computing units within a parallel processor. As an example, in this embodiment, the first computing unit 110a and the second computing unit 110b are streaming multiprocessors located within the same graphics processor. A streaming multiprocessor is an independently operating computing unit within a graphics processor, and the number of streaming multiprocessors within a graphics processor may range from dozens to tens of thousands.

[0051] The first computing unit 110a is configured to obtain data to be processed for the thread block. Each thread warp within the thread block typically needs to perform a large number of data loading operations before performing data calculations. The data loaded by the thread warps is also referred to as data to be processed. The data to be processed is typically stored externally to the graphics processor, and the first computing unit 110a needs to obtain the data to be processed from the external storage space. As an optional example, referring to Figures 2 and 3, the data to be processed is stored in external memory 200. External memory 200 is located externally to the graphics processor 100, enabling data sharing between multiple graphics processors 100 or between the graphics processor 100 and the CPU. The first computing unit 110a may need to undergo multiple data loading processes to obtain the data to be processed from the external memory 200. For example, in one example, the data to be processed is loaded from the external memory 200 into the second-level cache 120, then from the second-level cache 120 into the first-level cache 116, and finally from the first-level cache 116 into the local shared memory 115a of the first computing unit 110a.

[0052] The first computing unit 110a is further configured to load the acquired data to be processed into the second computing unit 110b. In an optional example, after the data to be processed stored in the external memory 200 is acquired by the first computing unit 110a, it can be temporarily stored in the local shared memory 115a of the first computing unit 110a. The first computing unit 110a can then load the data to be processed pre-stored in the local shared memory 115a into the second computing unit 110b upon request from the second computing unit 110b.

[0053] In an optional example, the first computing unit 110a further includes: a warp scheduling module 111a, a register 113a, computing resources 114a, a local shared memory 115a, and a first-level cache 116a.

[0054] The warp scheduling module 111 a is configured to receive an instruction scheduling request, where the instruction scheduling request is configured to instruct the insertion of a remote load instruction into an instruction queue of the warp scheduling module 111 a .

[0055] The instruction scheduling request is issued by the second computing unit 110b, specifically, by the warp scheduling module 111b of the second computing unit 110b, that is, the warp scheduling module 111b of the second computing unit 110b issues an instruction scheduling request to the warp scheduling module 111a of the first computing unit 110a.

[0056] The remote loading instruction is used to instruct the local shared memory 115a of the first computing unit 110a to read the data to be processed pre-stored in the local shared memory 115a, and send the data to be processed to the second computing unit 110b, that is, to load the data to be processed pre-stored in the local shared memory 115a to the second computing unit 110b. Specifically, it can be sent to the specified address of the local shared memory 115b of the second computing unit 110b.

[0057] The local shared memory 115a is a data sharing space for the first computing unit 110a. The thread warps in the first computing unit 110a can share data through the local shared memory 115a. The local shared memory 115a reads the to-be-processed data pre-stored in the local shared memory 115a according to the instruction information of the remote load instruction and sends the to-be-processed data to the second computing unit 110b. Specifically, the to-be-processed data pre-stored in the local shared memory 115a is sent to the second computing unit 110b. Specifically, the data can be sent to a specified address of the local shared memory 115b of the second computing unit 110b.

[0058] Registers 113a are used to store various data and computational results required by warps to execute tasks. Registers 113a are allocated per warp, with each warp having its own corresponding register 113a. In some examples, data cannot be directly shared between registers 113a and must be transferred through local shared memory 115a. For example, if there are two warps, warp a and warp b, located in the same computational unit, then data cannot be shared between the registers corresponding to warp a and warp b. If data sharing is required between warp a and warp b, this must be achieved through local shared memory 115a. Both warp a and warp b can read and write to local shared memory 115a. If warp b needs to load data from warp a's corresponding registers, warp a must write the data in its registers to local shared memory 115a. Warp b then loads the data written from warp a's registers into warp b's corresponding registers from the corresponding addresses in local shared memory 115a.

[0059] The computing resource 114a includes units for a series of mathematical operations such as multiplication and addition.

[0060] The second computing unit 110b is configured to execute the processing task of the thread block according to the to-be-processed data obtained by the first computing unit 110a. In an optional example, the second computing unit 110b further includes: a warp scheduling module 111b, a register 113b, computing resources 114b, a local shared memory 115b, and a first-level cache 116b.

[0061] The warp scheduling module 111b is configured to send an instruction scheduling request to the first computing unit 110a, wherein the instruction scheduling request is configured to instruct the insertion of a remote load instruction into the instruction queue of the warp scheduling module 111a. Specifically, the warp scheduling module 111b sends an instruction scheduling request to the warp scheduling module 111a of the first computing unit 110a, wherein the instruction scheduling request is configured to instruct the insertion of a remote load instruction into the instruction queue of the warp scheduling module 111a of the first computing unit 110a.

[0062] The warp scheduling module 111b is further configured to send a remote write request (ST) instruction to the local shared memory 115b. The ST instruction is configured to instruct the local shared memory 115b to wait for data to be written from the first computing unit 110a. Specifically, the ST instruction may be data written from the local shared memory 115a of the first computing unit 110a.

[0063] The local shared memory 115b is a data sharing space of the second computing unit 110b. Thread warps in the second computing unit 110b can share data through the local shared memory 115b. The local shared memory 115b waits for data to be written from the first computing unit 110a according to the instruction information of the remote write request instruction. Specifically, the data may be written from the local shared memory 115a of the first computing unit 110a.

[0064] Registers 113b are used to store various data and computational results required by warps to execute tasks. Registers 113b are allocated per warp, with each warp having its own corresponding register 113b. Similar to register 113a, data cannot be directly shared between registers 113b and must be transferred through local shared memory 115b.

[0065] The computing resources 114b include units for a series of mathematical operations such as multiplication and addition.

[0066] The thread block processing system provided in this embodiment includes two independent computing units, wherein a first computing unit is used to obtain data to be processed for the thread block, and a second computing unit is used to execute the processing task of the thread block based on the data to be processed obtained by the first computing unit. Specifically, when a thread warp on the second computing unit is performing intensive data computation, the thread warp on the first computing unit can pre-load some shared data required later for the thread warp currently performing data computation on the second computing unit. The pre-loaded shared data is stored in the local shared memory of the first computing unit. After the thread warp on the second computing unit completes the intensive data computation, the shared data can be copied to the corresponding address in the local shared memory of the second computing unit for the second computing unit to access. The data transmission delay between the local shared memories of the computing units is much lower than the delay in loading data from external storage space. In this embodiment, the first computing unit loads external data, and the second computing unit can perform computations using the data pre-loaded by the first computing unit. The two computing units work together to complete the processing task of the thread block, effectively reducing the delay in loading data to be processed, especially reducing the delay in loading data from external storage space, thereby improving the processing efficiency of the thread block.

[0067] It is understood that the embodiments of the present disclosure are described using only the example of decomposing a thread block into two sub-thread blocks. In other cases, a thread block can be decomposed into more sub-thread blocks based on actual needs. It is understood that the embodiments of the present disclosure are described using only the example of the data transmission process between two streaming multiprocessors, i.e., one streaming multiprocessor accessing the local shared memory of another streaming multiprocessor. In other cases, the data transmission process can be expanded to multiple streaming multiprocessors, i.e., one streaming multiprocessor accessing the local shared memory of multiple other streaming multiprocessors.

[0068] The embodiments of the present disclosure further provide a thread block processing method, which is used, for example, in a parallel processor, such as a general-purpose graphics processor, and the embodiments of the present disclosure are not limited thereto.

[0069] In an optional implementation, FIG4 shows an optional flow chart of a thread block processing method provided by an embodiment of the present invention. As shown in the figure, the method includes:

[0070] Step S310: decompose the thread block into at least a first sub-thread block and a second sub-thread block, wherein the first sub-thread block is used to obtain the to-be-processed data of the thread block, and the second sub-thread block is used to execute the task of the thread block according to the to-be-processed data obtained by the first sub-thread block.

[0071] In this embodiment, to improve task execution efficiency, the thread block to be processed is decomposed into at least two sub-thread blocks: a first sub-thread block and a second sub-thread block, each of which completes a portion of the entire thread block task. Specifically, in this embodiment, the first sub-thread block is used to retrieve the thread block's data to be processed from external memory, and the second sub-thread block is used to process the data retrieved by the first sub-thread block. It will be appreciated that in other examples, a thread block can be decomposed into even more sub-thread blocks, with each sub-thread block collaborating to complete the task corresponding to the entire thread block.

[0072] Step S330: assigning the first sub-thread block to a first computing unit, and assigning the second sub-thread block to a second computing unit.

[0073] The first computing unit 110a and the second computing unit 110b may be independently operating computing units within a parallel processor. As an example, in this embodiment, the first computing unit 110a and the second computing unit 110b are streaming multiprocessors located within the same graphics processor. A streaming multiprocessor is an independently operating computing unit within a graphics processor, and the number of streaming multiprocessors within a graphics processor may range from dozens to tens of thousands.

[0074] In an optional example, the first computing unit 110a further includes: a warp scheduling module 111a, a register 113a, computing resources 114a, a local shared memory 115a, and a first-level cache 116a.

[0075] The warp scheduling module 111 a is configured to receive an instruction scheduling request, where the instruction scheduling request is configured to instruct the insertion of a remote load instruction into an instruction queue of the warp scheduling module 111 a .

[0076] The instruction scheduling request is issued by the second computing unit 110b, specifically, by the warp scheduling module 111b of the second computing unit 110b, that is, the warp scheduling module 111b of the second computing unit 110b issues an instruction scheduling request to the warp scheduling module 111a of the first computing unit 110a.

[0077] The remote loading instruction is used to instruct the local shared memory 115a of the first computing unit 110a to read the data to be processed pre-stored in the local shared memory 115a, and send the data to be processed to the second computing unit 110b, that is, to load the data to be processed pre-stored in the local shared memory 115a to the second computing unit 110b. Specifically, it can be sent to the specified address of the local shared memory 115b of the second computing unit 110b.

[0078] The local shared memory 115a is a data sharing space for the first computing unit 110a. The thread warps in the first computing unit 110a can share data through the local shared memory 115a. The local shared memory 115a reads the to-be-processed data pre-stored in the local shared memory 115a according to the instruction information of the remote load instruction and sends the to-be-processed data to the second computing unit 110b. Specifically, the to-be-processed data pre-stored in the local shared memory 115a is sent to the second computing unit 110b. Specifically, the data can be sent to a specified address of the local shared memory 115b of the second computing unit 110b.

[0079] The registers 113a are used to store various data and calculation results required by the warp to execute tasks. Registers 113a are allocated according to warp, and each warp has its own corresponding register 113a. In some examples, data cannot be directly shared between registers 113a and must be transferred through local shared memory 115a. For example, if there are two warps, warp a and warp b, and warp a and warp b are located in the same computational unit, then data cannot be shared between the registers corresponding to warp a and warp b. If warp a and warp b need to share data, this must be done through local shared memory 115a. Warp a and warp b can both read and write to local shared memory 115a. If warp b needs to load data from the registers corresponding to warp a, warp a must write the data in its registers to local shared memory 115a. Warp b then loads the data written from warp a's registers into the registers corresponding to warp b from the corresponding addresses in local shared memory 115a.

[0080] The computing resource 114a includes units for a series of mathematical operations such as multiplication and addition.

[0081] The second computing unit 110b is configured to execute the processing task of the thread block according to the to-be-processed data obtained by the first computing unit 110a. In an optional example, the second computing unit 110b further includes: a warp scheduling module 111b, a register 113b, computing resources 114b, a local shared memory 115b, and a first-level cache 116b.

[0082] The warp scheduling module 111b is configured to send an instruction scheduling request to the first computing unit 110a, wherein the instruction scheduling request is configured to instruct the insertion of a remote load instruction into the instruction queue of the warp scheduling module 111a. Specifically, the warp scheduling module 111b sends an instruction scheduling request to the warp scheduling module 111a of the first computing unit 110a, wherein the instruction scheduling request is configured to instruct the insertion of a remote load instruction into the instruction queue of the warp scheduling module 111a of the first computing unit 110a.

[0083] The warp scheduling module 111b is further configured to send a remote write request instruction to the local shared memory 115b. The remote write request instruction is configured to instruct the local shared memory 115b to wait for data to be written from the first computing unit 110a. Specifically, the remote write request instruction may be data written from the local shared memory 115a of the first computing unit 110a.

[0084] The local shared memory 115b is a data sharing space of the second computing unit 110b. Thread warps in the second computing unit 110b can share data through the local shared memory 115b. The local shared memory 115b waits for data to be written from the first computing unit 110a according to the instruction information of the remote write request instruction. Specifically, the data may be written from the local shared memory 115a of the first computing unit 110a.

[0085] Registers 113b are used to store various data and computational results required by warps to execute tasks. Registers 113b are allocated per warp, with each warp having its own corresponding register 113b. Similar to register 113a, data cannot be directly shared between registers 113b and must be transferred through local shared memory 115b.

[0086] The computing resources 114b include units for a series of mathematical operations such as multiplication and addition.

[0087] Step S350: the first computing unit obtains the data to be processed of the thread block, and loads the data to be processed into the second computing unit.

[0088] The first computing unit 110a obtains the data to be processed from the thread block. Each thread warp within the thread block typically needs to perform a large number of data loading operations before performing data calculations. The data loaded by the thread warps is also referred to as the data to be processed. The data to be processed is typically stored externally to the graphics processor, and the first computing unit 110a needs to obtain the data to be processed from the external storage space. As an optional example, referring to Figures 2 and 3, the data to be processed is stored in external memory 200. External memory 200 is located externally to the graphics processor 100, allowing data to be shared between multiple graphics processors 100, or between the graphics processor 100 and the CPU. The first computing unit 110a may need to go through multiple data loading processes to obtain the data to be processed from the external memory 200. For example, in one example, the data to be processed is loaded from the external memory 200 into the second-level cache 120, then from the second-level cache 120 into the first-level cache 116, and finally from the first-level cache 116 into the local shared memory 115a of the first computing unit 110a.

[0089] The data to be processed is data required by the second computing unit 110b to execute the thread block task, such as various data that may be used by the second computing unit 110b in the process of performing data calculations. The first computing unit 110a pre-reads the data to be processed from the external storage space and stores the data to be processed in the internal storage space of the first computing unit 110a, such as the local shared memory 115a of the first computing unit 110a.

[0090] The first computing unit 110a also loads the acquired data to be processed into the second computing unit 110b. In an optional example, after the data to be processed stored in the external memory 200 is acquired by the first computing unit 110a, it can be temporarily stored in the local shared memory 115a of the first computing unit 110a. The first computing unit 110a can send the data to be processed pre-stored in the local shared memory 115a to the second computing unit 110b upon request from the second computing unit 110b.

[0091] Specifically, referring to FIG5 , step S350 in which the first computing unit obtains the data to be processed of the thread block and loads the data to be processed into the second computing unit may further include:

[0092] Step S351 : In response to the instruction scheduling request issued by the second computing unit, insert a remote load instruction into the instruction queue of the warp scheduling module of the first computing unit.

[0093] The instruction scheduling request is used to instruct the insertion of a remote data transmission instruction into the instruction queue of the first computing unit 110a. The remote load instruction is used to instruct the local shared memory 115a of the first computing unit 110a to send the to-be-processed data to the local shared memory 115b of the second computing unit 110b.

[0094] The remote load instruction includes at least a current address of the data to be processed and a target address. The current address of the data to be processed is located in the internal storage space of the first computing unit 110a, such as the local shared memory 115a of the first computing unit 110a, and the target address of the data to be processed is located in the internal storage space of the second computing unit 110b, such as the local shared memory 115b of the second computing unit 110b.

[0095] As an example, referring to FIG3 , when a warp in the second computing unit 110b, acting as the receiving end, is scheduled by the warp scheduling module 111b of the second computing unit 110b to execute a remote load (LD) instruction, the warp sends an instruction scheduling request to the warp scheduling module 111a of the first computing unit 110a, notifying the warp scheduling module 111a of the first computing unit 110a that a remote load instruction needs to be temporarily inserted for scheduling. The warp scheduling module is primarily responsible for scheduling warps in the graphics processor and for fetching, decoding, and issuing instructions within the warp. After receiving the instruction scheduling request, the warp scheduling module 111a of the first computing unit 110a inserts the remote load instruction into the instruction queue.

[0096] Step S353: According to the instruction information of the remote load instruction, the warp scheduling module of the first computing unit notifies the local shared memory of the first computing unit to send the to-be-processed data to the local shared memory of the second computing unit.

[0097] As an example, the warp scheduling module 111a of the first computing unit 110a notifies the local shared memory 115a of the first computing unit 110a that a piece of data needs to be read from a specified address and sent to a specified location of the local shared memory 115b of the second computing unit 110b.

[0098] Step S355: The local shared memory of the first computing unit sends the data to be processed to the local shared memory of the second computing unit.

[0099] The thread block processing method provided in this embodiment decomposes a thread block to be processed into at least two sub-thread blocks, wherein a first sub-thread block is used to obtain the data to be processed by the thread block, and a second sub-thread block is used to execute the tasks of the thread block based on the data to be processed obtained by the first sub-thread block. It can be seen that the thread block processing method provided in this embodiment can effectively reduce the time delay of loading the data to be processed, especially reducing the time delay of loading the data to be processed from external storage space, thereby improving the processing efficiency of the thread block.

[0100] It is understood that the embodiments of the present disclosure are described using only the example of decomposing a thread block into two sub-thread blocks. In other cases, a thread block can be decomposed into more sub-thread blocks based on actual needs. It is understood that the embodiments of the present disclosure are described using only the example of the data transmission process between two streaming multiprocessors, i.e., one streaming multiprocessor accessing the local shared memory of another streaming multiprocessor. In other cases, the data transmission process can be expanded to multiple streaming multiprocessors, i.e., one streaming multiprocessor accessing the local shared memory of multiple other streaming multiprocessors.

[0101] Some embodiments of the present disclosure further provide a processor, which includes the thread block processing system provided by the embodiments of the present invention.

[0102] Some embodiments of the present disclosure further provide an electronic device, comprising the processor provided by an embodiment of the present invention.

[0103] Some embodiments of the present disclosure further provide a storage medium, wherein the storage medium stores one or more executable instructions, and the one or more executable instructions are used to execute the thread block processing method provided by an embodiment of the present invention.

[0104] The above describes multiple embodiment schemes provided by the embodiments of the present invention. The various optional methods introduced in each embodiment scheme can be combined and cross-referenced with each other without conflict, thereby extending a variety of possible embodiment schemes, which can all be considered as embodiment schemes disclosed and open in the embodiments of the present invention.

[0105] Although the embodiments of the present disclosure are disclosed above, the present disclosure is not limited thereto. Any person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the scope of protection of the present disclosure shall be based on the scope defined by the claims.

Claims

1. A thread block processing system, wherein: The thread block includes a decomposed first sub-thread block and a second sub-thread block, and the processing system includes: a first computing unit for running the first sub-thread block, and a second computing unit for running the second sub-thread block; The first computing unit is used to obtain the data to be processed of the thread block, and the second computing unit is used to execute the processing task of the thread block according to the data to be processed obtained by the first computing unit.

2. The thread block processing system according to claim 1, wherein: The first computing unit is further configured to load the acquired data to be processed into the second computing unit.

3. The thread block processing system according to claim 1 or 2, wherein: The first computing unit comprises: A first warp scheduling module, configured to receive an instruction scheduling request issued by the second computing unit, wherein the instruction scheduling request is used to instruct to insert a remote load instruction into an instruction queue of the first warp scheduling module; The first local shared memory is used to send the to-be-processed data pre-stored in the first local shared memory to the second computing unit according to the instruction information of the remote loading instruction.

4. The thread block processing system according to any one of claims 1 to 3, wherein: The second computing unit includes a second warp scheduling module and a second local shared memory; The second warp scheduling module is configured to send an instruction scheduling request to the first computing unit, and send a remote write request instruction to the second local shared memory; The second local shared memory is used to wait for data to be written from the first computing unit according to instruction information of the remote write request instruction.

5. The thread block processing system according to any one of claims 1 to 4, wherein: The first computing unit and the second computing unit are independently operated computing units located in the same parallel processor.

6. The thread block processing system according to claim 5, wherein: The data to be processed is stored in a storage space outside the parallel processor.

7. The thread block processing system according to claim 5 or 6, wherein: The parallel processor is a graphics processor.

8. A thread block processing method, applied to a parallel processor, the processing method comprising: Decomposing the thread block into at least a first sub-thread block and a second sub-thread block, wherein the first sub-thread block is used to obtain the to-be-processed data of the thread block, and the second sub-thread block is used to execute the task of the thread block according to the to-be-processed data obtained by the first sub-thread block; The first sub-thread block is assigned to a first computing unit, and the second sub-thread block is assigned to a second computing unit.

9. The thread block processing method according to claim 8, wherein: The first computing unit and the second computing unit are independently operated computing units located in the same parallel processor, and the data to be processed is stored in a storage space outside the parallel processor.

10. The thread block processing method according to claim 8 or 9, further comprising: The first computing unit obtains the data to be processed of the thread block, and loads the data to be processed into the second computing unit.

11. The thread block processing method according to claim 10, wherein: The first computing unit loads the to-be-processed data into the second computing unit, comprising: In response to the instruction scheduling request issued by the second computing unit, inserting a remote load instruction into an instruction queue of a warp scheduling module of the first computing unit; According to the instruction information of the remote load instruction, the thread warp scheduling module of the first computing unit notifies the local shared memory of the first computing unit to send the to-be-processed data to the local shared memory of the second computing unit.

12. A processor, comprising a processing system of a thread block according to any one of claims 1 to 7.

13. An electronic device comprising the processor according to claim 12.

Citation Information

Patent Citations

  • Shared memory multiplexing method and device

    CN110308982A

  • Information processing method, device and equipment

    CN111626916A

  • Thread block processing system and method and related equipment

    CN116302504A

  • Thread processing method and graphics processor

    WO2019157743A1