Method, system, device, product and equipment for data transmission between graphics processing units
By introducing field programmable gate array accelerators between graphics processing units, and using reservation mechanisms and RDMA technology, the delay and throughput problems of data transmission between graphics processing units are solved, and efficient data transmission acceleration is achieved.
Patent Information
- Application Number
- CN202410843558.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-27
AI Technical Summary
Data transmission between graphics processing units has problems of high latency and low throughput, especially in large models and complex neural network application scenarios. The existing CPU polling mechanism and GPU memory mapping mechanism both have latency and memory usage. question.
Using a field programmable gate array accelerator (FPGA) as an intermediary, by receiving the direct memory access data transmission service reservation request message of the graphics processing unit, the reservation execution time interval is determined based on the reservation waiting error coefficient, and the reservation execution time interval is determined in the target FPGA accelerator in sequence Data transmission uses RDMA technology for low-latency data transmission to avoid delays introduced by routing and forwarding.
It reduces the latency of data transmission between graphics processing units, improves throughput, decouples the strong binding between FPGA accelerator and GPU, improves the efficiency and reliability of data transmission, and is suitable for accelerating data transmission between multiple GPUs.
Smart Images

Figure CN118410001B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a method, system, device, product and equipment for data transmission between graphics processing units. Background Art
[0002] Graphics Processing Units (GPUs) are widely used in typical application scenarios such as large models and complex neural networks. A large number of manufacturers at home and abroad deploy a large number of commercial GPUs on their servers to accelerate applications, which generates a large amount of data and requires frequent data transmission between GPUs. Most manufacturers use GPUs as server Peripheral Component Interconnect Express (PCIe) devices, and interconnect servers equipped with GPUs through the network to form a cluster. The data transmission methods supported by PCIe include direct memory access (DMA). Controlling direct memory access data transmission between GPUs can be divided into: direct memory access data transmission between GPUs controlled by the central processing unit (CPU) and direct memory access data transmission between GPUs controlled by the GPU.
[0003] The direct memory access data transmission method between graphics processing units controlled by the central processor has problems such as long central processor polling time, while the direct memory access data transmission method between graphics processing units controlled by the graphics processing units has problems such as reduced graphics processing unit throughput due to excessive occupation of graphics processing unit memory.
[0004] It can be seen that how to solve the problems of high latency and low throughput in data transmission between graphics processing units is a technical problem that people in this field need to solve urgently. Summary of the invention
[0005] The purpose of the present invention is to provide a method, system, device, product and equipment for data transmission between graphics processing units to solve the technical problems of high latency and low throughput in data transmission between graphics processing units.
[0006] In order to solve the above technical problems, the present invention provides a method for data transmission between graphics processing units, which is applied to an initial field programmable gate array accelerator. The method comprises:
[0007] Receiving a direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission;
[0008] Determine the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in each of the direct memory access data transmission service reservation request messages; wherein the reservation execution time interval is the time interval for each direct memory access data transmission service to be executed;
[0009] A target field programmable gate array accelerator is obtained so that data can be read from a corresponding sending graphics processing unit in the target field programmable gate array accelerator in the order of each reserved execution time interval and the data can be transmitted to a receiving graphics processing unit by direct memory access; wherein the target field programmable gate array accelerator is the initial field programmable gate array accelerator and / or the target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator.
[0010] On the one hand, the step of acquiring a target field programmable gate array accelerator so as to read data from a corresponding sender graphics processing unit in the target field programmable gate array accelerator in the order of each scheduled execution time interval and transmit the data to a receiver graphics processing unit by direct memory access includes:
[0011] In the case where the reserved execution time intervals corresponding to the multiple requests received at the same time overlap, determining that the target field programmable gate array is the initial field programmable gate array accelerator and the target interconnected field programmable gate array accelerator; or, in the case where a new request is received, if the reserved execution time interval corresponding to the new request overlaps with the reserved execution time interval corresponding to the received request, determining that the target field programmable gate array is the target interconnected field programmable gate array accelerator;
[0012] In the initial field programmable gate array accelerator, data is read from the corresponding sending graphics processing unit in the order of the first reserved execution time interval and the data is transmitted to the receiving graphics processing unit by direct memory access, and a target direct memory access data transmission service reservation request message is sent to the target interconnected field programmable gate array accelerator, so that in the target interconnected field programmable gate array accelerator, data is read from the corresponding sending graphics processing unit in the order of the second reserved execution time interval and the data is transmitted to the receiving graphics processing unit by direct memory access;
[0013] The first reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in the remaining direct memory access data transmission service reservation request messages, the remaining direct memory access data transmission service reservation request messages are reservation request messages other than the target direct memory access data transmission service reservation request message among all direct memory access data transmission service reservation request messages received by the initial field programmable gate array accelerator, and the second reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in each target direct memory access data transmission service reservation request message;
[0014] Alternatively, when there is no overlap between the reserved execution time intervals corresponding to the received requests, the target field programmable gate array is determined to be the initial field programmable gate array accelerator, so that data can be read from the corresponding sender graphics processing unit in the initial field programmable gate array accelerator in the order of the reserved execution time intervals and the data can be transmitted to the receiving graphics processing unit using direct memory access.
[0015] On the other hand, determining the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in the direct memory access data transmission service reservation request message includes:
[0016] Obtaining a product result of a reservation waiting error coefficient and a time taken by a field programmable gate array accelerator with a first preset number to transmit data of a sender graphics processing unit with a second preset number;
[0017] Obtaining a difference between the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result, and using the difference as the start time of the reservation execution time interval;
[0018] Obtain the reservation time point in the direct memory access data transmission service reservation request message, the multiplication result, the time taken by the field programmable gate array accelerator with the first preset number to transmit the data of the sender graphics processing unit with the second preset number, and the sum of the time taken by the direct storage access internal logic of the field programmable gate array accelerator with the first preset number to process the data of the sender graphics processing unit with the second preset number, and use the sum as the end time of the reservation execution time interval.
[0019] On the other hand, the step of reading data from the corresponding sending GPU in the target FPGA accelerator in the order of the scheduled execution time intervals and transmitting the data to the receiving GPU by direct memory access includes:
[0020] Determining whether the target field programmable gate array accelerator and the graphics processing unit of the sender of the data to be read belong to the same server;
[0021] If not, the target field programmable gate array accelerator reads data from the corresponding sender graphics processing unit in the order of the scheduled execution time intervals using remote direct memory access technology, and transmits the data to the receiver graphics processing unit using direct memory access.
[0022] On the other hand, the kernel in the field programmable gate array accelerator includes a data transmission sub-kernel and a task control sub-kernel; wherein the data transmission sub-kernel is used to perform data transmission operations, and the task control sub-kernel is used to perform graphics processing unit data task scheduling transmission operations.
[0023] On the other hand, a direct memory access reservation transmission queue and a direct memory access actual transmission queue are constructed in the data transmission sub-core of the field programmable gate array accelerator;
[0024] After receiving the direct memory access data transmission service reservation request message sent by each sending graphics processing unit under the same routing subnet, the method further includes:
[0025] storing each of the direct memory access data transmission service reservation request messages in the direct memory access reservation transmission queue;
[0026] The step of reading data from the corresponding sending GPU in the target FPGA accelerator in the order of the scheduled execution time intervals and transmitting the data to the receiving GPU by direct memory access includes:
[0027] In the target field programmable gate array accelerator, the direct memory access actual transmission queue of the target field programmable gate array accelerator reads data from the corresponding sending graphics processing unit in the order of each reserved execution time interval and transmits the data to the receiving graphics processing unit using a direct memory access method.
[0028] On the other hand, before the data is transmitted to the receiving graphics processing unit in a direct memory access manner, the method further includes:
[0029] Starting from the direct memory access actual transmission queue of the target field programmable gate array accelerator, reading data from the second preset numbered sender graphics processing unit in the order of each scheduled execution time interval, determining whether data reading from the memory address of the data to be transmitted of the second preset numbered sender graphics processing unit is completed within the preset time interval;
[0030] If yes, then entering the step of transmitting the data to the receiving party's graphics processing unit by direct memory access;
[0031] If not, the direct memory access actual transmission queue of the target field programmable gate array accelerator stops performing direct memory access data transmission service on the sender graphics processing unit with the second preset number; and sends to the sender graphics processing unit with the second preset number information representing that the direct memory access data transmission service is to be performed by the central processor of the server where the sender graphics processing unit with the second preset number is located.
[0032] On the other hand, the starting time of the preset time interval is the difference between the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result, and the end time of the preset time interval is the sum of the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result.
[0033] On the other hand, the receiving of direct memory access data transmission service reservation request messages sent by the sending graphics processing units under the same routing subnet includes:
[0034] The direct memory access data transmission service reservation request message is sent when all threads in the same thread group of each sending graphics processing unit reach a preset computing stage of the computing task, wherein the computing task completed in the preset computing stage is greater than half of all computing tasks.
[0035] On the other hand, determining the target interconnected field programmable gate array accelerator includes:
[0036] The target interconnected field programmable gate array accelerator is obtained from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel; wherein the remaining field programmable gate array accelerators are field programmable gate array accelerators other than the initial field programmable gate array accelerator in all field programmable gate array accelerators under the same routing subnet.
[0037] In another aspect, the method further comprises:
[0038] If the target interconnected field programmable gate array accelerator is not obtained from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel, information representing that a direct memory access data transmission service is to be executed by a central processor of a server where the second preset numbered sender graphics processing unit is located is sent to the sender graphics processing unit with a second preset number.
[0039] On the other hand, the acquiring the target interconnected field programmable gate array accelerator from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel includes:
[0040] In the case where it is detected that the direct memory access data transmission service cannot be provided within the reserved execution time interval, first information for characterizing data transmission assistance is sent to the interconnected field programmable gate array accelerator in a multicast manner, and a direct memory access data transmission service reservation request message of the sender graphics processing unit is forwarded to the interconnected field programmable gate array accelerator under the same routing subnet to implement a first handshake;
[0041] receiving second information sent by each of the interconnected field programmable gate array accelerators to implement a second handshake; wherein the second information is used to indicate whether the interconnected field programmable gate array accelerator can or cannot provide a direct memory access data transmission service within the second scheduled execution time interval;
[0042] Sending third information to each interconnected field programmable gate array accelerator to implement a third handshake; wherein the third information includes information indicating that the second information sent by the interconnected field programmable gate array accelerator has been received, and sending information to each interconnected field programmable gate array accelerator indicating whether the accelerator is selected or not selected as the target interconnected field programmable gate array accelerator;
[0043] Receive fourth information sent by each interconnected field programmable gate array accelerator to implement a fourth handshake; wherein the fourth information includes information indicating that it is known that the initial interconnected field programmable gate array accelerator has received the third information, and information that the scheduling operation is completed or not completed according to the third information.
[0044] On the other hand, if the received second information is information indicating that the interconnected field programmable gate array accelerator can provide a direct memory access data transmission service within the second reserved execution time interval, the second information at least includes an actual bandwidth of the interconnected field programmable gate array accelerator and a reserved waiting error coefficient;
[0045] Determining whether an interconnect FPGA accelerator is selected or not selected includes:
[0046] If the received second information is information indicating that the interconnected field programmable gate array accelerator cannot provide a direct memory access data transmission service within the second scheduled execution time interval, determining that the interconnected field programmable gate array accelerator is not selected;
[0047] If the received second information is information indicating that the interconnected field programmable gate array accelerator can provide direct memory access data transmission service within the second scheduled execution time interval, the interconnected field programmable gate array accelerator that can provide direct memory access data transmission service within the second scheduled execution time interval is determined to be a pending interconnected field programmable gate array accelerator, and the pending interconnected field programmable gate array accelerators are sorted according to the order of the second scheduled execution time intervals corresponding to the pending interconnected field programmable gate array accelerators, and it is determined that the pending interconnected field programmable gate array accelerator with the earliest end time among all the pending interconnected field programmable gate array accelerators is selected, and it is determined that the interconnected field programmable gate array accelerators other than the pending interconnected field programmable gate array accelerator with the earliest end time among all the pending interconnected field programmable gate array accelerators are not selected.
[0048] In another aspect, the method further comprises:
[0049] If there are multiple pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point among all the pending interconnection field programmable gate array accelerators, one pending interconnection field programmable gate array accelerator is randomly selected from all the pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point as the target interconnection field programmable gate array accelerator.
[0050] On the other hand, it also includes:
[0051] Since the third information is sent to each interconnected field programmable gate array accelerator, if the fourth information sent by the interconnected field programmable gate array accelerator is not received within the first preset time period, fifth information is sent to the interconnected field programmable gate array accelerator that has not sent the fourth information, so that the interconnected field programmable gate array accelerator that has not sent the fourth information processes the preset reservation request within the reservation execution time interval corresponding to the direct memory access reservation transmission queue after receiving the fifth information; wherein the fifth information is information used to represent the cancellation of the interconnected field programmable gate array accelerator that has not sent the fourth information to perform data transmission service assistance.
[0052] On the other hand, it also includes:
[0053] Since the third information is sent to each interconnected field programmable gate array accelerator, if the fourth information sent by all the interconnected field programmable gate array accelerators is not received within a second preset time period, information representing that a direct memory access data transmission service is to be executed by the central processor of the server where the sender graphics processing unit with the second preset number is located is sent to the sender graphics processing unit with the second preset number.
[0054] In order to solve the above technical problems, the present invention also provides a data transmission system between graphics processing units, comprising: multiple field programmable gate array accelerators, multiple graphics processing units and routers, the same routing subnet includes multiple field programmable gate array accelerators, one or more groups of sender graphics processing units and receiver graphics processing units, all field programmable gate array accelerators under the same routing subnet include an initial field programmable gate array accelerator, and the initial field programmable gate array accelerator is used to:
[0055] Receiving a direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission;
[0056] Determine the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in each of the direct memory access data transmission service reservation request messages; wherein the reservation execution time interval is the time interval for each direct memory access data transmission service to be executed;
[0057] A target field programmable gate array accelerator is obtained so that data can be read from a corresponding sending graphics processing unit in the target field programmable gate array accelerator in the order of each reserved execution time interval and the data can be transmitted to a receiving graphics processing unit by direct memory access; wherein the target field programmable gate array accelerator is the initial field programmable gate array accelerator and / or the target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator.
[0058] On the other hand, the number of fiber optic network ports in at least one field programmable gate array accelerator is greater than or equal to 2.
[0059] In order to solve the above technical problems, the present invention further provides a device for data transmission between graphics processing units, which is applied to an initial field programmable gate array accelerator, and the device comprises:
[0060] A receiving module, configured to receive a direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission;
[0061] A determination module, configured to determine a reservation execution time interval according to a reservation waiting error coefficient and a reservation time point in each of the direct memory access data transmission service reservation request messages; wherein the reservation execution time interval is a time interval for each direct memory access data transmission service to be executed;
[0062] The acquisition module is used to acquire a target field programmable gate array accelerator, so as to read data from the corresponding sender graphics processing unit in the target field programmable gate array accelerator in the order of each reserved execution time interval and transmit the data to the receiver graphics processing unit by direct memory access; wherein the target field programmable gate array accelerator is the initial field programmable gate array accelerator and / or the target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator.
[0063] In order to solve the above technical problem, the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned method for transmitting data between graphics processing units when executed by a processor.
[0064] In order to solve the above technical problems, the present invention further provides a data transmission device between graphics processing units, comprising:
[0065] Memory for storing computer programs;
[0066] The processor is used to implement the steps of the above-mentioned method for transmitting data between graphics processing units when executing the computer program.
[0067] In order to solve the above technical problem, the present invention further provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned method for transmitting data between graphics processing units are implemented.
[0068] In the data transmission method between graphics processing units applied to the initial field programmable gate array accelerator provided by the present invention, direct memory access data transmission service reservation request messages sent by each sending graphics processing unit under the same routing subnet are received, and the reservation execution time interval is determined according to the reservation waiting error coefficient and the reservation time point in each direct memory access data transmission service reservation request message, and the target field programmable gate array accelerator is obtained, so as to read data from the corresponding sending graphics processing unit in the target field programmable gate array accelerator according to the sequence of each reservation execution time interval and transmit the data to the receiving graphics processing unit by using a direct memory access method.
[0069] The beneficial effects of the present invention are as follows: firstly, compared with the method of directly using the sender graphics processing unit to control data transmission, the method provided by the present invention uses the field programmable gate array accelerator as the control end and utilizes the field programmable gate array accelerator to directly access the memory for data transmission, thereby solving the problem of low throughput caused by avoiding the graphics processing unit as the sender for data transmission; secondly, in the method, each scheduled execution time interval is first set, and then the data is transmitted according to the scheduled execution time interval, and there is no need to obtain the message when transmitting the data, thereby reducing the delay; thirdly, the initial field programmable gate array accelerator receives the direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet, and the target field programmable gate array accelerator and the initial field programmable gate array accelerator belong to the same routing subnet, thereby avoiding the data transmission delay caused by introducing routing forwarding, etc., and reducing the latency. The method reduces signal interference and improves the efficiency of data transmission; in addition, in the method, the field programmable gate array accelerator can receive direct memory access data transmission service reservation request messages sent by multiple sender graphics processing units, that is, one field programmable gate array accelerator can process the data transmission of multiple sender graphics processing units, avoiding the strong coupling between the field programmable gate array accelerator and the graphics processing unit (such as one field programmable gate array accelerator corresponds to one sender graphics processing unit and one receiver graphics processing unit), while improving the utilization rate of direct memory access data transmission of the field programmable gate array accelerator, so that each field programmable gate array accelerator can assist more sender graphics processing units under the same routing subnet to complete data transmission acceleration; furthermore, when determining each reservation execution time interval, the reservation waiting error coefficient is taken into account, so that the determined reservation execution time interval has a certain fault tolerance, and the reliability of data transmission is improved.
[0070] In addition, when it is detected that the scheduled execution time intervals overlap, the target interconnected FPGA accelerator reads data from the corresponding sender graphics processing unit in the order of the second scheduled execution time interval and transmits the data to the receiver graphics processing unit by direct memory access. That is, when the initial FPGA accelerator cannot provide direct memory access data transmission service in the overlapping scheduled execution time interval, the target interconnected FPGA accelerator belonging to the same routing subnet as the initial FPGA accelerator performs the direct memory access data transmission service, which reduces the data transmission delay and improves the utilization rate of the FPGA accelerators under the same routing subnet.
[0071] When the field programmable gate array accelerator that performs the data transmission service and the graphics processing unit of the sender do not belong to the same server host, the network communication technology of remote direct memory access is adopted to reduce the latency;
[0072] Including a data transmission sub-core and a task control sub-core in the core of the field programmable gate array accelerator can realize more efficient, reliable and flexible processing of data transmission;
[0073] A direct memory access reservation transmission queue and a direct memory access actual transmission queue are constructed in the data transmission sub-core of the field programmable gate array accelerator, which avoids the influence of data reservation transmission on actual data transmission and improves the efficiency of data transmission.
[0074] If the FPGA accelerator fails to read the address of the data to be transmitted within the preset time interval, the central processor of the server where the sender's graphics processing unit is located will perform the data transmission service; if the interconnected FPGA accelerator is not obtained after the handshake, the central processor of the server where the sender's graphics processing unit is located will perform the data transmission to ensure that the data transmission service can be completed;
[0075] In the task control sub-core, the target interconnected field programmable gate array accelerator is obtained from the remaining field programmable gate array accelerators based on multiple handshakes, thereby improving the reliability of the selected target interconnected field programmable gate array accelerator;
[0076] The pending interconnection field programmable gate array accelerators are sorted in the order of the second scheduled execution time intervals corresponding to the pending interconnection field programmable gate array accelerators, and the pending interconnection field programmable gate array accelerator with the earliest end time among all the pending interconnection field programmable gate array accelerators is selected as the target interconnection field programmable gate array accelerator, thereby improving the efficiency of data transmission.
[0077] In addition, the present invention also provides an inter-graphics processing unit data transmission system, an inter-graphics processing unit data transmission system, an inter-graphics processing unit data transmission device, a computer program product, an inter-graphics processing unit data transmission device and a non-volatile storage medium, which have the same or corresponding technical features as the above-mentioned inter-graphics processing unit data transmission method applied to the initial field programmable gate array accelerator, and the effects are the same as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0079] Figure 1 A schematic diagram of a CPU-controlled inter-GPU DMA data transmission process provided by an embodiment of the present invention;
[0080] Figure 2 A schematic diagram of a GPU-controlled inter-GPU DMA data transmission process provided by an embodiment of the present invention;
[0081] Figure 3 A schematic diagram of a commercial GPU closed-source black box provided in an embodiment of the present invention causing the sender GPU to be unable to directly trigger a DMA operation;
[0082] Figure 4 A flowchart of a method for data transmission between graphics processing units applied to an initial field programmable gate array accelerator provided by an embodiment of the present invention;
[0083] Figure 5 A tree-type FPGA accelerator DMA parallel transmission acceleration topology diagram based on FPGA accelerator interconnection and multi-sub-core collaboration provided by an embodiment of the present invention;
[0084] Figure 6 A schematic diagram of FPGA core virtualization provided by an embodiment of the present invention;
[0085] Figure 7 A schematic diagram of a reservation execution time interval taking into account a reservation waiting error in a DMA actual transmission queue time axis for processing a transmission request provided by an embodiment of the present invention;
[0086] Figure 8 A schematic diagram of a four-way handshake screening target FPGA accelerator to complete a DMA data transmission service flow of a sender GPU provided by an embodiment of the present invention;
[0087] Fig. 9 A DMA data transmission execution time diagram of an existing FPGA accelerator provided by an embodiment of the present invention;
[0088] Fig.10 A structural diagram of a data transmission device between graphics processing units provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0089] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0090] The core of the present invention is to provide a method, system, device, product and equipment for data transmission between graphics processing units to solve the technical problems of high latency and low throughput in data transmission between graphics processing units.
[0091] Graphics processing units are widely used in typical application scenarios such as large models and complex neural networks. Most manufacturers use graphics processing units as fast peripheral component interconnection devices for servers, and interconnect servers equipped with graphics processing units through the network to form a cluster. The data transmission methods supported by fast peripheral component interconnection include direct memory access. Controlling direct memory access data transmission between graphics processing units can be divided into: direct memory access data transmission between graphics processing units controlled by the central processing unit and direct memory access data transmission between graphics processing units controlled by graphics processing units. Taking the simplest scenario, that is, data transmission between two graphics processing units as an example, the two different data transmission events between graphics processing units involve the same participants, namely: the sending graphics processing unit, the receiving graphics processing unit, and the control end central processing unit. Figure 1 A schematic diagram of a CPU-controlled inter-GPU DMA data transmission process provided by an embodiment of the present invention. In the CPU-controlled inter-GPU DMA data transmission method, the corresponding inter-GPU DMA data moving operation is controlled by CPU polling. It should be noted that Figure 1The contents of the red boxes in the figure represent data. The specific steps are as follows: 1. The sender GPU prepares the data to be transmitted to the receiver GPU, and waits for the CPU polling time to arrive before triggering the DMA data transfer engine of the sender GPU; 2. After the corresponding polling time arrives, the polling process of the control-side CPU will poll the sender GPU to see if the data is ready for DMA data transfer: if so, execute step 3; if not, wait for the next polling time to arrive, and then execute the corresponding polling process; 3. The control-side CPU will send DMA migration instructions and information such as the storage address of the receiver GPU to the sender GPU; 4. After receiving the DMA migration instruction, the sender GPU triggers the DMA data transfer engine and sends the corresponding data to the storage address of the receiver GPU. In this process, the advantages of the CPU-controlled DMA data transfer method between GPUs are: 1) It can ensure that there is no need to waste the thread resources of the sender GPU to control data transfer; 2) The polling mechanism adopted by the CPU is relatively safe and stable, and the DMA data transfer method between GPUs controlled by the GPU may cause various situations such as packet loss of instruction data. The disadvantages are: 1) The CPU polls each GPU at a fixed polling time, instead of the sending GPU that is ready to trigger the CPU to send the corresponding data movement process in time, which introduces a certain waiting delay (for example, for large model parameter migration with a transmission delay of ns, data transmission between GPUs will introduce polling waits of tens of ms); 2) In this polling mechanism, the CPU can only send data movement instructions to one (or a limited number of) sending GPUs at a time, and cannot implement the simultaneous issuance of multiple parallel instructions in the form of a pipeline, so the efficiency is relatively low.
[0092] Figure 2 A schematic diagram of a GPU-controlled inter-GPU DMA data transmission process provided by an embodiment of the present invention. In the GPU-controlled inter-GPU DMA data transmission method, the DMA data transmission operation between two GPUs is led by the sending GPU. It should be noted that Figure 2The contents of the red boxes represent data. The specific steps are: 1. The sender GPU initializes its address space to create a memory mapping space mmap pointing to the memory of the receiver GPU; 2. The sender GPU prepares the data to be transmitted to the receiver GPU, and the GPU thread will copy the data to mmap; 3. The sender GPU thread implicitly performs a DMA transfer operation to send the data to the memory space of the receiver GPU. In this process, the advantages of GPU-controlled inter-GPU DMA data transmission are: 1) No CPU intervention is required, avoiding the delay introduced by the CPU polling mechanism; 2) The workload of the control-side CPU is reduced, and the computing power of the control-side CPU can be used more for services such as context configuration and management within the GPU cluster. The disadvantages are: 1) Memory mapping space needs to be created on the GPU, which will consume a certain amount of memory resources such as registers; 2) DMA data transmission between GPUs controlled by the GPU may result in various situations such as instruction data packet loss. If the relevant packet loss retransmission mechanism is improved, additional delays and GPU memory usage may also be introduced; 3) In the process of using memory mapping space to copy and move data between GPUs, the GPU thread scheduler and the L2 cache on the GPU need to be occupied, which will cause calculation delays for other threads under the same thread scheduler and other threads that need to use the L2 cache. This will lead to a decrease in the computing efficiency of the sender's GPU.
[0093] In order to reduce the repeated reading and writing of operator data between devices such as GPUs and CPUs and improve the computing performance of GPUs, many domestic and foreign artificial intelligence (AI) manufacturers use tensor operator fusion methods in their artificial intelligence frameworks for operators that are intensively interacted between GPUs. By reprogramming tensor operators originally distributed on multiple GPUs so that they can run on the same GPU, data interaction between different GPUs can be effectively reduced. Although such problems can quantize and fuse the calculations originally distributed on multiple operators on a limited number of operators to reduce data transmission between GPUs, there are very few tensor operators that can be fused after all, so the corresponding feasibility will be limited by many factors such as the feasibility of operator fusion and the GPU logical resource situation.
[0094] It can be seen that the shortcomings of the existing inter-GPU DMA data transmission are as follows:
[0095] First, CPU-controlled inter-GPU DMA data transfer will introduce too long a waiting delay due to the polling waiting mechanism executed on the control plane. Compared with the DMA data transfer delay between GPUs, the time overhead is too large, resulting in reduced communication efficiency. GPU-controlled inter-GPU DMA data transfer will introduce a memory mapping mechanism on the data plane of the sender GPU, which will cause the thread scheduler of the sender GPU to be occupied, causing waiting delays for other threads under the same thread scheduler. In addition, the need to occupy the L2 cache will cause execution delays for other threads that need to use the cache. Therefore, there are certain delays and memory overhead issues on both the control plane and the data plane. Figure 3 A schematic diagram of a commercial GPU closed-source black box provided by an embodiment of the present invention causing the sender GPU to be unable to directly trigger DMA operations. It should be noted that Figure 3 The contents of each red box represent data. Figure 3 As shown, since the DMA data transmission and triggering mechanism of commercial GPU manufacturers adopts a black box closed source method, it is impossible to directly start a thread to trigger its own DMA data transmission after the sender GPU completes data preparation.
[0096] Secondly, existing methods such as tensor operator fusion have great limitations, including: 1) Compared with complex neural networks such as large models, there are many tensor operators, but relatively few tensor operators that can be fused. Therefore, the improvement in computing efficiency and the reduction in transmission latency are limited; 2) Complex neural network model scenarios often require the use of multiple GPUs for deployment. Even if tensor operator fusion is used to reduce the amount of computing on a few GPUs, it still does not solve the problems related to CPU-controlled inter-GPU communication and GPU-controlled inter-GPU communication.
[0097] Therefore, in order to solve the problems of high latency and low throughput of DMA data transmission between GPUs in typical usage scenarios such as large models and complex neural networks, the present invention proposes an optimization method for data transmission between GPUs based on DMA mechanism.
[0098] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 4 A flowchart of a method for data transmission between graphics processing units applied to an initial field programmable gate array accelerator provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the method includes:
[0099] S10: Receive direct memory access data transmission service reservation request messages sent by each sender graphics processing unit in the same routing subnet.
[0100] The direct memory access data transmission service reservation request message includes at least a reservation time point, and the reservation time point is a time when the sender's graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission;
[0101] S11: determining a reservation execution time interval according to a reservation waiting error coefficient and a reservation time point in each direct memory access data transmission service reservation request message;
[0102] The scheduled execution time interval is a time interval for each direct memory access data transmission service to be executed;
[0103] S12: Acquire a target FPGA accelerator, so as to read data from the corresponding sender GPU in the target FPGA accelerator in the order of the scheduled execution time intervals and transmit the data to the receiver GPU by direct memory access.
[0104] In order to help those skilled in the art better understand the solutions of the embodiments of the present invention, the application scenarios of the present invention are first described herein. Figure 5 A tree-type FPGA accelerator DMA parallel transmission acceleration topology diagram based on FPGA accelerator interconnection and multi-sub-core collaboration is provided for an embodiment of the present invention. All network terminals such as FPGA accelerators and servers are connected to the network through routers; data transmission between FPGA accelerators and between FPGA accelerators and servers equipped with GPUs are limited to the same routing subnet, without the need for router forwarding, avoiding the introduction of uncontrollable delays caused by routing forwarding and router congestion, and based on the RDMA feature, GPU data on remote servers can be directly read and written. In addition, the number of fiber optic network ports in an FPGA accelerator is greater than or equal to 2, which can support dual-channel bidirectional data transmission. In order to facilitate the distinction between different graphics processing units, field programmable gate array accelerators, routers and servers, each graphics processing unit, field programmable gate array accelerator, router and server is numbered here respectively. As Figure 5In the example, the three routers are numbered 0#, 1#, and 2#; the graphics processing units are numbered 0#, 1#, 2#, 3#, 4#, 5#, 6#, and 7#; the five field programmable gate array accelerators are numbered 0#, 1#, 2#, 3#, and 4#. Among them, the 0# routing subnet includes the 1# router, the 0# server (including the 0# graphics processing unit and the 1# graphics processing unit), the 1# server (including the 2# graphics processing unit and the 3# graphics processing unit), the 0# field programmable gate array accelerator, the 1# field programmable gate array accelerator, and the 2# field programmable gate array accelerator; the 1# routing subnet includes the 2# router, the 2# server (including the 4# graphics processing unit and the 5# graphics processing unit), the 3# server (including the 6# graphics processing unit and the 7# graphics processing unit), the 3# field programmable gate array accelerator, and the 4# field programmable gate array accelerator. Compared with the strong binding of one FPGA accelerator to two GPUs, the embodiment of the present invention uses low-latency network transmission technologies such as RMDA to connect each FPGA accelerator to the GPU cluster network to achieve high-speed interconnection with other FPGA accelerators and GPUs, thereby achieving decoupling between the FPGA accelerator and the two GPUs, thereby providing more FPGA accelerator resources to accelerate GPU data transmission. The kernel in the field programmable gate array accelerator includes a data transmission sub-kernel and a task control sub-kernel; wherein the data transmission sub-kernel is used to perform data transmission operations, and the task control sub-kernel is used to perform graphics processing unit data task scheduling transmission operations. Figure 6 A schematic diagram of FPGA core virtualization provided by an embodiment of the present invention, such as Figure 6 As shown, based on the core virtualization technology, each FPGA accelerator implements the data transmission function and GPU data task scheduling transmission function, and divides each FPGA accelerator core into two sub-cores: a data transmission sub-core and a task control sub-core.
[0105] After determining the tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration, the initial field programmable gate array accelerator is selected from the topology structure for subsequent data transmission processing. In order to more efficiently schedule the use of FPGA accelerator DMA resources to realize inter-GPU data transmission, the present invention proposes an FPGA accelerator DMA scheduling transmission method based on a reservation processing mechanism. It should be noted that, in addition to the sender GPU and the receiver GPU, the FPGA accelerator configured for each sender GPU in the initial stage in the present invention is called the initial FPGA accelerator, and the other FPGA accelerators that are interconnected with the initial FPGA accelerator belong to the same routing subnet (the network accessed through the same router is called the same routing subnet) are called interconnected FPGA accelerators. In addition, in order to avoid the introduction of data transmission delays caused by routing forwarding, the initial FPGA accelerator and the sender GPU belong to the same routing subnet in the present invention. The initial field programmable gate array accelerator receives the direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet. Specifically, receiving the direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet includes:
[0106] The direct memory access data transmission service reservation request message is sent when all threads in the same thread group of each sending graphics processing unit reach the preset computing stage of the computing task, wherein the computing task completed in the preset computing stage is greater than half of all computing tasks.
[0107] For example, the preset calculation stage is the 3 / 4 calculation stage. Since the GPU uses thread groups to manage the concurrent execution of several threads in the same thread group, the present invention sets that when all threads in the same thread group reach the preset calculation stage (such as the 3 / 4 calculation stage) of the calculation task, the sending GPU thread group will send a DMA data transfer service reservation request message to the initial FPGA accelerator.
[0108] The content of the message is not limited. The direct memory access data transmission service reservation request message of the embodiment of the present invention at least includes the reservation time point. (in, Indicates that the current time is the predicted transmission time. is the number of the current GPU in the same routing subnet). In implementation, the reservation time point can be determined according to the performance of the GPU. For example, the specific content of the DMA data transfer service reservation request message includes: the amount of data to be transmitted data_size, the sender GPU host IP address addr_ip_send, the receiver GPU host IP address addr_ip_recv, the sender GPU memory address addr_mem_send used to send the data to be transmitted, the receiver GPU memory address addr_mem_recv used to receive the data to be transmitted, and the sender GPU thread group is expected to be executed by the FPGA accelerator. The reservation time point .
[0109] In order to improve the reliability of the determined appointment execution time interval, after determining the appointment time point, the appointment waiting error coefficient (also known as the acceptable appointment waiting error coefficient) is combined Determine the appointment execution time range.
[0110] Specifically, determining the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in the direct memory access data transmission service reservation request message includes:
[0111] Obtaining a product result of a reservation waiting error coefficient and a time taken by a field programmable gate array accelerator with a first preset number to transmit data of a sender graphics processing unit with a second preset number;
[0112] Obtain the difference between the reservation time point in the direct memory access data transmission service reservation request message and the product result, and use the difference as the start time of the reservation execution time interval;
[0113] The reservation time point, the product result, the time taken by the field programmable gate array accelerator with a first preset number to transmit the data of the sender graphics processing unit with a second preset number, and the sum of the time taken by the direct storage access internal logic of the field programmable gate array accelerator with the first preset number to process the data of the sender graphics processing unit with the second preset number are obtained in the direct memory access data transmission service reservation request message, and the sum is used as the end time of the reservation execution time interval.
[0114] There is no limitation on the first preset number corresponding to the field programmable gate array accelerator and the second preset number corresponding to the sending party's graphics processing unit, which are determined according to actual conditions.
[0115] In implementation, a direct memory access reservation transmission queue and a direct memory access actual transmission queue are constructed in the data transmission sub-core of the field programmable gate array accelerator;
[0116] After receiving the direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet, it also includes:
[0117] Each direct memory access data transmission service reservation request message is stored in a direct memory access reservation transmission queue.
[0118] Each FPGA accelerator in the same routing subnet will build a DMA reservation transmission queue and a DMA actual transmission queue in the data transmission sub-core. The DMA reservation transmission queue stores the DMA data transmission service reservation request messages forwarded by the sender GPU and the same routing subnet in a busy state, according to the number The sender GPU at the scheduled time , the amount of data to be transmitted data_size, the current number in the same routing subnet is The actual transmission bandwidth of the FPGA accelerator and its acceptable error coefficient for appointment waiting The scheduled execution time interval obtained by equal coefficients , and sort the appointment execution time intervals (where, , ,and Representative number is The FPGA accelerator DMA transfer number is The time it takes to send data to the GPU. Representative number is The FPGA accelerator DMA internal logic processes the number The time it takes for the sender GPU to process data is the basic frequency provided by the FPGA accelerator for DMA data transfer services.
[0119] After determining the scheduled execution time interval, the target field programmable gate array accelerator is obtained, so that in the target field programmable gate array accelerator, data is read from the corresponding sender graphics processing unit in the order of each scheduled execution time interval and the data is transmitted to the receiving graphics processing unit by direct memory access, wherein the target field programmable gate array accelerator is the initial field programmable gate array accelerator and / or the target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator. When determining the target field programmable gate array accelerator, if the initial field programmable gate array accelerator is not in a busy state, the initial field programmable gate array accelerator will be used as the target field programmable gate array accelerator, and if the initial field programmable gate array accelerator is in a busy state, the target interconnected field programmable gate array accelerator will be used as the target field programmable gate array accelerator.
[0120] In order to determine whether the initial field programmable gate array accelerator is busy or not, thereby determining the target field programmable gate array accelerator. In implementation, obtaining the target field programmable gate array accelerator so as to read data from the corresponding sender graphics processing unit in the target field programmable gate array accelerator in the order of each scheduled execution time interval and transmit the data to the receiver graphics processing unit by direct memory access includes:
[0121] In the case where the reserved execution time intervals corresponding to the multiple requests received at the same time overlap (i.e., the initial field programmable gate array accelerator is determined to be busy), the target field programmable gate array is determined to be the initial field programmable gate array accelerator and the target interconnected field programmable gate array accelerator; or, in the case where a new request is received, if the reserved execution time interval corresponding to the new request overlaps with the reserved execution time interval corresponding to the received request, the target field programmable gate array is determined to be the target interconnected field programmable gate array accelerator;
[0122] In the initial field programmable gate array accelerator, data is read from the corresponding sending graphics processing unit in the order of the first reserved execution time interval and the data is transmitted to the receiving graphics processing unit by direct memory access, and a target direct memory access data transmission service reservation request message is sent to the target interconnected field programmable gate array accelerator, so that in the target interconnected field programmable gate array accelerator, data is read from the corresponding sending graphics processing unit in the order of the second reserved execution time interval and the data is transmitted to the receiving graphics processing unit by direct memory access;
[0123] The first reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in the remaining direct memory access data transmission service reservation request messages, the remaining direct memory access data transmission service reservation request messages are reservation request messages other than the target direct memory access data transmission service reservation request message among all direct memory access data transmission service reservation request messages received by the initial field programmable gate array accelerator, and the second reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in each target direct memory access data transmission service reservation request message;
[0124] When there is no overlap in the reserved execution time intervals corresponding to the received requests (i.e., it is determined that the initial field programmable gate array accelerator is not busy), the target field programmable gate array is determined to be the initial field programmable gate array accelerator, and data is read from the corresponding sender graphics processing unit in the initial field programmable gate array accelerator in the order of the reserved execution time intervals and the data is transmitted to the receiving graphics processing unit using direct memory access.
[0125] In order to reduce the time extension, in the target field programmable gate array accelerator, reading data from the corresponding sending graphics processing unit in the order of each reserved execution time interval and transmitting the data to the receiving graphics processing unit by direct memory access includes:
[0126] Determine whether the target field programmable gate array accelerator and the graphics processing unit of the sender of the data to be read belong to the same server;
[0127] If not, the target field programmable gate array accelerator reads data from the corresponding sender graphics processing unit in the order of the scheduled execution time intervals using remote direct memory access technology, and transmits the data to the receiver graphics processing unit using direct memory access.
[0128] Since a direct memory access reservation transmission queue and a direct memory access actual transmission queue are constructed in the data transmission sub-core of the field programmable gate array accelerator, the method of reading data from the corresponding sender graphics processing unit in the target field programmable gate array accelerator according to the sequence of each reserved execution time interval and transmitting the data to the receiver graphics processing unit by using the direct memory access method includes:
[0129] In the target FPGA accelerator, the direct memory access actual transmission queue of the target FPGA accelerator reads data from the corresponding sender graphics processing unit in the order of each scheduled execution time interval and transmits the data to the receiver graphics processing unit by direct memory access.
[0130] That is, the DMA actual transmission queue of the FPGA accelerator reads data from the memory space represented by the virtual memory address storing the data to be transmitted in the sender GPU within the scheduled execution time interval and performs DMA concurrent transmission.
[0131] In order to ensure that the data transmission service can be completed, before the data is transmitted to the receiving graphics processing unit by direct memory access, it also includes:
[0132] Starting from the direct memory access actual transmission queue of the target field programmable gate array accelerator, reading data from the second preset numbered sender graphics processing unit in the order of each scheduled execution time interval, determining whether the data reading from the memory address of the data to be transmitted of the second preset numbered sender graphics processing unit is completed within the preset time interval;
[0133] If yes, then entering the step of transmitting the data to the receiving party's graphics processing unit by direct memory access;
[0134] If not, the direct memory access actual transmission queue of the target field programmable gate array accelerator stops executing the direct memory access data transmission service for the sender graphics processing unit with the second preset number; and sends to the sender graphics processing unit with the second preset number information representing that the direct memory access data transmission service is to be executed by the central processor of the server where the sender graphics processing unit with the second preset number is located.
[0135] The start time of the preset time interval is the difference between the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result, and the end time of the preset time interval is the sum of the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result.
[0136] The appointment time interval (i.e., the time interval of appointment waiting error) is expressed as If the FPGA accelerator cannot complete the data reading from the memory address of the data to be transmitted represented by the transmission data memory address addr_mem_send of the sender GPU within the time interval taking into account the reservation waiting error, the DMA actual transmission queue of the FPGA accelerator will no longer perform the DMA data transmission service for the sender GPU. The sender GPU is informed that the execution of the corresponding DMA data transmission service will be executed by the CPU of the server where it is located, ensuring that the data transmission service can be completed as much as possible.
[0137] In addition, determining the target interconnected field programmable gate array accelerator includes: obtaining the target interconnected field programmable gate array accelerator from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel; wherein the remaining field programmable gate array accelerators are field programmable gate array accelerators other than the initial field programmable gate array accelerator among all field programmable gate array accelerators under the same routing subnet.
[0138] There is no limit on the number of handshakes. In this embodiment, four handshakes are used as an example to illustrate the method of determining the target field programmable gate array accelerator through handshakes. In implementation, obtaining the target interconnected field programmable gate array accelerator from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel includes:
[0139] In the case where it is detected that the direct memory access data transmission service cannot be provided within the reserved execution time interval, first information for characterizing data transmission assistance is sent to the interconnected field programmable gate array accelerator in a multicast manner, and a direct memory access data transmission service reservation request message of the sender graphics processing unit is forwarded to the interconnected field programmable gate array accelerator under the same routing subnet to implement a first handshake;
[0140] Receiving second information sent by each interconnected field programmable gate array accelerator to implement a second handshake; wherein the second information is used to indicate whether the interconnected field programmable gate array accelerator can or cannot provide direct memory access data transmission service within the second scheduled execution time interval;
[0141] Sending third information to each interconnected field programmable gate array accelerator to implement a third handshake; wherein the third information includes information indicating that the second information sent by the interconnected field programmable gate array accelerator has been received, and sending information to each interconnected field programmable gate array accelerator indicating whether the accelerator is selected or not selected as a target interconnected field programmable gate array accelerator;
[0142] Receive fourth information sent by each interconnected field programmable gate array accelerator to implement a fourth handshake; wherein the fourth information includes information indicating that it is known that the initial interconnected field programmable gate array accelerator has received the third information, and information that the scheduling operation is completed or not completed according to the third information.
[0143] If the received second information is information indicating that the interconnected field programmable gate array accelerator can provide direct memory access data transmission service within the second scheduled execution time interval, the second information at least includes an actual bandwidth of the interconnected field programmable gate array accelerator and a scheduled waiting error coefficient;
[0144] Determining whether an interconnect FPGA accelerator is selected or not selected includes:
[0145] If the received second information is information indicating that the interconnected field programmable gate array accelerator cannot provide the direct memory access data transmission service within the second scheduled execution time interval, determining that the interconnected field programmable gate array accelerator is not selected;
[0146] If the received second information is information indicating that the interconnected field programmable gate array accelerator can provide direct memory access data transmission service within the second scheduled execution time interval, the interconnected field programmable gate array accelerator that can provide direct memory access data transmission service within the second scheduled execution time interval is determined to be a pending interconnected field programmable gate array accelerator, and the pending interconnected field programmable gate array accelerators are sorted according to the order of the second scheduled execution time intervals corresponding to the pending interconnected field programmable gate array accelerators, and it is determined that the pending interconnected field programmable gate array accelerator with the earliest end time among all the pending interconnected field programmable gate array accelerators is selected, and it is determined that the interconnected field programmable gate array accelerators except the pending interconnected field programmable gate array accelerator with the earliest end time among all the pending interconnected field programmable gate array accelerators are not selected.
[0147] If there are multiple pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point among all pending interconnection field programmable gate array accelerators, then one pending interconnection field programmable gate array accelerator is randomly selected from all pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point as the target interconnection field programmable gate array accelerator.
[0148] It should be noted that if the target interconnected field programmable gate array accelerator is not obtained from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel, information representing the direct memory access data transmission service to be executed by the central processor of the server where the second preset numbered sender graphics processing unit is located is sent to the sender graphics processing unit with a second preset number to ensure that data transmission can be performed.
[0149] In the embodiment of the present invention, a four-way handshake-based assisted transmission function is implemented in the task control sub-kernel of each FPGA accelerator. The main purpose of the present invention to achieve this function is: when the initial FPGA accelerator is unable to provide DMA data transmission services, it can assist in DMA data transmission to other interconnected FPGA accelerators under the same routing subnet, and forward the DMA data transmission service reservation request message of the sender GPU to the interconnected FPGA accelerators under the same routing subnet. It should be noted that when the reservation processing queue of the interconnected FPGA accelerator is also in a state where it cannot provide DMA data transmission services within the reservation execution time interval, the initial FPGA accelerator will be informed. If the initial FPGA accelerator and all interconnected FPGA accelerators under the same routing subnet are in a busy state, the initial FPGA accelerator will inform the sender GPU to trigger its own DMA through the CPU of the server where it is located to perform data transmission.
[0150] In addition, some abnormal situations may occur during the handshake process. In order to handle the abnormal situation, specifically, the method for data transmission between graphics processing units also includes:
[0151] Since the third information is sent to each interconnected field programmable gate array accelerator, if the fourth information sent by the interconnected field programmable gate array accelerator is not received within the first preset time period, the fifth information is sent to the interconnected field programmable gate array accelerator that has not sent the fourth information, so that the interconnected field programmable gate array accelerator that has not sent the fourth information processes the preset reservation request within the reservation execution time interval corresponding to the direct memory access reservation transmission queue after receiving the fifth information; wherein the fifth information is information used to represent the cancellation of the interconnected field programmable gate array accelerator that has not sent the fourth information to perform data transmission service assistance.
[0152] The method for transmitting data between graphics processing units also includes:
[0153] Since the third information is sent to each interconnected field programmable gate array accelerator, if the fourth information sent by all the interconnected field programmable gate array accelerators is not received within the second preset time period, information representing that a direct memory access data transmission service is to be executed by the central processor of the server where the sender graphics processing unit with the second preset number is located is sent to the sender graphics processing unit with the second preset number.
[0154] There is no limitation on the first preset duration and the second preset duration, which are determined according to actual conditions. In the case of an abnormal handshake, by sending information indicating that the direct memory access data transmission service is to be executed by the central processor of the server where the second preset number of the sending graphics processing unit is located to the sending graphics processing unit with the second preset number, it is ensured that the data transmission can be completed as much as possible.
[0155] In order to facilitate those skilled in the art to better understand the solution of the embodiment of the present invention, the inter-GPU data transmission optimization method based on the DMA mechanism of the present invention is further described below.
[0156] First, the present invention proposes a tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration. In the present invention, low-latency network transmission technologies such as RMDA are used to connect each FPGA accelerator to the GPU cluster network to achieve high-speed interconnection with other FPGA accelerators and GPUs. The sender GPU can transmit data to the receiving GPU through the DMA resources of the FPGA accelerator (or sender GPU) in the same routing subnet. In this process, if the selected FPGA accelerator that implements the DMA data transmission service and the sender GPU do not belong to the same server host, network communication technologies such as RDMA can be used to achieve low-latency reading and writing of the memory of the sender GPU and avoid the additional transmission delay introduced by cross-routing. The present invention divides each FPGA accelerator core into two sub-cores based on the data transmission function and GPU data task scheduling transmission function implemented by each FPGA accelerator using kernel virtualization technology: a data transmission sub-core and a task control sub-core. As mentioned above Figure 5 As shown in the figure, the tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration mainly includes: GPU, FPGA accelerator, server and router. The server is mainly responsible for the management of GPU and FPGA accelerator. It should be noted that the basic control logic configuration and data interaction between the FPGA accelerator and the server are completed through RDMA network communication. Since the corresponding business logic function is simple, any server under the same routing subnet can be randomly selected as the FPGA control server to implement the corresponding function. The GPU works with the server as a PCIe device of the server. Based on high-speed transmission networks such as RDMA, the FPGA accelerator can read and write data at high speed according to the memory address exposed by the GPU, and compared with the PCIe transmission bandwidth, the transmission bandwidth based on RDMA can achieve the same or better effect. For some GPUs, the data transmission bandwidth supporting the PCIe 4.0 x16 protocol is 31.508GB / s, which is approximately equivalent to a 250Gb / s RDMA network card, while existing servers and FPGA accelerators generally support 400Gb / s transmission bandwidth; in addition, Figure 5 As shown, based on the FPGA core virtualization function, the FPGA accelerator implements the data transmission sub-core and the task control sub-core, has the data transmission function and the GPU data task scheduling transmission function, communicates with other routers, FPGA accelerators and servers through routing links, and the data transmission between the GPU is based on the RDMA network card of the server where the GPU is located.
[0157] It should be noted that 1) in the tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration proposed in the present invention, all FPGA accelerators, servers and other network terminals are connected to the network through routers; 2) data transmission between FPGA accelerators and between FPGA accelerators and servers equipped with GPUs are limited to the same routing subnet, without the need for router forwarding, avoiding the introduction of uncontrollable delays caused by routing forwarding and router congestion, and based on the RDMA characteristics, GPU data on remote servers can be directly read and written. In addition, the number of fiber optic network ports in an FPGA accelerator is greater than or equal to 2, which can support dual-channel bidirectional data transmission.
[0158] In the process of data transmission between GPUs, there are sending GPUs and receiving GPUs, and the initial FPGA accelerator is configured by the FPGA control server in the same routing subnet during the GPU deployment phase. When the initial FPGA accelerator is unable to provide DMA data transmission service, the CPU of the server where other interconnected FPGA accelerators or GPUs are located can be selected in combination with the FPGA accelerator DMA scheduling transmission method based on the reservation processing mechanism proposed by the present invention to assist in completing the corresponding DMA data transmission operation.
[0159] Secondly, the FPGA accelerator DMA scheduling transmission method based on the reservation processing mechanism proposed in the present invention can be specifically described as the following two aspects from the perspective of the two main sender GPUs and FPGA accelerators involved in DMA data transmission: on the one hand, the reservation processing logic of the DMA transmission service for the FPGA accelerator is implemented on each sender GPU. The present invention sets that when all threads in the same thread group reach the preset calculation stage of the computing task, the sender GPU thread group will send a DMA data transmission service reservation request message to the initial FPGA accelerator. This saves the delay introduced by sending the request after the data preparation is completed.
[0160] Again, each FPGA accelerator under the same routing subnet will build a DMA reservation transmission queue and a DMA actual transmission queue in the data transmission sub-kernel. The DMA reservation transmission queue sorts the DMA data transmission reservation request message of the sender GPU according to the reservation execution time interval, and the DMA actual transmission queue reads data from the sender GPU within the reservation execution time interval and performs DMA concurrent transmission. The present invention has taken into account the reservation waiting error in the reservation execution time interval. Therefore, if the FPGA accelerator cannot complete the storage of the transmission data memory address of the sender GPU within the time interval taking into account the reservation waiting error, the DMA actual transmission queue will no longer execute the DMA data transmission service for the sender GPU this time. And inform the sender GPU that the execution of the corresponding DMA data transmission service will be executed by the CPU of the server where it is located.
[0161] In the present invention, an assisting transmission function based on a four-way handshake is implemented in the task control sub-kernel of each FPGA accelerator. Therefore, when the initial FPGA accelerator is unable to provide DMA data transmission services, it can assist in DMA data transmission to other interconnected FPGA accelerators under the same routing subnet, and forward the DMA data transmission service reservation request message of the sender GPU to the interconnected FPGA accelerators under the same routing subnet. Regardless of whether the reservation processing queue of the interconnected FPGA accelerator can provide DMA data transmission service status within the reservation execution time interval, the initial FPGA accelerator will be informed. If the initial FPGA accelerator and all interconnected FPGA accelerators under the same routing subnet are in a state where DMA data transmission services cannot be provided, the initial FPGA accelerator will inform the sender GPU to trigger its own DMA through the CPU of the server where it is located to perform data transmission.
[0162] To reiterate, the basic implementation principle of the implementation mechanism of the FPGA accelerator DMA scheduling transmission method based on the reservation processing mechanism proposed in the present invention is: each sender GPU constructs a reservation request FPGA accelerator DMA data transmission service. All FPGA accelerators under the same routing subnet will implement a reservation transmission queue and a DMA actual transmission queue, which are used to process the reservation request of the sender GPU and perform the actual DMA data transmission service according to the reservation request. It should be noted that when the reservation transmission queue of the reservation FPGA accelerator is in a busy state during the time period corresponding to the reservation request of the sender GPU, DMA data transmission assistance from other interconnected FPGA accelerators can be sought based on the four-way handshake mechanism. If all FPGA accelerators under the same routing subnet are busy in the time period corresponding to the reservation request of the sender GPU, the DMA of the sender GPU is used for data transmission.
[0163] Based on a tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration and an FPGA accelerator DMA scheduling transmission method based on a reservation processing mechanism, the embodiments of the present invention solve the problems of excessive latency and low throughput in data interaction between GPUs. The proposed reservation mechanism can perform data transmission by reasonably scheduling the DMA of the FPGA accelerator under the same routing subnet. Compared with the existing DMA data transmission acceleration scheme in which a single FPGA accelerator is bound to a GPU, it realizes the decoupling of the FPGA accelerator and the GPU. While improving the utilization rate of FPGA accelerator DMA data transmission, each FPGA accelerator can assist more sending GPUs under the same routing subnet to complete data transmission acceleration.
[0164] The detailed implementation steps of the implementation mechanism of the FPGA accelerator DMA scheduling transmission method based on the reservation processing mechanism proposed in the embodiment of the present invention are as follows:
[0165] First, the reservation processing logic for the DMA transfer service for the FPGA accelerator is implemented on each sender GPU, and the corresponding logic implementation content is: the existing GPU software architecture uses a thread group to manage the concurrent execution of several threads in the same thread group, and supports the execution of threads through thread synchronization. It should be noted that when the GPU enables the thread group to execute multi-threaded tasks, even if the amount of task data processed is very small, such as 4kb (equivalent to the AI reasoning classification of a simple color RGB image), when the mainstream AI reasoning architecture is used to complete the corresponding operation on the GPU, its processing time unit is often counted in ms. The reservation processing logic proposed in the present invention, when using a 400Gb / s bandwidth network card and FPGA accelerator for processing, the total amount of interactive data is less than 1Kb, and the transmission delay is less than 2.5ns. Even if the FPGA interacts 10 times, it is only 25ns. And the computing power of the FPGA accelerator is about tens of T floating-point operations per second, such as a computing power of 28.1T floating-point operations per second. Note that the data processed by a floating-point operation is of INT8 type, that is, 1 byte. Even when processing 1Mb-level data, the calculation time on the FPGA side is about 0.4ns. The FPGA accelerators interact with each other 10 times, so the total calculation time and transmission time is about 25.4ns, which is much lower than the ms level time it takes for a single thread of GPU to complete a very simple calculation task with a small amount of data.
[0166] Therefore, the present invention sets that when all threads in the thread group reach the 3 / 4 calculation stage of the calculation task, the sending GPU will send a DMA data transfer service reservation request message to the initial FPGA accelerator. The message uses binary data with a length of 512 bits, and the message content includes: a 32-bit length of the amount of data to be transmitted data_size (in bytes), a 32-bit length of the IP address addr_ip_send of the server where the sending GPU is located, a 32-bit length of the IP address addr_ip_recv of the server where the receiving GPU is located, a 64-bit length of the sending GPU for sending the memory address addr_mem_send of the data to be transmitted, a 64-bit length of the receiving GPU for receiving the memory address addr_mem_recv of the data to be transmitted, and a 48-bit length of the sending GPU thread group is expected to be able to perform DMA data transmission by the FPGA accelerator. , the basic unit of time point is ns, and the reserved field length is 248 bits;
[0167] Secondly, all FPGA accelerators under the same routing subnet will construct a DMA reservation transmission queue and a DMA actual transmission queue in the data transmission sub-core to process the reservation request of the DMA data transmission service of each sending GPU. The present invention fully considers the possible errors in the reservation request when constructing the DMA reservation transmission queue and the DMA actual transmission queue, and therefore sets a reservation waiting error coefficient mechanism. In addition, the present invention gives priority to using the reservation FPGA accelerator to provide DMA data transmission service for the sending GPU. When the reservation FPGA accelerator is in (numbered When the sending GPU cannot provide DMA data transmission service within the reservation request time interval, the corresponding reservation request will be forwarded to the interconnected FPGA accelerator. The specific implementation principle adopts the four-way handshake mechanism proposed in the present invention. The reservation FPGA accelerator will select the interconnected FPGA accelerator with the earliest end time as The sender GPU provides this DMA data transfer service.
[0168] The DMA reservation transmission queue stores the DMA data transmission service reservation request message forwarded by the sender GPU and the reservation FPGA accelerator in the same routing subnet in a busy state. The sender GPU at the scheduled start time , the amount of data to be transmitted data_size, the current number in the same routing subnet is The actual transmission bandwidth of the FPGA accelerator and its acceptable error coefficient for appointment waiting The scheduled execution time interval obtained by equal coefficients , and sort the appointment execution time intervals. Figure 7 A schematic diagram of a reservation execution time interval taking into account a reservation waiting error in a DMA actual transmission queue time axis for processing a sending request provided by an embodiment of the present invention.
[0169] Figure 7 In the above example, T0 specifically refers to , T1 specifically refers to , T2 specifically refers to , T3 specifically refers to , T4 specifically refers to The time interval of appointment waiting error is [T0, T2], the time interval of appointment execution without considering appointment waiting error is [T1, T3], and the time interval of appointment execution considering appointment waiting error is [T0, T4]. Figure 7 As shown, for each DMA data transfer service reservation request message of each sender GPU, the DMA actual transfer queue of the FPGA accelerator will read data from the sender GPU and perform DMA concurrent transfer according to the reservation execution time interval of the DMA reservation transfer queue. In addition, the present invention has taken into account the reservation waiting error in the reservation execution time interval, so if the sender GPU cannot execute the reservation waiting error within the time interval If the data to be transmitted is successfully stored in the memory represented by addr_mem_send of the transmission data memory address of the sender GPU, the DMA actual transmission queue of the FPGA accelerator will no longer perform the DMA data transmission service for the sender GPU. The sender GPU is informed that the corresponding DMA data transmission service will be executed by the CPU of the server where it is located.
[0170] In addition, in the present invention, a four-way handshake-based assisted transmission function is implemented in the task control sub-core of each FPGA accelerator. Figure 8 A schematic diagram of a four-way handshake screening target FPGA accelerator to complete the DMA data transmission service flow of the sender GPU provided by an embodiment of the present invention. Figure 8 As shown, the process specifically includes the following steps:
[0171] The sending graphics processing unit initiates a direct memory access data transfer reservation request;
[0172] A sending party's graphics processing unit sends a direct memory access data transmission reservation request message to an initial field programmable gate array accelerator;
[0173] If the initial FPGA accelerator cannot provide the DMA data transmission service within the execution time interval taking into account the reservation waiting error, the DMA data transmission reservation request is forwarded to the interconnected FPGA accelerators in a multicast manner (i.e., the first handshake);
[0174] The interconnected field programmable gate array accelerator determines whether a direct memory access data transfer service can be provided within an execution time interval taking into account a reservation wait error, and returns a message to the initial field programmable gate array accelerator (a second handshake);
[0175] The initial FPGA accelerator processes the obtained information and completes the corresponding classification and aggregation according to the content, notifying the interconnected FPGA accelerator that the return message of the interconnected FPGA accelerator has been received and whether the current interconnected FPGA accelerator has been selected (third handshake);
[0176] In the interconnected field programmable gate array accelerator, if it is a pending field programmable gate array accelerator, the scheduling arrangement of the corresponding direct memory access reservation processing queue is completed according to whether it is selected or not;
[0177] The interconnected FPGA accelerator returns to the initial FPGA accelerator to inform it that the initial FPGA accelerator has received the return message sent by it and has completed the relevant scheduling operation according to the message of whether it is finally selected (the fourth handshake);
[0178] If the initial FPGA accelerator receives the confirmation message from the target FPGA accelerator, it informs the sender GPU that the FPGA accelerator can undertake the direct memory access data transmission request task.
[0179] Figure 8 The article describes the process in which, when the initial FPGA accelerator cannot provide DMA data transmission service for the sending GPU, the initial FPGA accelerator selects the target FPGA accelerator from the interconnected FPGA accelerators through the four-way handshake mechanism, and then assists the sending GPU to complete the DMA data transmission service. In view of the different situations faced by the initial FPGA accelerator and the interconnected FPGA accelerator, the four-way handshake mechanism proposed in the present invention implements different logics, and the specific implementation is as follows:
[0180] The main purpose of the present invention to achieve this function is: when the initial FPGA accelerator's DMA data transmission service reservation request message for a certain sender GPU takes into account the execution time interval of the reservation waiting error When the DMA data transmission service cannot be provided within the specified time period, the DMA data transmission assistance of other interconnected FPGA accelerators in the same routing subnet is sought in a multicast manner, and the DMA data transmission service reservation request message of the sender GPU is forwarded to the interconnected FPGA accelerators in the same routing subnet (first handshake). Regardless of whether the reservation processing queue of the interconnected FPGA accelerator can provide DMA data transmission service within the reservation execution time interval that takes into account the reservation waiting error, the initial FPGA accelerator will be informed (second handshake). Among them, the interconnected FPGA accelerator that can provide DMA data transmission service is recorded as a pending FPGA accelerator. The information returned by the pending FPGA accelerator to the initial FPGA accelerator includes: the actual transmission bandwidth of the FPGA accelerator and its acceptable appointment waiting error coefficient ,According to this, the FPGA accelerator can obtain the corresponding execution time interval considering the reservation waiting error .
[0181] For the initial FPGA accelerator, there are two situations:
[0182] 1) If there are interconnected FPGA accelerators in the same routing subnet that cannot provide DMA data transfer services within the execution time interval that takes into account the reservation waiting error, the initial FPGA accelerator will, after receiving the message that each interconnected FPGA accelerator cannot provide DMA data transfer services, inform each interconnected FPGA accelerator that cannot provide DMA data transfer services that it has received the information that it cannot provide DMA data transfer services (third handshake). After receiving the message, the interconnected FPGA accelerator that cannot provide DMA data transfer services will inform the initial FPGA accelerator that it has received the relevant information, that is, the interconnected FPGA accelerator that cannot provide DMA data transfer services knows that the initial FPGA accelerator has received the information that it cannot provide DMA data transfer services (fourth handshake). Through the third and fourth handshake operations, it can be ensured that the relevant information of the interconnected FPGA accelerator that cannot provide DMA data transfer services has been successfully transmitted to the initial FPGA accelerator, and both parties are aware of it.
[0183] In addition, if all interconnected FPGA accelerators cannot provide DMA data transfer services, the initial FPGA accelerator needs to inform the sender GPU to trigger the DMA of the sender GPU for data transfer through the CPU of the server where it is located.
[0184] 2) If there are pending FPGA accelerators, the initial FPGA accelerator will feedback the execution time interval taking into account the reservation waiting error for each pending FPGA accelerator. Characterize the time point when the FPGA accelerator performs DMA data transfer Summarize and sort. Among them, the FPGA accelerator that represents the earliest time point at which the FPGA accelerator executes DMA data transfer will be selected as the target FPGA accelerator. Note that if there are multiple pending FPGA accelerators that represent the same time point at which the FPGA accelerator executes DMA data transfer, just select one from them. After completing the selection, the initial FPGA accelerator performs the following operations: a) The initial FPGA accelerator sends a flag to the unselected pending FPGA accelerator to inform that it is not selected (the third handshake), and the unselected pending FPGA accelerator sends a message to the initial FPGA accelerator representing that it has received the unselected message after receiving the unselected message (the fourth handshake). In addition, the unselected pending FPGA accelerator will arrange other reservation requests in the execution time interval that takes into account the waiting error in its reservation processing queue; b) The initial FPGA accelerator informs the target FPGA accelerator that it has been selected (the third handshake). After receiving the relevant information, the target FPGA accelerator updates the execution time interval of the corresponding reservation waiting error to the corresponding execution time interval that takes into account the waiting error. In addition, the target FPGA accelerator will inform the initial FPGA accelerator that it is ready to perform the corresponding DMA data transfer operation (the fourth handshake). At the same time, the initial FPGA accelerator will inform the sender GPU that there will be an FPGA accelerator to provide DMA data transfer services. So far, through the four-way handshake, the screening operation of the corresponding target FPGA accelerator is completed.
[0185] Abnormal situation handling: After the third handshake is completed, if the initial FPGA accelerator fails to wait for the receiving time interval After receiving relevant information from the interconnected FPGA accelerator (including the target FPGA accelerator, the unselected pending FPGA accelerator, and the interconnected FPGA accelerator that cannot provide DMA data transfer services), the initial FPGA accelerator will perform two operations: a) send a notification to the interconnected FPGA accelerator to cancel the DMA data transfer service assistance. After receiving the relevant notification, the interconnected FPGA accelerator will set the execution time interval that takes into account the reservation waiting error in its DMA reservation transfer queue. Arrange other reservation requests in; b) If the fourth handshake information of all interconnected FPGA accelerators is not received, inform the sender GPU to call the CPU of the server where it is located to trigger DMA data transmission.
[0186] To make the purpose, technical solution and advantages of the present invention clearer, the present invention will be described in further detail below. It is obvious that the described embodiments are only part of the embodiments of the present invention and do not represent all embodiments.
[0187] In order to describe in detail a method for data transmission between GPUs based on DMA mechanism proposed by the present invention, Figure 5 Taking the tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration as an example, Table 1 is a schematic diagram of the tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration. The information of the initial FPGA accelerator, the sender GPU and the receiver GPU is shown in Table 1. Here, the GPU accelerators are of the same model, supporting PCIe gen 4.0 x16, and can be used with an RDMA network card with a bandwidth of 400Gb / s. The FPGA accelerator has a bandwidth of up to 600Gb / s, supports PCIe gen 4.0 x16, and has a basic operating frequency of 300Mb / s when providing DMA data transmission services. The server used supports the PCIe 4.0 protocol. Because the same model of FPGA accelerator is used, the corresponding DMA average bandwidth and its acceptable appointment waiting error coefficient The values are the same. Table 2 shows the average DMA bandwidth of the FPGA accelerator. and its acceptable appointment waiting error coefficient The server uses a PCIe gen 4.0 x16 and 8 GPUs. The RDMA network card uses a DPU with a bandwidth of 400Gb / s. Figure 5 As shown, the Internet Protocol (IP) information of the four servers and five FPGA accelerators in the present invention is shown in Table 3. Table 3 is a table of IP address information of servers and FPGA accelerators.
[0188] Table 1
[0189]
[0190] Table 2
[0191]
[0192] Table 3
[0193]
[0194] In the present invention, the same application is deployed on all sender and receiver GPUs. In this example, the application logic of the large model Llama 2.0 reasoning is deployed, with 13 billion parameters. The two GPUs are interactively communicated and calculated in a tensor parallel manner, and the reasoning tasks are the same. Among them, the time taken by a thread group of the sender GPU to execute each calculation stage before tensor parallelism is shown in Table 4, which is a table of the time taken by each calculation stage before tensor parallelism of Llama 2.0 reasoning with 13 billion parameters.
[0195] Table 4
[0196]
[0197] At the end of the calculation phase, when tensor parallel execution begins, the amount of data to be transmitted on the sender GPU, data_size, is set to 8K bytes. The virtual address of the sender GPU memory in the server that stores the data to be transmitted and the virtual address of the memory on the server where the receiver GPU receives the data are shown in Table 5. Table 5 shows the DMA reservation request transmission message field content of the four sender GPUs. Figure 5 The relationship between GPUs and servers in Table 3 shows the IP addresses of all GPUs.
[0198] Table 5
[0199]
[0200] Furthermore, it is assumed that 4 sender GPUs and 4 receiver GPUs start the Llama 2.0 inference application logic at the same time. Since the GPU accelerators of the same specifications are used, when the Llama 2.0 inference application is initiated at the same time, the calculation time from the start of calculation to the execution of tensor parallelism follows the calculation time shown in Table 4.
[0201] Assume that the unified time measurement of FPGA accelerator and GPU accelerator at the beginning of each computing service is in ns, with a length of 48-bit binary non-negative integer, ranging from 0 to 2^48, which is converted to decimal from 0ns to 281474976710656ns. Assume that in this computing service, the start time is recorded as 0ns. Assume that in the time interval from 0ns to 1000000000ns, 0#FPGA accelerator and 3#FPGA accelerator are both in a state where they cannot provide DMA data transmission services, but can be used as the initial FPGA accelerator to execute the four-way handshake mechanism to seek the assistance of the interconnected FPGA accelerator to complete the DMA data transmission service reservation request of the corresponding sender GPU. Combined with Table 4, it can be seen that 1000000000ns>69000000ns. Therefore, when it is necessary to execute tensor parallelism to forward the sender GPU data to the receiver GPU, the sender GPU (i.e., 0#GPU and 4#GPU) with 0#FPGA accelerator and 3#FPGA accelerator as the initial FPGA accelerator cannot use 0#FPGA accelerator and 3#FPGA accelerator to provide DMA data transfer service. Figure 5 When the 8 GPUs shown reach the 3 / 4 computing stage, they will first send a DMA reservation transfer request message to their respective initial FPGA accelerators. The message information sent is shown in Table 5.
[0202] Because the sender GPU and the reserved FPGA accelerator are located on two servers, the transmission link of the data to be sent is: sender GPU memory -> PCIe channel -> RDMA network card of the host where the sender GPU is located -> initial FPGA accelerator. In this process, because the bandwidth of the RDMA network card is 400Gb / s, the PCIe bandwidth is 256Gb / s, and the bandwidth of the FPGA accelerator is 600Gb / s. Therefore, the RDMA network card will be limited by the RDMA network card rate when transmitting with the FPGA accelerator, reaching 400Gb / s. It should be noted that the current bandwidth calculation has included the business logic processing delay in the GPU and RDMA network card. Therefore, the corresponding theoretical delay should be: 512bit / 256Gb / s+512bit / 400Gb / s=3.28ns, which is about 4ns. However, during small-scale data transmission, due to the logical resource settings inside the RDMA network card, the full bandwidth cannot be achieved. When the data reaches 512bit, the bandwidth utilization rate reaches between 25% and 40%. Therefore, taking the lowest 25% as an example, the corresponding theoretical latency should be: 512bit / (1 / 4*256Gb / s)+512bit / 400Gb / s=9.28ns, which is approximately equal to 10ns. Since all FPGA accelerator models and DMA data processing logic are the same, and the GPU models are the same, for any initial FPGA accelerator and the sending GPU, the transmission latency is The value of is 10ns. Compared with Table 4, it can be seen that the proposed DMA transfer service reservation request mechanism can be delivered to the initial FPGA accelerator at 44000000+10=44000010ns. It is much earlier than the vector parallel time to execute the inter-GPU DMA data transfer request at 69000000ns. In this process, the field contents in the DMA transfer service reservation request message of the four sender GPUs are shown in Table 5.
[0203] In this process, since 0#FPGA accelerator and 3#FPGA accelerator cannot provide DMA data transmission service in the time interval of 0ns to 1000000000ns, based on the four-way handshake-based assisted transmission function proposed by the present invention, 0#FPGA accelerator and 3#FPGA accelerator can provide DMA data transmission assistance to other interconnected FPGA accelerators under the same routing subnet, and forward the DMA data transmission service reservation request message of the sender GPU to the interconnected FPGA accelerators under the same routing subnet.
[0204] Taking 0#FPGA accelerator as an example, it receives the DMA data transmission service reservation request message from 0#GPU at 44000010ns. Since 0#FPGA accelerator cannot provide DMA data transmission service at this moment, it forwards the DMA data transmission service reservation request message to other interconnected FPGA accelerators under the same routing subnet via multicast, which is the first handshake between 0#FPGA accelerator and 1#FPGA accelerator and 2#FPGA accelerator. It should be noted that at this time, under 0#routing subnet, 1#FPGA accelerator is in idle state, and 2#FPGA accelerator is processing the corresponding reservation request message from 3#GPU as the initial FPGA accelerator. Similarly, because the basic operating frequency of the FPGA accelerator in executing DMA data transmission service is 300Mb / s, and since all FPGA accelerator models and DMA data processing logic are the same, and the GPU models are the same, for any initial FPGA accelerator and the sending GPU, the processing number is The FPGA accelerator DMA internal logic processes the number The time it takes to send data to the GPU The value is 512 / 300000000=1706.67ns, which is approximately 1707ns.
[0205] In this case, after receiving the DMA data transfer service reservation request message, FPGA accelerator 1# finds that it can provide DMA data transfer service in the reservation execution time interval [68999995,69001722] taking into account the reservation waiting error. FPGA accelerator 1# informs FPGA accelerator 0# that it can provide DMA data transfer service and the actual transmission bandwidth of the FPGA accelerator The value is 400Gb / s and the acceptable reservation waiting error coefficient The value is 0.5, which is the second handshake between 0#FPGA accelerator and 1#FPGA accelerator. The corresponding second handshake of 2#FPGA accelerator returns to 0#FPGA accelerator that DMA data transfer service cannot be provided. That is, the second handshake between 0#FPGA accelerator and 2#FPGA accelerator; after receiving 1#FPGA accelerator and 2#FPGA accelerator, 0#FPGA accelerator summarizes and obtains the execution time interval [68999995,69001722] of 1#FPGA considering the reservation waiting error, and determines the end time point to be 69001722ns. Since only 1#FPGA accelerator can provide DMA data transfer service, 1#FPGA accelerator is selected as the only pending FPGA accelerator as the target FPGA accelerator to provide data transfer service for the sender GPU (i.e. 0#GPU), and 0#FPGA accelerator will inform 1#FPGA accelerator that it has been selected as the target FPGA accelerator of the sender GPU (i.e. 0#GPU) to provide DMA data transfer service, which is the third handshake between 0#FPGA accelerator and 1#FPGA accelerator. The 0#FPGA accelerator will also inform the 2#FPGA accelerator that it has received the information that it cannot provide DMA data transmission service, that is, the third handshake between the 0#FPGA accelerator and the 2#FPGA accelerator; after receiving the selected message, the 1#FPGA accelerator will update the execution time interval [68999995,69001722] in the reservation transmission queue to take into account the reservation waiting error and bind it to the server IP address of the 0#GPU in the reservation request message and the corresponding virtual memory address storing the data to be transmitted, and the server IP address of the 2#GPU and the virtual memory address storing the data to be transmitted. And inform the 0#FPGA accelerator that it is ready to perform the corresponding DMA data transmission operation for the 0#GPU. At the same time, the 0#FPGA accelerator will inform that there will be an FPGA accelerator to provide DMA data transmission service, that is, the fourth handshake between the 0#FPGA accelerator and the 4#FPGA accelerator. Correspondingly, after receiving the third handshake message, the 2#FPGA accelerator will inform the 0#FPGA accelerator that it has received the third handshake message, that is, the fourth handshake between the 0#FPGA accelerator and the 4#FPGA accelerator.
[0206] During the above four handshakes, the length of the transmitted data is different. Combined with the above four handshakes, it can be seen that the longest data length is the DMA data transmission reservation request message sent by the first multicast, which is 256 bits long. Based on this data, the transmission delay can be calculated. When the fourth handshake 0#FPGA accelerator receives the corresponding confirmation and cannot provide the DMA data transmission service message, the maximum duration is 44000010+(256 / 300000000+256 / 3000000000000)*4=44000864ns. Here, it should be noted that the network-based transmission bandwidth between FPGA accelerators is 600Gb / s, so there is no need to transmit through the 400Gb / s of the server PCIe4.0 x16.
[0207] In addition, for GPU #4, since its initial FPGA accelerator #3 FPGA accelerator cannot provide DMA data transmission service, its four-way handshake process is as follows: Receive the DMA data transmission service reservation request message from GPU #4 at 44000010ns. Since FPGA #1 accelerator cannot provide DMA data transmission service at this moment, it forwards the DMA data transmission service reservation request message to other interconnected FPGA accelerators under the same routing subnet via multicast, i.e., the first handshake between FPGA #3 accelerator and FPGA #4 accelerator; since FPGA #4 accelerator is processing the DMA data transmission task of GPU #6, the corresponding second handshake of FPGA #4 accelerator returns to FPGA #3 accelerator with the content that DMA data transmission service cannot be provided. That is, the second handshake between 3#FPGA accelerator and 4#FPGA accelerator; and 3#FPGA accelerator will also inform 4#FPGA accelerator that it has received the information that it cannot provide DMA data transmission service, that is, the third handshake between 3#FPGA accelerator and 4#FPGA accelerator; accordingly, after 4#FPGA accelerator receives the third handshake message, it will inform 3#FPGA accelerator that it has received the third handshake message, that is, the fourth handshake between 4#FPGA accelerator and 3#FPGA accelerator. It should be noted that when 3#FPGA accelerator receives the second handshake message and learns that 4#FPGA accelerator cannot provide DMA data transmission service, it will inform 4#GPU to let the CPU of its server perform DMA data transmission service.
[0208] In addition, for the sender GPUs such as 3#GPU and 6#GPU, their initial FPGA accelerators 2#FPGA accelerator and 4#FPGA accelerator provide DMA data transmission services respectively, and update their DMA reservation transmission queues to the execution time interval [68999995, 69001722] that takes into account the reservation waiting error. It should be noted that the present invention has taken into account the reservation waiting error in the reservation execution time interval, so the actual transmission queue using the FPGA accelerator will use the polling reading method to complete the reading of the data to be transmitted in [68999995, 69000005] according to the DMA reservation transmission queue 0#GPU, 3#GPU and 6#GPU. If the reading is successful, the DMA data transmission service is executed. On the contrary, if each sender GPU fails to complete the storage of the data to be transmitted in the transmission data memory address addr_mem_send in [68999995, 69000005], the corresponding FPGA accelerator's DMA actual transmission queue will no longer execute the DMA data transmission service for the sender GPU this time. And inform the sender GPU that failed to store the data successfully, the corresponding DMA data transfer service will be executed by the CPU of the server where it is located. In addition, if the 0#FPGA accelerator fails to wait for the receiving time interval (The present invention sets After receiving the fourth handshake information from 1#FPGA accelerator or 2#FPGA accelerator when the value is 10ns), 0#FPGA accelerator will perform two operations: a) Send a notification to 1#FPGA accelerator or 2#FPGA accelerator to cancel the DMA data transfer service assistance. After receiving the relevant notification, 1#FPGA accelerator or 2#FPGA accelerator will arrange other reservation requests in the execution time interval [68999995,69001722] corresponding to the reservation waiting error in its DMA reservation transfer queue; b) If the fourth handshake information of 1#FPGA accelerator and 2#FPGA accelerator is not received, 0#FPGA accelerator is notified to call the CPU of the server where it is located to trigger DMA data transfer.
[0209] In the present invention, if 0#GPU, 3#GPU and 6#GPU can complete the storage of the data to be transmitted in the sender GPU's transmission data memory address addr_mem_send within [68999995,69000005], the transmission path is from the FPGA accelerator fiber network port network to the RDMA network card of the server where the receiver GPU is located, and then from the network card of the server where the receiver GPU is located through the PCIe channel to the virtual memory of the receiver GPU storing the data to be transmitted. Then the time when the corresponding receiver GPU successfully receives the data to be transmitted is 69001722+512 / (1 / 4*256000000000)+512 / 400000000000=69001732ns. Combined with Table 4, it can be seen that starting from the execution of tensor parallelism for inter-GPU data transmission at 69000000ns, under the FPGA accelerator assisted DMA data transmission service proposed in the present invention, the corresponding receiving GPU receives the data at 69001723ns, and the total delay is 69001732-69000000=1732ns.
[0210] Fig. 9 The DMA data transmission execution time diagram of an existing FPGA accelerator provided by the embodiment of the present invention is shown in FIG. Fig. 9 As shown, T0 is the moment when the sending GPU prepares the data to be transmitted, T1 is the moment when the FPGA accelerator receives the direct memory access reservation request, T2 is the moment when the FPGA accelerator arranges to execute the direct memory access data transmission service for the data to be transmitted, and T3 is the moment when the receiving GPU successfully receives the data to be stored. Fig. 9 In the transmission mode shown, when the sending GPU completes the calculation, it is necessary to pass the request information such as the address of the data to be transmitted to the FPGA accelerator, corresponding to Fig. 9 In addition, the FPGA accelerator in the scheme needs to measure the tasks in the current DMA actual transmission queue and implement the corresponding DMA data transmission service according to the time sequence of request arrival, corresponding to Fig. 9 The T2 moment in .
[0211] The reservation request mechanism based on the four-way handshake proposed in the present invention reports the reservation request information that needs to execute the DMA data transmission service in advance, thus releasing the strong binding between the FPGA accelerator and the GPU. Even if the initial FPGA accelerator cannot provide services, it can seek assistance from other FPGA accelerators in the same routing subnet. Even if there is no interconnected FPGA accelerator in the same routing subnet that can provide services within the scheduled execution time interval, the sender GPU can be informed to use the CPU of the server where it is located to directly trigger when the sender GPU needs to execute DMA data transmission. Fig. 9As shown in the figure, the sending GPU is ready for data to be transmitted at time T0, and directly uses the DMA data transmission service of the FPGA accelerator, or uses the CPU to trigger the DMA data transmission of the sending GPU. This saves the time for sending request messages and waiting. Since the waiting time cannot be evaluated, specific data cannot be given. However, it is known that even if the reservation request does not need to wait, the DMA data transmission can only be triggered after the FPGA accelerator receives the relevant reservation request. The reservation request mechanism based on the four-way handshake proposed in the present invention saves the time for the DMA data transmission request sender and processor. Therefore, compared with Fig. 9 The time diagram shown corresponds to a shorter solution.
[0212] It can be seen that the present invention proposes a tree-type FPGA accelerator DMA parallel transmission acceleration topology based on FPGA accelerator interconnection and multi-sub-core collaboration, which can effectively utilize the DMA parallel transmission advantage of the FPGA accelerator under the same routing subnet, solve the strong coupling problem between the FPGA accelerator and the GPU, and use the FPGA accelerator under the same routing subnet to ensure high-speed DMA data transmission services without routing interference; the FPGA accelerator DMA scheduling transmission method based on the reservation processing mechanism saves the delay introduced by the request still needing to be sent after data preparation through the reservation mechanism. In combination with the proposed four-way handshake mechanism, the FPGA accelerator DMA resources under the same routing subnet can be reasonably and efficiently dynamically scheduled, and the strong coupling relationship between the FPGA accelerator and the GPU is released, ensuring the low latency and high throughput of data transmission between GPUs, and solving the problem of screening the target FPGA accelerator in the interconnected FPGA accelerator when the initial FPGA accelerator cannot provide DMA data transmission services. While improving the utilization rate of FPGA accelerator DMA data transmission, each FPGA accelerator can assist more sender GPUs under the same routing subnet to complete data transmission acceleration.
[0213] A method for data transmission between graphics processing units is described above. This embodiment further provides a system for data transmission between graphics processing units, including: multiple field programmable gate array accelerators, multiple graphics processing units, and routers. The same routing subnet includes multiple field programmable gate array accelerators, one or more groups of sender graphics processing units and receiver graphics processing units. All field programmable gate array accelerators under the same routing subnet include an initial field programmable gate array accelerator. The initial field programmable gate array accelerator is used to:
[0214] Receiving direct memory access data transmission service reservation request messages sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission;
[0215] Determine the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in each direct memory access data transmission service reservation request message; wherein the reservation execution time interval is the time interval of each direct memory access data transmission service to be executed;
[0216] Obtain a target FPGA accelerator so as to read data from the corresponding sender graphics processing unit in the target FPGA accelerator in the order of each scheduled execution time interval and transmit the data to the receiver graphics processing unit by direct memory access; wherein the target FPGA accelerator is an initial FPGA accelerator and / or a target interconnected FPGA accelerator, and the interconnected FPGA accelerator is an FPGA accelerator belonging to the same routing subnet as the initial FPGA accelerator. The number of fiber optic network ports in at least one FPGA accelerator is greater than or equal to 2.
[0217] The data transmission system between graphics processing units provided in this embodiment has the same or corresponding technical features as the data transmission method between graphics processing units described above. The embodiment of the data transmission method between graphics processing units has been described in detail above, and the embodiment of the data transmission system between graphics processing units will not be repeated here, and the effect is the same as above.
[0218] In the above embodiments, the data transmission method between graphics processing units is described in detail, and the present invention also provides a data transmission device between graphics processing units and corresponding embodiments. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.
[0219] An embodiment of the present invention provides a device for transmitting data between graphics processing units, which includes, based on the perspective of functional modules:
[0220] A receiving module is used to receive a direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission;
[0221] A determination module, used to determine a reservation execution time interval according to a reservation waiting error coefficient and a reservation time point in each direct memory access data transmission service reservation request message; wherein the reservation execution time interval is a time interval for each direct memory access data transmission service to be executed;
[0222] The acquisition module is used to acquire a target field programmable gate array accelerator, so as to read data from the corresponding sender graphics processing unit in the target field programmable gate array accelerator in the order of each reserved execution time interval and transmit the data to the receiver graphics processing unit by direct memory access; wherein the target field programmable gate array accelerator is an initial field programmable gate array accelerator and / or a target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator.
[0223] In some embodiments, the acquisition module specifically includes:
[0224] A first determination module is used to determine that the target field programmable gate array is an initial field programmable gate array accelerator and a target interconnected field programmable gate array accelerator when there is an overlap in the reserved execution time intervals corresponding to the multiple requests received at the same time; or, when a new request is received, if the reserved execution time interval corresponding to the new request coincides with the reserved execution time interval corresponding to the received request, determine that the target field programmable gate array is a target interconnected field programmable gate array accelerator;
[0225] A reading and transmission module, used to read data from a corresponding sending graphics processing unit in an initial field programmable gate array accelerator in a sequence of first scheduled execution time intervals and transmit the data to a receiving graphics processing unit by using a direct memory access method, and send a target direct memory access data transmission service reservation request message to a target interconnected field programmable gate array accelerator, so as to read data from a corresponding sending graphics processing unit in a sequence of second scheduled execution time intervals in the target interconnected field programmable gate array accelerator and transmit the data to a receiving graphics processing unit by using a direct memory access method;
[0226] The first reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in the remaining direct memory access data transmission service reservation request messages, the remaining direct memory access data transmission service reservation request messages are reservation request messages other than the target direct memory access data transmission service reservation request message among all direct memory access data transmission service reservation request messages received by the initial field programmable gate array accelerator, and the second reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in each target direct memory access data transmission service reservation request message;
[0227] Or, the acquisition module specifically includes: a determination submodule, which is used to determine that the target field programmable gate array is an initial field programmable gate array accelerator when there is no overlap in the reserved execution time intervals corresponding to the received requests, so as to read data from the corresponding sender graphics processing unit in the initial field programmable gate array accelerator in the order of each reserved execution time interval and transmit the data to the receiving graphics processing unit using direct memory access.
[0228] In some embodiments, the determining module includes:
[0229] A first acquisition module is used to obtain a product result of a reservation waiting error coefficient and a time taken by a field programmable gate array accelerator with a first preset number to transmit data of a sender graphics processing unit with a second preset number;
[0230] A second acquisition module is used to obtain the difference between the reservation time point in the direct memory access data transmission service reservation request message and the product result, and use the difference as the start time of the reservation execution time interval;
[0231] The third acquisition module is used to obtain the reservation time point, the product result, the time taken by the field programmable gate array accelerator with a first preset number to transmit the data of the sender graphics processing unit with a second preset number, and the sum of the time taken by the direct storage access internal logic of the field programmable gate array accelerator with the first preset number to process the data of the sender graphics processing unit with the second preset number in the direct memory access data transmission service reservation request message, and use the sum as the end time of the reservation execution time interval.
[0232] In some embodiments, a direct memory access reservation transmission queue and a direct memory access actual transmission queue are constructed in the data transmission sub-core of the field programmable gate array accelerator;
[0233] The data transmission device between graphics processing units also includes:
[0234] The storage module is used to store each direct memory access data transmission service reservation request message in a direct memory access reservation transmission queue.
[0235] In some embodiments, the device for transmitting data between graphics processing units further comprises:
[0236] A judgment module is used to start reading data from the sender graphics processing unit with a second preset number according to the order of each scheduled execution time interval from the direct memory access actual transmission queue of the target field programmable gate array accelerator, and judge whether the data reading from the memory address of the data to be transmitted of the sender graphics processing unit with the second preset number is completed within the preset time interval; if so, trigger the transmission module, if not, trigger the stop and sending module;
[0237] The transmission module is used to transmit the data to the receiving graphics processing unit by using direct memory access;
[0238] A stop and send module is used for the direct memory access actual transmission queue of the target field programmable gate array accelerator to stop executing the direct memory access data transmission service for the sender graphics processing unit with a second preset number; and to send to the sender graphics processing unit with the second preset number information used to indicate that the direct memory access data transmission service is to be executed by the central processor of the server where the sender graphics processing unit with the second preset number is located.
[0239] In some embodiments, the receiving module specifically includes:
[0240] The receiving submodule is used to receive the direct memory access data transmission service reservation request message sent when all threads in the same thread group of each sending graphics processing unit reach the preset computing stage of the computing task, wherein the computing task completed in the preset computing stage is greater than half of all computing tasks.
[0241] In some embodiments, the inter-GPU data transmission apparatus includes a second determination module for determining a target interconnected field programmable gate array accelerator;
[0242] The second determination module is specifically used to obtain the target interconnected field programmable gate array accelerator from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel; wherein the remaining field programmable gate array accelerators are the field programmable gate array accelerators except the initial field programmable gate array accelerator among all the field programmable gate array accelerators under the same routing subnet.
[0243] In some embodiments, the method and apparatus for transmitting data between graphics processing units also includes: a first sending module, which is used to send information representing a direct memory access data transmission service to be executed by the central processor of the server where the sending graphics processing unit with the second preset number is located, if the target interconnected field programmable gate array accelerator is not obtained from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel.
[0244] In some embodiments, the data transmission device between graphics processing units also includes: a selection module, which is used to randomly select a pending interconnection field programmable gate array accelerator as a target interconnection field programmable gate array accelerator from all the pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point if there are multiple pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point among all the pending interconnection field programmable gate array accelerators.
[0245] In some instances, the data transmission device between graphics processing units further includes: a second sending module, which is used to send fifth information to the interconnected field programmable gate array accelerator that has not sent the fourth information if fourth information sent by the interconnected field programmable gate array accelerator is not received within a first preset time period starting from sending the third information to each interconnected field programmable gate array accelerator, so that the interconnected field programmable gate array accelerator that has not sent the fourth information processes the preset reservation request within the reservation execution time interval corresponding to the direct memory access reservation transmission queue after receiving the fifth information; wherein the fifth information is information used to represent the cancellation of the interconnected field programmable gate array accelerator that has not sent the fourth information to perform data transmission service assistance.
[0246] In some embodiments, the data transmission device between graphics processing units also includes: a third sending module, which is used to send information representing the direct memory access data transmission service to be executed by the central processor of the server where the sending graphics processing unit with the second preset number is located, if the fourth information sent by all interconnected field programmable gate array accelerators is not received within a second preset time period starting from sending the third information to each interconnected field programmable gate array accelerator.
[0247] Since the embodiments of the device part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the device part, and they will not be repeated here. The effects are the same as above.
[0248] Fig.10 This is a structural diagram of a device for data transmission between graphics processing units provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, such as Fig.10 As shown, the data transmission device between graphics processing units includes:
[0249] A memory 20, for storing computer programs;
[0250] The processor 21 is used to implement the steps of the method for data transmission between graphics processing units mentioned in the above embodiment when executing a computer program.
[0251] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI processor, which is used to process computing operations related to machine learning.
[0252] The memory 20 may include one or more non-volatile storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the method for data transmission between graphics processing units disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the above-mentioned method for data transmission between graphics processing units, etc.
[0253] In some embodiments, the data transmission device between graphics processing units may also include a display screen 22 , an input and output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0254] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the data transmission device between graphics processing units, and may include more or less components than shown in the figure.
[0255] The inter-GPU data transmission device provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: an inter-GPU data transmission method, the effect is the same as above.
[0256] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned method for transmitting data between graphics processing units when executed by a processor.
[0257] Finally, the present invention also provides an embodiment corresponding to a non-volatile storage medium. The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0258] It is understandable that if the method in the above embodiment 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 the present invention, 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 to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0259] The non-volatile storage medium provided by the present invention includes the above-mentioned method for transmitting data between graphics processing units, and has the same effect as above.
[0260] The above is a detailed introduction to the data transmission method, system, device, product and equipment between graphics processing units provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0261] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for transmitting data between graphics processing units, characterized in that: Applied to an initial field programmable gate array accelerator, the method comprises: Receiving a direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission; Determine the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in each of the direct memory access data transmission service reservation request messages; wherein the reservation execution time interval is the time interval for each direct memory access data transmission service to be executed; A target field programmable gate array accelerator is obtained so that data can be read from a corresponding sending graphics processing unit in the target field programmable gate array accelerator in the order of each reserved execution time interval and the data can be transmitted to a receiving graphics processing unit by direct memory access; wherein the target field programmable gate array accelerator is the initial field programmable gate array accelerator and / or the target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator.
2. The method for transmitting data between graphics processing units according to claim 1, characterized in that: The step of acquiring a target field programmable gate array accelerator so as to read data from a corresponding sending graphics processing unit in the target field programmable gate array accelerator in the order of the scheduled execution time intervals and transmit the data to a receiving graphics processing unit by using a direct memory access method comprises: In the case where the reserved execution time intervals corresponding to the multiple requests received at the same time overlap, determining that the target field programmable gate array is the initial field programmable gate array accelerator and the target interconnected field programmable gate array accelerator; or, in the case where a new request is received, if the reserved execution time interval corresponding to the new request overlaps with the reserved execution time interval corresponding to the received request, determining that the target field programmable gate array is the target interconnected field programmable gate array accelerator; In the initial field programmable gate array accelerator, data is read from the corresponding sending graphics processing unit in the order of the first reserved execution time interval and the data is transmitted to the receiving graphics processing unit by direct memory access, and a target direct memory access data transmission service reservation request message is sent to the target interconnected field programmable gate array accelerator, so that in the target interconnected field programmable gate array accelerator, data is read from the corresponding sending graphics processing unit in the order of the second reserved execution time interval and the data is transmitted to the receiving graphics processing unit by direct memory access; The first reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in the remaining direct memory access data transmission service reservation request messages, the remaining direct memory access data transmission service reservation request messages are reservation request messages other than the target direct memory access data transmission service reservation request message among all direct memory access data transmission service reservation request messages received by the initial field programmable gate array accelerator, and the second reservation execution time interval is a time interval determined according to the reservation waiting error coefficient and the reservation time points in each target direct memory access data transmission service reservation request message; Alternatively, when there is no overlap between the reserved execution time intervals corresponding to the received requests, the target field programmable gate array is determined to be the initial field programmable gate array accelerator, so that data can be read from the corresponding sender graphics processing unit in the initial field programmable gate array accelerator in the order of the reserved execution time intervals and the data can be transmitted to the receiving graphics processing unit using direct memory access.
3. The method for transmitting data between graphics processing units according to claim 2, characterized in that: Determining the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in the reservation request message of the direct memory access data transmission service includes: Obtaining a product result of a reservation waiting error coefficient and a time taken by a field programmable gate array accelerator with a first preset number to transmit data of a sender graphics processing unit with a second preset number; Obtaining a difference between the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result, and using the difference as the start time of the reservation execution time interval; Obtain the reservation time point in the direct memory access data transmission service reservation request message, the multiplication result, the time taken by the field programmable gate array accelerator with the first preset number to transmit the data of the sender graphics processing unit with the second preset number, and the sum of the time taken by the direct storage access internal logic of the field programmable gate array accelerator with the first preset number to process the data of the sender graphics processing unit with the second preset number, and use the sum as the end time of the reservation execution time interval.
4. The method for transmitting data between graphics processing units according to claim 1, characterized in that: The step of reading data from the corresponding sending GPU in the target FPGA accelerator in the order of the scheduled execution time intervals and transmitting the data to the receiving GPU by direct memory access includes: Determining whether the target field programmable gate array accelerator and the graphics processing unit of the sender of the data to be read belong to the same server; If not, the target field programmable gate array accelerator reads data from the corresponding sender graphics processing unit in the order of the scheduled execution time intervals using remote direct memory access technology, and transmits the data to the receiver graphics processing unit using direct memory access.
5. The method for transmitting data between graphics processing units according to claim 3, characterized in that: The kernel in the field programmable gate array accelerator includes a data transmission sub-kernel and a task control sub-kernel; wherein the data transmission sub-kernel is used to perform data transmission operations, and the task control sub-kernel is used to perform graphics processing unit data task scheduling transmission operations.
6. The method for transmitting data between graphics processing units according to claim 5, characterized in that: A direct memory access reservation transmission queue and a direct memory access actual transmission queue are constructed in the data transmission sub-core of the field programmable gate array accelerator; After receiving the direct memory access data transmission service reservation request message sent by each sending graphics processing unit under the same routing subnet, the method further includes: storing each of the direct memory access data transmission service reservation request messages in the direct memory access reservation transmission queue; The step of reading data from the corresponding sending GPU in the target FPGA accelerator in the order of the scheduled execution time intervals and transmitting the data to the receiving GPU by direct memory access includes: In the target field programmable gate array accelerator, the direct memory access actual transmission queue of the target field programmable gate array accelerator reads data from the corresponding sending graphics processing unit in the order of each reserved execution time interval and transmits the data to the receiving graphics processing unit using a direct memory access method.
7. The method for transmitting data between graphics processing units according to claim 6, characterized in that: Before the data is transmitted to the receiving graphics processing unit in a direct memory access manner, the method further includes: Starting from the direct memory access actual transmission queue of the target field programmable gate array accelerator, reading data from the second preset numbered sender graphics processing unit in the order of each scheduled execution time interval, determining whether data reading from the memory address of the data to be transmitted of the second preset numbered sender graphics processing unit is completed within the preset time interval; If yes, then entering the step of transmitting the data to the receiving party's graphics processing unit by direct memory access; If not, the direct memory access actual transmission queue of the target field programmable gate array accelerator stops performing direct memory access data transmission service on the sender graphics processing unit with the second preset number; and sends to the sender graphics processing unit with the second preset number information representing that the direct memory access data transmission service is to be performed by the central processor of the server where the sender graphics processing unit with the second preset number is located.
8. The method for transmitting data between graphics processing units according to claim 7, characterized in that: The starting time of the preset time interval is the difference between the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result, and the end time of the preset time interval is the sum of the reservation time point in the direct memory access data transmission service reservation request message and the multiplication result.
9. The method for transmitting data between graphics processing units according to claim 1, characterized in that: The receiving of direct memory access data transmission service reservation request messages sent by the sending graphics processing units under the same routing subnet includes: The direct memory access data transmission service reservation request message is sent when all threads in the same thread group of each sending graphics processing unit reach a preset computing stage of the computing task, wherein the computing task completed in the preset computing stage is greater than half of all computing tasks.
10. The method for transmitting data between graphics processing units according to claim 6, characterized in that: Determining the target interconnected field programmable gate array accelerator includes: The target interconnected field programmable gate array accelerator is obtained from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel; wherein the remaining field programmable gate array accelerators are field programmable gate array accelerators other than the initial field programmable gate array accelerator in all field programmable gate array accelerators under the same routing subnet.
11. The method for transmitting data between graphics processing units according to any one of claims 1 to 10, characterized in that: The method further comprises: If the target interconnected field programmable gate array accelerator is not obtained from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel, information representing that a direct memory access data transmission service is to be executed by a central processor of a server where the second preset numbered sender graphics processing unit is located is sent to the sender graphics processing unit with a second preset number.
12. The method for transmitting data between graphics processing units according to claim 10, characterized in that: The step of acquiring the target interconnected field programmable gate array accelerator from the remaining field programmable gate array accelerators based on multiple handshakes in the task control sub-kernel includes: In the case where it is detected that the direct memory access data transmission service cannot be provided within the reserved execution time interval, first information for characterizing data transmission assistance is sent to the interconnected field programmable gate array accelerator in a multicast manner, and a direct memory access data transmission service reservation request message of the sender graphics processing unit is forwarded to the interconnected field programmable gate array accelerator under the same routing subnet to implement a first handshake; receiving second information sent by each of the interconnected field programmable gate array accelerators to implement a second handshake; wherein the second information is used to indicate whether the interconnected field programmable gate array accelerator can or cannot provide a direct memory access data transmission service within the second scheduled execution time interval; Sending third information to each interconnected field programmable gate array accelerator to implement a third handshake; wherein the third information includes information indicating that the second information sent by the interconnected field programmable gate array accelerator has been received, and sending information to each interconnected field programmable gate array accelerator indicating whether the accelerator is selected or not selected as the target interconnected field programmable gate array accelerator; Receive fourth information sent by each interconnected field programmable gate array accelerator to implement a fourth handshake; wherein the fourth information includes information indicating that it is known that the interconnected field programmable gate array accelerator has received the third information, and information that the scheduling operation is completed or not completed according to the third information.
13. The method for transmitting data between graphics processing units according to claim 12, characterized in that: If the received second information is information indicating that the interconnected field programmable gate array accelerator can provide a direct memory access data transmission service within the second reserved execution time interval, the second information at least includes an actual bandwidth of the interconnected field programmable gate array accelerator and a reserved waiting error coefficient; Determining whether an interconnect FPGA accelerator is selected or not selected includes: If the received second information is information indicating that the interconnected field programmable gate array accelerator cannot provide a direct memory access data transmission service within the second scheduled execution time interval, determining that the interconnected field programmable gate array accelerator is not selected; If the received second information is information indicating that the interconnected field programmable gate array accelerator can provide direct memory access data transmission service within the second scheduled execution time interval, the interconnected field programmable gate array accelerator that can provide direct memory access data transmission service within the second scheduled execution time interval is determined to be a pending interconnected field programmable gate array accelerator, and the pending interconnected field programmable gate array accelerators are sorted according to the order of the second scheduled execution time intervals corresponding to the pending interconnected field programmable gate array accelerators, and it is determined that the pending interconnected field programmable gate array accelerator with the earliest end time among all the pending interconnected field programmable gate array accelerators is selected, and it is determined that the interconnected field programmable gate array accelerators other than the pending interconnected field programmable gate array accelerator with the earliest end time among all the pending interconnected field programmable gate array accelerators are not selected.
14. The method for transmitting data between graphics processing units according to claim 13, characterized in that: The method further comprises: If there are multiple pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point among all the pending interconnection field programmable gate array accelerators, one pending interconnection field programmable gate array accelerator is randomly selected from all the pending interconnection field programmable gate array accelerators with the earliest end time and the same end time point as the target interconnection field programmable gate array accelerator.
15. The method for transmitting data between graphics processing units according to claim 12, characterized in that: Also includes: Since the third information is sent to each interconnected field programmable gate array accelerator, if the fourth information sent by the interconnected field programmable gate array accelerator is not received within the first preset time period, fifth information is sent to the interconnected field programmable gate array accelerator that has not sent the fourth information, so that the interconnected field programmable gate array accelerator that has not sent the fourth information processes the preset reservation request within the reservation execution time interval corresponding to the direct memory access reservation transmission queue after receiving the fifth information; wherein the fifth information is information used to represent the cancellation of the interconnected field programmable gate array accelerator that has not sent the fourth information to perform data transmission service assistance.
16. The method for transmitting data between graphics processing units according to claim 12, characterized in that: Also includes: Since the third information is sent to each interconnected field programmable gate array accelerator, if the fourth information sent by all the interconnected field programmable gate array accelerators is not received within a second preset time period, information representing that a direct memory access data transmission service is to be executed by the central processor of the server where the sender graphics processing unit with the second preset number is located is sent to the sender graphics processing unit with the second preset number.
17. A data transmission system between graphics processing units, characterized in that: include: A plurality of field programmable gate array accelerators, a plurality of graphics processing units and a router, wherein the same routing subnet includes the plurality of field programmable gate array accelerators, one or more groups of sender graphics processing units and receiver graphics processing units, and all field programmable gate array accelerators under the same routing subnet include an initial field programmable gate array accelerator, and the initial field programmable gate array accelerator is used to: Receiving a direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission; Determine the reservation execution time interval according to the reservation waiting error coefficient and the reservation time point in each of the direct memory access data transmission service reservation request messages; wherein the reservation execution time interval is the time interval for each direct memory access data transmission service to be executed; A target field programmable gate array accelerator is obtained so that data can be read from a corresponding sending graphics processing unit in the target field programmable gate array accelerator in the order of each reserved execution time interval and the data can be transmitted to a receiving graphics processing unit by direct memory access; wherein the target field programmable gate array accelerator is the initial field programmable gate array accelerator and / or the target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator.
18. The data transmission system between graphics processing units according to claim 17, characterized in that: The number of fiber optic network ports in at least one field programmable gate array accelerator is greater than or equal to 2.
19. A device for transmitting data between graphics processing units, characterized in that: Applied to an initial field programmable gate array accelerator, the device comprises: A receiving module, configured to receive a direct memory access data transmission service reservation request message sent by each sender graphics processing unit under the same routing subnet; wherein the direct memory access data transmission service reservation request message at least includes a reservation time point, and the reservation time point is the time when the sender graphics processing unit thread group is to be executed by the field programmable gate array accelerator for direct memory access data transmission; A determination module, configured to determine a reservation execution time interval according to a reservation waiting error coefficient and a reservation time point in each of the direct memory access data transmission service reservation request messages; wherein the reservation execution time interval is a time interval for each direct memory access data transmission service to be executed; The acquisition module is used to acquire a target field programmable gate array accelerator, so as to read data from the corresponding sender graphics processing unit in the target field programmable gate array accelerator in the order of each reserved execution time interval and transmit the data to the receiver graphics processing unit by direct memory access; wherein the target field programmable gate array accelerator is the initial field programmable gate array accelerator and / or the target interconnected field programmable gate array accelerator, and the interconnected field programmable gate array accelerator is a field programmable gate array accelerator belonging to the same routing subnet as the initial field programmable gate array accelerator.
20. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the method for data transmission between graphics processing units as claimed in any one of claims 1 to 16 are implemented.
21. A data transmission device between graphics processing units, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for transmitting data between graphics processing units as claimed in any one of claims 1 to 16 when executing the computer program.
22. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for transmitting data between graphics processing units according to any one of claims 1 to 16 are implemented.
