Method and device for reading and storing far and near path data based on GPGPU (General Purpose Graphics Processing Unit) and storage medium
By introducing a dual-ended path processing unit and a preprocessing module in the GPGPU, the storage paths are selected for inactive and active thread bundles, which solves the problems of GPGPU register file resources and power consumption, and achieves efficient data storage and reading performance.
Patent Information
- Application Number
- CN202411102610.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-26
AI Technical Summary
The design of GPGPU's large-capacity register file causes resource and power consumption problems, and it is difficult to effectively manage register overflows, affecting performance.
The dual-ended path processing unit is adopted, and the preprocessing module, the far-near path selection module and the active thread bundle data table entry cache unit are divided into remote path and near path. The storage path is selected for inactive and active thread bundles. Preprocessing of data is performed to reduce data bit width, save storage resources and reduce read bandwidth.
It realizes that the storage efficiency and reading performance of register files are improved without increasing storage resources and power consumption, and the storage pressure of register files is reduced through the preprocessing and selective storage path of the dual-ended path processing unit.
Smart Images

Figure CN119025035A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of GPGPU technology, and in particular to a method, device and storage medium for reading and storing near and far path data based on GPGPU. Background Art
[0002] Similar to the CPU storage structure, the GPGPU storage system also adopts a hierarchical structure design, which allows the use of data locality to reduce the access overhead of off-chip storage. However, in order to meet the SIMT large-scale thread parallelism of the GPGPU core, GPGPU follows the principle of throughput priority, so its storage system is also significantly different from that of the CPU.
[0003] The register file of GPGPU is generally designed with large capacity, mainly to meet the zero-overhead switching of thread warps. Therefore, the context information of the active thread warps, especially the contents of the registers, need to be saved in the register file. If the register resources are reduced, when the register requirements of the thread exceed the physical capacity of the register file, some local storage space needs to be allocated in the global memory for these additional registers. Therefore, register overflow often leads to performance degradation. Therefore, from the performance point of view, GPGPU has to adopt a large-capacity register file design.
[0004] Therefore, in order to obtain higher register density, large-capacity GPGPU register files are mostly implemented with SRAM. At the same time, in order to ensure the parallelism of calculations, each register file is also required to have a large bandwidth. Therefore, the SRAM that makes up the register file requires not only a large area but also a large bandwidth. However, large-capacity register files will cause problems with resources and power consumption. Summary of the invention
[0005] In order to overcome the deficiencies of the above technologies, the present invention provides a GPGPU-based near-far path data reading and storage method, device and storage medium that can save storage resources and reduce the pressure of reading bandwidth.
[0006] The technical solution adopted by the present invention to overcome the technical problems is: A method for reading and storing near and far path data based on GPGPU, comprising: Establishing a dual-end path processing unit, the dual-end path processing unit is composed of a pre-processing module, a near-far end path selection module, and an active thread warp data table entry cache unit; The dual-end path processing unit selects a write-back path of a far-end path, a write-back path of a near-end path, a read-out path of a far-end path, and a read-out path of a near-end path.
[0007] Furthermore, the above-mentioned preprocessing module includes a mean calculation unit, a difference calculation unit, and a mean splicing unit. The operating results generated by each register block of the GPGPU are input into the mean calculation unit for cumulative average operation. The difference calculation unit performs difference operations on the operating results generated by each register block and the average value respectively. The difference splicing unit splices each difference to obtain preprocessed data.
[0008] Furthermore, the write-back path of the remote path is: Inputting the operation results generated by the register block of the GPGPU into the preprocessing module of the dual-end path processing unit for preprocessing; The near-far path selection module reads the active state of the corresponding warp in the active warp data entry cache unit, determines the warp state as inactive, and writes the preprocessed data into the register block of the GPGPU through the GPGPU arbiter.
[0009] Furthermore, the read path of the remote path is: After the control instruction is sent to the operand collector unit of the GPGPU, the operand collector unit parses the register required by the current control instruction, and the operand collector unit sends a read instruction to the arbiter of the GPGPU; The GPGPU arbiter sends the read instruction to the corresponding register block; After responding to the instruction data, the register block returns the corresponding instruction data to the operand collector unit through the cross switch of the GPGPU, and the operand collector unit sends the instruction data to the execution unit of the GPGPU for calculation.
[0010] Furthermore, the write-back path of the proximal path is: Inputting the operation results generated by the register block of the GPGPU into the preprocessing module of the dual-end path processing unit for preprocessing; The near-far path selection module reads the active state of the corresponding warp in the active warp data entry cache unit, determines the state of the warp as active, and writes the preprocessed data into the active warp data entry cache unit.
[0011] Furthermore, the reading path of the proximal path is: The control instruction is sent to the dual-end path processing unit, and the dual-end path processing unit reads from the active thread warp data table entry cache unit according to the control instruction; The read data is restored and sent to the execution unit of the GPGPU for calculation.
[0012] Furthermore, the active warp data entry cache unit is composed of WID, active state, and each thread data, where WID is the ID of the corresponding warp.
[0013] On the other hand, the present invention also relates to a device for accelerating image transmission operations based on GPGPU, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: The memory is used to store computer programs; The processor is configured to execute, by running a program stored in the memory: The dual-end path processing unit selects a write-back path of the far-end path, a write-back path of the near-end path, a read-out path of the far-end path, and a read-out path of the near-end path.
[0014] On the other hand, the present invention also relates to a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements: The dual-end path processing unit selects a write-back path of the far-end path, a write-back path of the near-end path, a read-out path of the far-end path, and a read-out path of the near-end path.
[0015] The beneficial effects of the present invention are as follows: through a dual-end path processing unit, the data path for writing into the register file is divided into a remote path and a near-end path. For inactive thread bundles, the remote path is used, and the remote path has a larger storage space, but the power consumption and bandwidth are larger when accessing; for active thread bundles, the near-end path is used, and the storage space of the near-end path is smaller, but the access speed is fast and the power consumption is smaller. At the same time, each path will pre-process the data when storing to reduce the bit width of the data, which can save storage resources and reduce the pressure of the reading bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a diagram of the architecture of the near-far path processing of the present invention; Figure 2 is a structural diagram of a dual-end path processing unit of the present invention; Figure 3 It is a schematic diagram of an active thread warp data table entry of the present invention. DETAILED DESCRIPTION
[0017] The following is combined with Figure 1 , Attachment Figure 2 , Attachment Figure 3 The preferred embodiments of the present invention are described in detail so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0018] In the description of the present invention, it should be noted that the embodiments described in the present invention are only part of the embodiments of the present invention, rather than all of the embodiments; based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0019] The terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0020] Example 1 A method for reading and storing near and far path data based on GPGPU, comprising: A dual-end path processing unit is established, and the dual-end path processing unit is composed of a preprocessing module, a near-far path selection module, and an active thread bundle data table entry cache unit. The dual-end path processing unit includes a data preprocessing function, which can pre-process the data to be stored to reduce the bit width of the data, and the near-far path selection unit can select whether to store the write-back data in the register block or the active thread bundle data table entry cache unit according to the information of the active thread bundle counted in the active thread bundle data table entry cache unit.
[0021] The dual-end path processing unit selects a write-back path of a far-end path, a write-back path of a near-end path, a read-out path of a far-end path, and a read-out path of a near-end path.
[0022] In this embodiment, the preprocessing module includes a mean calculation unit, a difference calculation unit, and a mean splicing unit. The operation results generated by each register block of the GPGPU are input into the mean calculation unit for cumulative averaging operation. The difference calculation unit performs difference operation on the operation results generated by each register block and the average value, and the difference splicing unit splices each difference to obtain preprocessed data. When the register operation is completed and written back, the operation result will be preprocessed to reduce the occupation of the data bit width, which can save the table storage resources at the near end and the area and resources of the remote register block. The preprocessing adopts the method of accumulating the results returned by each thread to obtain an average value, and then calculating the difference between the results returned by the thread and the average value. Then only the average value and the difference are stored. Compared with the calculation result of storing 128-bit bit width for each thread, this storage method only needs to store a 128-bit average value and a difference much less than 128-bit bit width. The reason is that there is a strong data similarity between the values of adjacent thread registers in GPGPU. After the data preprocessing is completed, the near-far path selection will be performed. This module matches the table entry in the active thread bundle data table entry cache unit according to the current thread bundle ID. If a match is found, it means that this thread bundle is more active, and the near-far path is used, and the data is stored in the active thread bundle data table entry cache unit. If there is no match, the far-far path is used and finally stored in the register block.
[0023] In this embodiment, the write-back path of the remote path is: The operation results generated by the register block of the GPGPU are input into the preprocessing module of the dual-end path processing unit for preprocessing. The register block of the GPGPU is a single-port RAM, which is used to store a large amount of register data.
[0024] The near-far path selection module reads the active state of the corresponding warp in the active warp data entry cache unit, determines the warp state as inactive, and writes the preprocessed data into the GPGPU register block through the GPGPU arbitrator. The arbitrator can choose which register block to write to based on the returned data.
[0025] In this embodiment, the read path of the remote path is: After the control instruction is sent to the operand collector unit of the GPGPU, the operand collector unit parses the registers required by the current control instruction, and the operand collector unit sends the read instruction to the arbiter of the GPGPU. The control instruction refers to the control command of each instruction parsed after the decoding unit decodes it.
[0026] The GPGPU arbiter sends the read instruction to the corresponding register block.
[0027] After responding to the instruction data, the register block returns the corresponding instruction data to the operand collector unit through the GPGPU cross switch, and the operand collector unit sends the instruction data to the GPGPU execution unit for calculation. The cross switch is a bridge for data transmission between the register block and the operand collector unit. The execution unit can accept register data calculations and write the calculation results back to the register file for storage.
[0028] In this embodiment, the write-back path for the near-end path is: The operation results generated by the register block of the GPGPU are input into the preprocessing module of the dual-end path processing unit for preprocessing. Data preprocessing can reduce the data bit width.
[0029] The near-far path selection module reads the active state of the corresponding warp in the active warp data entry cache unit, determines the state of the warp as active, and writes the preprocessed data into the active warp data entry cache unit.
[0030] In this embodiment, the read path of the proximal path is: The control instruction is sent to the dual-end path processing unit, and the dual-end path processing unit reads from the active thread warp data table entry cache unit according to the control instruction.
[0031] The read data is restored and sent to the execution unit of the GPGPU for calculation.
[0032] It can be seen that the remote storage capacity is large, but the area is large, and the power consumption when reading is also high; the near-end reading speed is fast and the power consumption is low, but the area is small and the storage space is limited.
[0033] The active thread bundle data table entry cache unit consists of WID, active status, and each thread data. WID is the ID of the corresponding thread bundle. Each data request control instruction will be recorded in the active thread bundle data table entry and recorded as active status. At the same time, the table entry also stores the data of the thread corresponding to the thread bundle. When the data request of a thread bundle matches a table entry, the data in the table entry will be sent to the subsequent execution unit for operation after data restoration.
[0034] Example 2 A device for accelerating image transmission operations based on GPGPU, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: The memory is used to store computer programs; The processor is configured to execute, by running a program stored in the memory: The dual-end path processing unit selects a write-back path of the far-end path, a write-back path of the near-end path, a read-out path of the far-end path, and a read-out path of the near-end path.
[0035] Example 3 A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements: The dual-end path processing unit selects a write-back path of the far-end path, a write-back path of the near-end path, a read-out path of the far-end path, and a read-out path of the near-end path.
[0036] It should be understood that in the various embodiments of this document, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.
[0037] It should also be understood that in the embodiments of this document, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects before and after are in an "or" relationship.
[0038] Those of ordinary skill 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, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can 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 this article.
[0039] Those skilled in the art can clearly understand that, for the convenience and brevity 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.
[0040] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and 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 mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.
[0041] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.
[0042] In addition, each functional unit in each embodiment of this invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
[0043] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this article. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0044] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for reading and storing near and far path data based on GPGPU, characterized in that: include: Establishing a dual-end path processing unit, the dual-end path processing unit is composed of a pre-processing module, a near-far end path selection module, and an active thread warp data table entry cache unit; The dual-end path processing unit selects a write-back path of a far-end path, a write-back path of a near-end path, a read-out path of a far-end path, and a read-out path of a near-end path.
2. The method for reading and storing near and far path data based on GPGPU according to claim 1, characterized in that: The preprocessing module includes a mean calculation unit, a difference calculation unit, and a mean splicing unit. The operation results generated by each register block of the GPGPU are input into the mean calculation unit for cumulative average operation. The difference calculation unit performs difference operation on the operation results generated by each register block and the average value respectively. The difference splicing unit splices each difference to obtain preprocessed data.
3. The method for reading and storing near and far path data based on GPGPU according to claim 2, characterized in that: The write-back path for the remote path is: Inputting the operation results generated by the register block of the GPGPU into the preprocessing module of the dual-end path processing unit for preprocessing; The near-far path selection module reads the active state of the corresponding warp in the active warp data entry cache unit, determines the warp state as inactive, and writes the preprocessed data into the register block of the GPGPU through the GPGPU arbiter.
4. The method for reading and storing near and far path data based on GPGPU according to claim 2, characterized in that: The read path of the remote path is: After the control instruction is sent to the operand collector unit of the GPGPU, the operand collector unit parses the register required by the current control instruction, and the operand collector unit sends a read instruction to the arbiter of the GPGPU; The GPGPU arbiter sends the read instruction to the corresponding register block; After responding to the instruction data, the register block returns the corresponding instruction data to the operand collector unit through the cross switch of the GPGPU, and the operand collector unit sends the instruction data to the execution unit of the GPGPU for calculation.
5. The method for reading and storing near and far path data based on GPGPU according to claim 2, characterized in that: The write-back path for the near-end path is: Inputting the operation results generated by the register block of the GPGPU into the preprocessing module of the dual-end path processing unit for preprocessing; The near-far path selection module reads the active state of the corresponding warp in the active warp data entry cache unit, determines the state of the warp as active, and writes the preprocessed data into the active warp data entry cache unit.
6. The method for reading and storing near and far path data based on GPGPU according to claim 2, characterized in that: The read path of the proximal path is: The control instruction is sent to the dual-end path processing unit, and the dual-end path processing unit reads from the active thread warp data table entry cache unit according to the control instruction; The read data is restored and sent to the execution unit of the GPGPU for calculation.
7. The method for reading and storing near and far path data based on GPGPU according to claim 1, characterized in that: The active warp data entry cache unit is composed of WID, active state, and each thread data, where WID is the ID of the corresponding warp.
8. A device for accelerating image transmission operations based on GPGPU, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: The memory is used to store computer programs; The processor is configured to execute, by running a program stored in the memory: The dual-end path processing unit selects a write-back path of the far-end path, a write-back path of the near-end path, a read-out path of the far-end path, and a read-out path of the near-end path.
9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, which, when executed by a processor, implements: The dual-end path processing unit selects a write-back path of the far-end path, a write-back path of the near-end path, a read-out path of the far-end path, and a read-out path of the near-end path.
