GPU-based data-intensive task scheduling method and device and storage medium
By introducing DMA controller and PCIe-D controller in the GPU computing system, the parallel transmission characteristics of the PCIe bus are used to solve the problem of the PCIe interface transmission speed bottleneck, the GPU computing efficiency and data transmission speed are improved, and the faster Task execution.
Patent Information
- Application Number
- CN202411096076.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-15
AI Technical Summary
The transmission speed of the PCIe interface has become a bottleneck in improving GPU computing capabilities. Especially in tasks such as image and video processing and data analysis, frequent data interaction and large data transmission are required, and it is difficult to meet real-time processing requirements under existing hardware conditions.
By designing a GPU-based data-intensive task scheduling method, using the H-Bus and D-Bus bus between the host and the acceleration card for data transmission, the DMA controller and PCIe-D controller are introduced to realize data parallelism Upload, calculate and download, make full use of the full duplex characteristics of the PCIe bus, and reduce the overall execution time of the task.
Effectively improves the utilization rate and computing efficiency of GPU, reduces the power consumption during storage area and reading, and reduces the overall execution time of tasks, especially in tasks such as processing images and video filtering, achieving faster data Transmission and calculation.
Smart Images

Figure CN118964029A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of GPU computing technology, and in particular to a GPU-based data-intensive task scheduling method, device and storage medium. Background Art
[0002] With the development of high-performance computing, the performance of GPUs has been continuously improved, while the cost has been continuously reduced, which has led to more and more computing tasks being turned to GPUs. There are many factors that limit the computing speed of GPUs, including hardware factors such as the number of cores and clock speed, memory capacity and bandwidth, and the transmission speed of the PCIe interface, as well as software factors such as algorithm and code optimization, data layout, and memory management.
[0003] At present, mainstream GPUs have reached a very high level in terms of hardware parameters such as the number of cores and clock speed, memory capacity and bandwidth, especially HBM3 (High Bandwidth Memory 3) in GPUs, which has reached an astonishing bandwidth of 3.35TB / s. As the most mainstream interface standard for servers and storage systems, the transmission speed of its latest version PCIe5.0 is only 128GB / s, which is much lower than the 900GB / s transmission speed of the SXM interface designed specifically for high-performance computing. Due to the advantages of the PCIe interface in terms of compatibility, size, cost, etc., the PCIe interface is still the most widely used GPU interface.
[0004] The transmission speed of PCIe has become a bottleneck for improving GPU computing capabilities, especially in computing tasks such as image and video processing, image rendering, data analysis, encryption, etc. These tasks usually require frequent data interaction between the host and the device, involve a large amount of data to be processed and transmitted, and require real-time or near real-time processing speed. Under the existing hardware technology conditions, we can only meet the task requirements by optimizing the management and scheduling of GPUs to the maximum extent. Summary of the invention
[0005] In order to overcome the deficiencies of the above technologies, the present invention provides a GPU-based data-intensive task scheduling method, device and storage medium for improving GPU utilization and reducing the overall task execution time.
[0006] The technical solution adopted by the present invention to overcome the technical problems is: A data-intensive task scheduling method based on GPU includes a host and an accelerator card, wherein the host is composed of a CPU, a DDR memory, and a PCie-H controller, and the accelerator card is composed of a GPU, a DMA controller, a GDDR memory, and a PCIe-D controller: The host uploads the data to the accelerator card; The accelerator card uses the driver to set the GPU to use the data in the GDDR memory for calculation; The host downloads the data calculated by the accelerator card.
[0007] Furthermore, the CPU, DDR memory, and PCie-H controller of the host are connected to each other via an H-Bus.
[0008] Furthermore, the GPU, DMA controller, GDDR memory, and PCIe-D controller of the above-mentioned acceleration card are connected to each other via a D-Bus bus.
[0009] Furthermore, the method for the host to upload data to the accelerator card is: An application running on the host CPU sets up and starts a DMA transfer; The DMA controller sends a DMA request to the PCIe-D controller; The PCIe-D controller encapsulates the request into a PCIe packet and transmits it to the PCie-H controller via the PCIe bus; The PCie-H controller parses the received PCIe packet to obtain the source address where the data is currently stored in the DDR memory; The PCie-H controller reads data from the DDR memory and encapsulates it into PCIe packets, which are then sent to the PCIe-D controller via the PCIe bus; After receiving the PCIe packet, the PCIe-D controller parses it, obtains the target address for receiving data in the GDDR memory, and saves the PCIe packet to the corresponding position in the GDDR memory; The PCIe-D controller sends a transfer completion interrupt request to the PCie-H controller via the PCIe bus; The PCie-H controller passes the interrupt request to the application running on the host CPU through the accelerator card's driver.
[0010] Furthermore, the transmission parameters of the DMA transmission are set to include a source address where the data is currently stored, a length of the data, and a target address for receiving the data.
[0011] Furthermore, the method for the host to download the data calculated by the acceleration card is: An application running on the host CPU sets up and starts a DMA transfer; The PCIe-D controller reads data from the GDDR memory and encapsulates it into a PCIe packet and sends it through the PCIe bus; The PCie-H controller parses the received PCie packet to determine the target address in the DDR memory for receiving data, and stores the data in the corresponding location of the DDR memory; The driver of the accelerator card sends a message of transmission completion to the application running on the CPU, and the application reads the data from the DDR memory.
[0012] On the other hand, the present invention also relates to a data-intensive task scheduling device based on a GPU, 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 host uploads the data to the accelerator card; The accelerator card uses the driver to set the GPU to use the data in the GDDR memory for calculation; The host downloads the data calculated by the accelerator card.
[0013] 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 host uploads the data to the accelerator card; The accelerator card uses the driver to set the GPU to use the data in the GDDR memory for calculation; The host downloads the data calculated by the accelerator card.
[0014] The beneficial effects of the present invention are: improving the method of reading register files of GPGPU, dividing the data path of writing register files into a far-end path and a near-end path through a dual-end path processing unit, selecting different paths according to different thread activity levels, and performing data preprocessing when storing each path, thereby reducing the storage area and power consumption when reading. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a structural schematic diagram of a GPU-based data-intensive task scheduling device of the present invention; Figure 2 A flow chart of data upload for scheduling computing tasks of the present invention; Figure 3 A flow chart of data downloading for scheduling computing tasks of the present invention; Figure 4 This is a time-consuming comparison chart of the computing task scheduling of the present invention. DETAILED DESCRIPTION
[0016] The following is combined with Figure 1 To Attachment Figure 4The 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.
[0017] 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.
[0018] 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.
[0019] Example 1 As attached Figure 1 As shown, a data-intensive task scheduling method based on GPU includes a host and an accelerator card, wherein the host is composed of a CPU, a DDR memory (Double Data Rate SDRAM), and a PCie-H controller (Peripheral Component Interface Express Host), and the accelerator card is composed of a GPU, a DMA controller (Direct Memory Access), a GDDR memory (Graphics Double Data Rate SDRAM), and a PCIe-D controller (Peripheral Component Interface Express Device).
[0020] The host uploads the data to the accelerator card.
[0021] The accelerator card configures the GPU through the driver to use the data in the GDDR memory for calculation.
[0022] The host downloads the data calculated by the accelerator card.
[0023] The application running on the host CPU can operate the DMA controller of the accelerator card through the driver of the accelerator card, including setting DMA transfer parameters and starting DMA transfer. The transfer parameters include the source address where the data is currently stored, the length of the data, the target address for receiving data, etc. When the host sends data to the accelerator card, that is, uploading data, the source address is in DDR and the target address is in GDDR. When the host reads data from the accelerator card, that is, downloading data, the source address is in GDDR and the target address is in DDR.
[0024] In this embodiment, the CPU, DDR memory, and PCie-H controller of the host are connected to each other via an H-Bus.
[0025] In this embodiment, the GPU, DMA controller, GDDR memory, and PCIe-D controller of the acceleration card are connected to each other via a D-Bus bus.
[0026] As attached Figure 2 As shown, in this embodiment, the method for the host to upload data to the acceleration card is: An application running on the host CPU sets up and starts a DMA transfer.
[0027] The DMA controller sends a DMA request to the PCIe-D controller.
[0028] The PCIe-D controller encapsulates the request into a PCIe packet and transmits it to the PCie-H controller via the PCIe bus; The PCie-H controller parses the received PCIe packet to obtain the source address where the data is currently stored in the DDR memory.
[0029] The PCie-H controller reads data from the DDR memory and encapsulates it into PCIe packets, which are then sent to the PCIe-D controller via the PCIe bus.
[0030] After receiving the PCIe packet, the PCIe-D controller parses it, obtains the target address for receiving data in the GDDR memory, and saves the PCIe packet to the corresponding position in the GDDR memory.
[0031] The PCIe-D controller sends a transfer completion interrupt request to the PCie-H controller via the PCIe bus.
[0032] The PCie-H controller passes the interrupt request to the application running on the host CPU through the accelerator card's driver.
[0033] In this embodiment, the transmission parameters for setting the DMA transmission include the source address where the data is currently stored, the length of the data, and the target address for receiving the data.
[0034] As attached Figure 3 As shown, in this embodiment, the method for the host to download the data calculated by the acceleration card is: An application running on the host CPU sets up and starts a DMA transfer.
[0035] The PCIe-D controller reads data from the GDDR memory and encapsulates it into PCIe packets and sends it through the PCIe bus.
[0036] The PCie-H controller parses the received PCie packet to determine the target address in the DDR memory for receiving data, and stores the data in the corresponding position of the DDR memory.
[0037] The driver of the accelerator card sends a message of transmission completion to the application running on the CPU, and the application reads the data from the DDR memory.
[0038] As attached Figure 4 As shown in the figure, the execution process of three consecutive computing tasks can be simply described as: upload 1, calculation 1, download 1, upload 2, calculation 2, download 2, upload 3, calculation 3, download 3. If each upload, calculation, and download takes 1 second, the three computing tasks take a total of 9 seconds.
[0039] If we observe carefully, we can find that when the GPU is calculating, the PCIe bus is in an idle state. GPU calculation only depends on whether the required data is ready, that is, when upload 1 is completed, calculation 1 can be executed in parallel with upload 2. Because the PCIe bus has a full-duplex feature, that is, upload, download and calculation can be executed in parallel. Data downloading only depends on whether the required data is ready.
[0040] As attached Figure 4 As shown in the figure, calculation 1 is executed in parallel with upload 2, download, calculation 2 and upload 3 are executed in parallel, and download 2 is executed in parallel with calculation 3. The PCIe bus continuously executes 3 data upload tasks without any idle time. After calculation 1 is completed, the PCIe bus continuously executes 3 data download tasks without any idle time. At this time, the total time taken for the 3 calculation tasks is 5 seconds.
[0041] In view of the above time-consuming analysis, when processing computing tasks that do not require data order, such as image segmentation and image filtering, we should fully segment the data set, and then transmit and calculate in blocks to make full use of the parallelism of GPU computing and PCIe transmission.
[0042] When processing video filtering, video frame processing, and other tasks that have requirements or strict requirements on data order, the data set should be appropriately segmented and then transmitted and calculated in blocks to fully utilize the parallelism of GPU computing and PCIe transmission and reduce the overall task time.
[0043] The introduction of a DMA controller in the accelerator card eliminates the need for host CPU intervention during data transmission, reduces CPU burden, and improves the execution efficiency of host applications.
[0044] Example 2 A GPU-based data-intensive task scheduling device comprises: 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 host uploads the data to the accelerator card.
[0045] The accelerator card configures the GPU through the driver to use the data in the GDDR memory for calculation.
[0046] The host downloads the data calculated by the accelerator card.
[0047] 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 host uploads the data to the accelerator card.
[0048] The accelerator card configures the GPU through the driver to use the data in the GDDR memory for calculation.
[0049] The host downloads the data calculated by the accelerator card.
[0050] 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.
[0051] 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.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] Finally, it should be noted that the above 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 data-intensive task scheduling method based on GPU, comprising a host and an accelerator card, wherein the host is composed of a CPU, a DDR memory, and a PCie-H controller, and the accelerator card is composed of a GPU, a DMA controller, a GDDR memory, and a PCIe-D controller, and is characterized in that: The host uploads the data to the accelerator card; The accelerator card uses the driver to set the GPU to use the data in the GDDR memory for calculation; The host downloads the data calculated by the accelerator card.
2. The GPU-based data-intensive task scheduling method according to claim 1, characterized in that: The CPU, DDR memory and PCie-H controller of the host are connected to each other via an H-Bus.
3. The GPU-based data-intensive task scheduling method according to claim 1, characterized in that: The GPU, DMA controller, GDDR memory, and PCIe-D controller of the acceleration card are connected to each other via a D-Bus bus.
4. The GPU-based data-intensive task scheduling method according to claim 1, characterized in that: The method for the host to upload data to the accelerator card is: An application running on the host CPU sets up and starts a DMA transfer; The DMA controller sends a DMA request to the PCIe-D controller; The PCIe-D controller encapsulates the request into a PCIe packet and transmits it to the PCie-H controller via the PCIe bus; The PCie-H controller parses the received PCIe packet to obtain the source address where the data is currently stored in the DDR memory; The PCie-H controller reads data from the DDR memory and encapsulates it into PCIe packets, which are then sent to the PCIe-D controller via the PCIe bus; After receiving the PCIe packet, the PCIe-D controller parses it, obtains the target address for receiving data in the GDDR memory, and saves the PCIe packet to the corresponding position in the GDDR memory; The PCIe-D controller sends a transfer completion interrupt request to the PCie-H controller via the PCIe bus; The PCie-H controller passes the interrupt request to the application running on the host CPU through the accelerator card's driver.
5. The GPU-based data-intensive task scheduling method according to claim 4, characterized in that: The transmission parameters for setting DMA transmission include the source address where the data is currently stored, the length of the data, and the target address for receiving the data.
6. The GPU-based data-intensive task scheduling method according to claim 4, characterized in that: The method for the host to download the data calculated by the acceleration card is: An application running on the host CPU sets up and starts a DMA transfer; The PCIe-D controller reads data from the GDDR memory and encapsulates it into a PCIe packet and sends it through the PCIe bus; The PCie-H controller parses the received PCie packet to determine the target address in the DDR memory for receiving data, and stores the data in the corresponding location of the DDR memory; The driver of the accelerator card sends a message of transmission completion to the application running on the CPU, and the application reads the data from the DDR memory.
7. A data-intensive task scheduling device based on GPU, 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 host uploads the data to the accelerator card; The accelerator card uses the driver to set the GPU to use the data in the GDDR memory for calculation; The host downloads the data calculated by the accelerator card.
8. 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 host uploads the data to the accelerator card; The accelerator card uses the driver to set the GPU to use the data in the GDDR memory for calculation; The host downloads the data calculated by the accelerator card.
Citation Information
Cited By
SIMT architecture accelerator card debugging method, equipment and medium
CN119557237A
A SIMT architecture accelerator card debugging method, device and medium
CN119557237B
