Data transmission method and device and computer equipment

By introducing shared memory in computing nodes for PCIe-type data transfer and combining point-to-point and PCIe-type links, the problem of low data transmission efficiency in the existing technology is solved, and more efficient data transmission is achieved.

CN120743576APending Publication Date: 2025-10-03SUGON INFORMATION IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510819472.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

When both point-to-point transmission type and PCIe type communication links exist in a computing node, the existing technology uses only the point-to-point transmission type by default, resulting in reduced data transmission efficiency.

Method used

By introducing the shared memory provided by the central processing unit, using PCIe type communication links for data transfer, and combining point-to-point transmission type and PCIe type communication links for data transmission.

Benefits of technology

The utilization efficiency of the communication link is improved, thereby improving the efficiency and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743576A_ABST
    Figure CN120743576A_ABST
Patent Text Reader

Abstract

The invention relates to a data transmission method and device and computer equipment. The method is applied to a first GPU in a computing node, and comprises the following steps: determining a link type of a communication link between the first GPU and a second GPU in the computing node under the condition of having a demand for transmitting target data to the second GPU, and transmitting the target data to the second GPU in the computing node under the condition that the link type comprises a point-to-point transmission type and a universal peripheral extension PCIe type, transmitting first data to the second GPU through a point-to-point transmission type communication link between the first GPU and the second GPU based on a shared memory provided by a central processing unit (CPU) in the computing node, and transmitting second data to the second GPU through a PCIe type communication link between the first GPU and the second GPU based on the shared memory provided by the CPU in the computing node; wherein the target data comprises the first data and the second data. By adopting the method, the data transmission efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data transmission method, apparatus, and computer equipment. Background Art

[0002] With the rapid development of high-performance computing, the demand for computing resources has also increased dramatically. To meet this demand, the multi-GPU (Graphics Processing Unit) architecture has emerged. Specifically, multiple GPUs in a computing node can process complex computing tasks in parallel, significantly increasing computing speed.

[0003] In order to ensure the reliability of data transmission between GPUs, the existing technology can use both point-to-point transmission type communication links and peripheral component interconnect express (PCIe) type PCIe communication links to perform data transmission between GPUs.

[0004] However, when two types of communication links exist at the same time, only the point-to-point transmission type communication link will be used for data transmission by default, which will reduce the efficiency of data transmission. Summary of the Invention

[0005] Based on this, it is necessary to provide a data transmission method, device and computer equipment that can improve data transmission efficiency in response to the above technical problems.

[0006] In a first aspect, the present application provides a data transmission method, applied to a first GPU in a computing node, comprising:

[0007] In a case where there is a need to transmit target data to a second GPU in the computing node, determining a link type of a communication link between the first GPU and the second GPU;

[0008] When the link type includes a point-to-point transmission type and a PCIe type, transmitting the first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0009] Based on the shared memory provided by the central processing unit (CPU) in the computing node, the second data is transmitted to the second GPU via a PCIe type communication link between the first GPU and the second GPU; wherein the target data includes the first data and the second data.

[0010] In the implementation mode of the present application, a shared memory provided by the CPU is introduced, and data transfer of the PCIe type communication link is performed through the shared memory, so that data transmission is performed using both the point-to-point transmission type communication link and the PCIe type communication link at the same time, which can effectively improve the efficiency of the use of the communication link and thus improve the efficiency of data transmission.

[0011] In one embodiment, the PCIe type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU, and a second PCIe communication link connected to the second GPU;

[0012] Transmitting the second data to the second GPU via a PCIe-type communication link between the first GPU and the second GPU based on a shared memory provided by a central processing unit (CPU) in the computing node includes:

[0013] The second data is written to the shared memory via the first PCIe communication link, so that the second data is read from the shared memory via the second PCIe communication link and transmitted to the second GPU.

[0014] In an embodiment of the present application, second data is written to the shared memory through the first PCIe communication link, so that the second PCIe communication link reads the second data from the shared memory and transmits it to the second GPU, thereby ensuring the reliability of data transmission.

[0015] In one embodiment, writing second data to a shared memory via a first PCIe communication link so that a second PCIe communication link reads the second data from the shared memory and transmits the second data to a second GPU includes:

[0016] Determine, from each candidate ring buffer queue in the shared memory, a first ring buffer queue corresponding to the first GPU and the second GPU according to the identification information of the first GPU and the identification information of the second GPU;

[0017] The second data is written to the first ring buffer queue in the shared memory via the first PCIe communication link, so that the second data is read from the first ring buffer queue via the second PCIe communication link and transmitted to the second GPU.

[0018] In an embodiment of the present application, by selecting a first ring buffer queue that is compatible with the data transmission process, and writing second data to the first ring buffer queue through the first PCIe communication link, so that the second PCIe communication link can read the second data from the first ring buffer queue, the reliability of data transmission can be guaranteed.

[0019] In one embodiment, transmitting the first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU includes:

[0020] The first data is written into the second ring buffer queue so that the point-to-point transmission type communication link between the first GPU and the second GPU can read the first data from the second ring buffer queue and transmit it to the second GPU; wherein the second ring buffer queue is a ring buffer queue associated with the point-to-point transmission type communication link between the first GPU and the second GPU.

[0021] In an embodiment of the present application, by writing the first data into the second ring buffer queue, a point-to-point transmission type communication link reads the first data from the second ring buffer queue, thereby transmitting the first data to the second GPU, thereby ensuring the reliability of data transmission.

[0022] In one embodiment, the method further comprises:

[0023] The target data is divided according to the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link to obtain first data and second data; wherein the link configuration information includes communication bandwidth and / or number of links.

[0024] In an embodiment of the present application, by dividing the target data according to the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link, the rationality of the data division can be ensured.

[0025] In a second aspect, the present application provides a data transmission method, applied to a second GPU in a computing node, comprising:

[0026] When detecting that the first GPU is transmitting data to the second GPU, determining a link type of a communication link between the first GPU and the second GPU;

[0027] When the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type, obtaining first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0028] Based on the shared memory provided by the CPU in the computing node, the second data transmitted by the first GPU is obtained through a PCIe type communication link between the first GPU and the second GPU.

[0029] In an embodiment of the present application, a shared memory provided by the CPU is introduced, and data of a PCIe type communication link is transferred through the shared memory, so that the data transmitted by the first GPU can be obtained by using both a point-to-point transmission type communication link and a PCIe type communication link at the same time, which can effectively improve the efficiency of using the communication link and thus improve the efficiency of data transmission.

[0030] In one embodiment, the PCIe type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU, and a second PCIe communication link connected to the second GPU;

[0031] Acquiring, based on a shared memory provided by a CPU in a computing node, second data transmitted by the first GPU through a PCIe type communication link between the first GPU and the second GPU, includes:

[0032] Read second data from the shared memory via the second PCIe communication link; wherein the second data is written into the shared memory by the first GPU via the first PCIe communication link.

[0033] In the embodiment of the present application, the second data written by the first PCIe communication link is obtained from the shared memory through the second PCIe communication link, which can ensure the reliability of data transmission.

[0034] In a third aspect, the present application further provides a data transmission device, applied to a first GPU in a computing node, comprising:

[0035] A first determining module is configured to determine a link type of a communication link between the first GPU and the second GPU when there is a demand to transmit target data to the second GPU in the computing node;

[0036] a first transmission module, configured to transmit first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU when the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type; and

[0037] The second transmission module is used to transmit the second data to the second GPU based on the shared memory provided by the central processing unit (CPU) in the computing node through the PCIe type communication link between the first GPU and the second GPU; wherein the target data includes the first data and the second data.

[0038] In a fourth aspect, the present application further provides a data transmission device, applied to a second GPU in a computing node, comprising:

[0039] a second determining module, configured to determine a link type of a communication link between the first GPU and the second GPU when detecting that the first GPU is transmitting data to the second GPU;

[0040] A first acquisition module is configured to acquire first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU when the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type; and

[0041] The second acquisition module is configured to acquire, based on a shared memory provided by a CPU in the computing node, second data transmitted by the first GPU through a PCIe type communication link between the first GPU and the second GPU.

[0042] In a fifth aspect, the present application further provides a computer device, applied to a first GPU in a computing node, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0043] In a case where there is a need to transmit target data to a second GPU in the computing node, determining a link type of a communication link between the first GPU and the second GPU;

[0044] When the link type includes a point-to-point transmission type and a PCIe type, transmitting the first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0045] Based on the shared memory provided by the central processing unit (CPU) in the computing node, the second data is transmitted to the second GPU via a PCIe type communication link between the first GPU and the second GPU; wherein the target data includes the first data and the second data.

[0046] In a sixth aspect, the present application further provides a computer device, applied to a second GPU in a computing node, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0047] When detecting that the first GPU is transmitting data to the second GPU, determining a link type of a communication link between the first GPU and the second GPU;

[0048] When the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type, obtaining first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0049] Based on the shared memory provided by the CPU in the computing node, the second data transmitted by the first GPU is obtained through a PCIe type communication link between the first GPU and the second GPU.

[0050] In a seventh aspect, the present application further provides a computer-readable storage medium, applied to a first GPU in a computing node, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0051] In a case where there is a need to transmit target data to a second GPU in the computing node, determining a link type of a communication link between the first GPU and the second GPU;

[0052] When the link type includes a point-to-point transmission type and a PCIe type, transmitting the first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0053] Based on the shared memory provided by the central processing unit (CPU) in the computing node, the second data is transmitted to the second GPU via a PCIe type communication link between the first GPU and the second GPU; wherein the target data includes the first data and the second data.

[0054] In an eighth aspect, the present application further provides a computer-readable storage medium, applied to a second GPU in a computing node, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0055] When detecting that the first GPU is transmitting data to the second GPU, determining a link type of a communication link between the first GPU and the second GPU;

[0056] When the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type, obtaining first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0057] Based on the shared memory provided by the CPU in the computing node, the second data transmitted by the first GPU is obtained through a PCIe type communication link between the first GPU and the second GPU.

[0058] In a ninth aspect, the present application further provides a computer program product, applied to a first GPU in a computing node, comprising a computer program, which, when executed by a processor, implements the following steps:

[0059] In a case where there is a need to transmit target data to a second GPU in the computing node, determining a link type of a communication link between the first GPU and the second GPU;

[0060] When the link type includes a point-to-point transmission type and a PCIe type, transmitting the first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0061] Based on the shared memory provided by the central processing unit (CPU) in the computing node, the second data is transmitted to the second GPU via a PCIe type communication link between the first GPU and the second GPU; wherein the target data includes the first data and the second data.

[0062] In a tenth aspect, the present application further provides a computer program product, applied to a second GPU in a computing node, comprising a computer program, which, when executed by a processor, implements the following steps:

[0063] When detecting that the first GPU is transmitting data to the second GPU, determining a link type of a communication link between the first GPU and the second GPU;

[0064] When the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type, obtaining first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU; and

[0065] Based on the shared memory provided by the CPU in the computing node, the second data transmitted by the first GPU is obtained through a PCIe type communication link between the first GPU and the second GPU.

[0066] The above-mentioned data transmission method, apparatus, and computer device are applied to a first GPU. When there is a need to transmit target data to a second GPU in a computing node, the method determines the link type of the communication link between the first GPU and the second GPU. When the link type includes a point-to-point transmission type and a PCIe type, the method transmits first data in the target data to the second GPU via the point-to-point transmission type communication link between the first GPU and the second GPU. Furthermore, based on the shared memory provided by the central processing unit (CPU) in the computing node, the method transmits second data in the target data to the second GPU via the PCIe type communication link between the first GPU and the second GPU. Compared to the related art, when both communication links exist, the method defaults to using only the point-to-point transmission type communication link for data transmission. The method introduces a shared memory provided by the CPU, and uses the shared memory to transfer data for the PCIe type communication link. Thus, the method uses both the point-to-point transmission type and the PCIe type communication link for data transmission, effectively improving the efficiency of communication link utilization and thus improving the efficiency of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0068] Figure 1 1 is a flow chart of a data transmission method according to an embodiment;

[0069] Figure 2 is a schematic diagram of a data communication link in one embodiment;

[0070] Figure 3 A schematic diagram of a process for performing data transmission using a PCIe communication link in one embodiment;

[0071] Figure 4 A schematic flow chart of a data transmission method in another embodiment;

[0072] Figure 5 A schematic diagram of a data transmission process in one embodiment;

[0073] Figure 6 is a structural block diagram of a data transmission device in one embodiment;

[0074] Figure 7 is a structural block diagram of a data transmission device in another embodiment;

[0075] Figure 8 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0077] With the rapid development of high-performance computing, the demand for computing resources has also increased dramatically. To meet this demand, multi-GPU architectures have emerged. In other words, multiple GPUs in a computing node can process complex computing tasks in parallel, significantly improving computing speed.

[0078] In order to ensure the reliability of data transmission between GPUs, the existing technology can use both point-to-point transmission type communication links and peripheral component interconnect express (PCIe) type PCIe communication links to perform data transmission between GPUs.

[0079] However, when two types of communication links exist at the same time, only the point-to-point transmission type communication link will be used for data transmission by default, which will reduce the efficiency of data transmission.

[0080] Based on this, in an exemplary embodiment, a data transmission method is provided, which is described by taking the method applied to the first GPU in the computing node as an example. Figure 1 As shown, the specific steps include:

[0081] S101 : When there is a need to transmit target data to a second GPU in a computing node, determine a link type of a communication link between a first GPU and a second GPU.

[0082] The first GPU is the GPU that needs to send data, and the second GPU is the target of the first GPU's data transmission. The target data is the data that the first GPU wants to transmit to the second GPU. The link type is the data transmission type of the communication link.

[0083] After building a compute node, to clearly identify the connections between the hardware components within the node, you can perform a topology check on the hardware when starting the NVIDIA Collective Communications Library (NCCL). This helps determine the hardware interconnection information between the GPUs within the node. This hardware interconnection information includes the communication links between the GPUs.

[0084] In an optional implementation, when it is detected that the first GPU in the computing node has a need to transmit target data to the second GPU, the link type of the communication link between the first GPU and the second GPU can be determined based on the hardware interconnection between the GPUs in the computing node.

[0085] For example, the identification information of the first GPU and the identification information of the second GPU can be used as indexes to query the hardware interconnection information to obtain the communication links between the first GPU and the second GPU, and then determine the link type of the communication link between the first GPU and the second GPU.

[0086] S102, when the link type includes a point-to-point transmission type and a PCIe type, transmitting first data to the second GPU via a communication link of the point-to-point transmission type between the first GPU and the second GPU, and transmitting second data to the second GPU via a PCIe type communication link between the first GPU and the second GPU based on a shared memory provided by a central processing unit (CPU) in the computing node.

[0087] A point-to-point communication link is one that allows direct communication between GPUs, such as the NVLink communication link. NVLink is a bus and communication protocol developed and released by NVIDIA that uses a point-to-point architecture and serial transmission to connect multiple GPUs.

[0088] The so-called Universal Peripheral Extension (PCIe) type communication link includes two data transmission methods: direct peer-to-peer (P2P) transmission, that is, GPUs exchange data directly over the PCIe communication link without going through the central processing unit (CPU) or memory; the other is transit through system memory, that is, data is transferred between two GPUs over the PCIe communication link based on system memory. Shared memory is the memory that can be used by all PCIe communication links in the compute node.

[0089] The so-called target data includes first data and second data. The so-called first data is data sent using a point-to-point transmission type communication link; the so-called second data is data sent using a PCIe type communication link.

[0090] In an optional embodiment, if it is determined that the link type only includes point-to-point transmission types, the point-to-point transmission type communication link can be directly used to transmit the target data to the second GPU. For example, if the only communication link between GPU-A and GPU-B is NVLink, the NVLink communication link can be directly used for data transmission between GPU-A and GPU-B.

[0091] If it is determined that the link type only includes PCIe types, the target data can be transmitted to the second GPU through direct peer-to-peer transmission. For example, if there is only a PCIe communication link between GPU-A and GPU-B, the PCIe communication link can be directly used for data transmission between GPU-A and GPU-B.

[0092] It is worth noting that when it is determined that the link type includes both point-to-point transmission type and PCIe type, in the relevant technology, the GPU generally defaults to using only point-to-point transmission type communication links for data transmission, and only uses PCIe type communication links when accessing the shared memory of the host side (CPU).

[0093] Based on this, in an optional implementation, when it is determined that the link type between the first GPU and the second GPU includes both the point-to-point transmission type and the PCIe type, a shared memory will be pre-applied in the CPU associated with the computing node for transiting data.

[0094] When the first GPU needs to transmit target data to the second GPU, the target data can be split into first data and second data. Then, the first data is directly transmitted to the second GPU using a point-to-point transmission type communication link. At the same time, a PCIe type communication link is used to transmit the second data to the second GPU via shared memory.

[0095] For example, reference Figure 2 Schematic diagram of the data communication link shown, wherein, Figure 2 In the figure, the solid lines represent PCIe links, while the dashed lines represent NVLink links. When GPU0 transfers data to GPU3, NVLink-1, which connects GPU0 and GPU3, can be used for direct data transfer. Simultaneously, PCIe-0, which connects GPU0 and shared memory, writes the data to shared memory. PCIe-3, which connects shared memory and GPU3, retrieves the data from shared memory and transfers it to GPU3.

[0096] The above-mentioned data transmission method is applied to a first GPU. When there is a need to transmit target data to a second GPU in a computing node, the link type of the communication link between the first GPU and the second GPU is determined. When the link type includes a point-to-point transmission type and a PCIe type, the first data in the target data is transmitted to the second GPU via the point-to-point transmission type communication link between the first GPU and the second GPU; and, based on the shared memory provided by the central processing unit (CPU) in the computing node, the second data in the target data is transmitted to the second GPU via the PCIe type communication link between the first GPU and the second GPU. Compared with the related art, when two communication links exist at the same time, the default method is to use only the point-to-point transmission type communication link for data transmission. The above-mentioned method introduces the shared memory provided by the CPU, and uses the shared memory to transfer data of the PCIe type communication link, thereby using both the point-to-point transmission type communication link and the PCIe type communication link for data transmission. This can effectively improve the efficiency of communication link utilization and thus improve the efficiency of data transmission.

[0097] Based on the above embodiment, in an embodiment of the present application, the PCIe-type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU, and a second PCIe communication link connected to the second GPU; further, an optional method of using the PCIe communication link for data transmission is provided, specifically, writing second data to the shared memory through the first PCIe communication link, so that the second PCIe communication link can read the second data from the shared memory and transmit it to the second GPU.

[0098] The so-called first PCIe communication link is the PCIe communication link between the first GPU and the shared memory; the so-called second PCIe communication link is the PCIe communication link between the second GPU and the shared memory. Figure 2 When using the PCIe communication link to transmit data from GPU0 to GPU3, the first PCIe communication link is PCIe-0 and the second PCIe communication link is PCIe-3.

[0099] In an optional implementation, the first PCIe communication link connected to the first GPU may be used to write the second data to be transmitted into the shared memory; then, the second PCIe communication link may be used to read the second data from the shared memory and transmit the read second data to the second GPU. Figure 2When using the PCIe communication link to transmit data from GPU0 to GPU3, PCIe-0 can be used to write the data to be transmitted by GPU0 into the shared memory, and then PCIe-3 can be used to read the data to be transmitted and transmit the data to GPU3.

[0100] In an embodiment of the present application, second data is written to the shared memory through the first PCIe communication link, so that the second PCIe communication link reads the second data from the shared memory and transmits it to the second GPU, thereby ensuring the reliability of data transmission.

[0101] In order to ensure the reliability of data transmission, based on the above embodiment, in the embodiment of the present application, another optional method of using PCIe communication link for data transmission is provided, such as Figure 3 As shown, the specific steps include:

[0102] S301 : Determine, from candidate ring buffer queues in a shared memory, first ring buffer queues corresponding to the first GPU and the second GPU according to identification information of the first GPU and identification information of the second GPU.

[0103] The identification information is information used to identify a GPU, which can be a unique ID. A ring buffer is a buffer connected head-to-tail. The candidate ring buffer is a ring buffer in shared memory corresponding to the PCIe communication link between GPUs. The first ring buffer is a ring buffer in shared memory corresponding to data transmission from the first GPU to the second GPU.

[0104] It is understandable that in order to ensure the accuracy of data transmission, corresponding candidate ring buffer queues can be constructed in advance based on different data transmission combinations between GPUs. Accordingly, when writing data to the shared memory through the PCIe communication link, the target ring buffer queue to be written can be selected from the candidate ring buffer queues.

[0105] In an optional embodiment, the identification information of the first GPU and the identification information of the second GPU can be used as index information at the same time to search the ring buffer queue information associated with the shared memory stored in the first GPU to obtain an alternative ring buffer queue that matches both the identification information of the first GPU and the identification information of the second GPU; then, the first ring buffer queue that matches the data transmission direction (from the first GPU to the second GPU) is selected from the alternative ring buffer queues, and the address information of the first ring buffer queue is determined.

[0106] S302 , writing second data to a first ring buffer queue in a shared memory via a first PCIe communication link, so that a second PCIe communication link reads the second data from the first ring buffer queue and transmits the second data to a second GPU.

[0107] In an optional embodiment, the second data can be written to the first ring buffer queue in the shared memory via the first PCIe communication link based on the address information of the first ring buffer queue. Thereafter, the second data in the first ring buffer queue can be read by the second PCIe communication link and transmitted to the second GPU.

[0108] For example, when each data block in the circular buffer queue can accommodate 512k bytes, after writing 512k bytes of second data to the first circular buffer queue through the first PCIe communication link, the tail pointer of the first circular buffer queue is increased by 1, and it is determined whether there is any remaining space in the first circular buffer queue. If there is, the remaining second data will continue to be written into the next data block; otherwise, the process will continue to wait.

[0109] Correspondingly, when reading the second data based on the second PCIe communication link, it is possible to determine whether the second data has been written by judging the position difference between the head pointer and the tail pointer of the first ring buffer queue. If so, the second data is read from the first ring buffer queue, and the head pointer of the first ring buffer queue is increased by 1. Then, it is continued to be determined whether there is any remaining second data in the first ring buffer queue. If so, continue to read; if not, wait.

[0110] In an embodiment of the present application, by selecting a first ring buffer queue that is compatible with the data transmission process, and writing second data to the first ring buffer queue through the first PCIe communication link, so that the second PCIe communication link can read the second data from the first ring buffer queue, the reliability of data transmission can be guaranteed.

[0111] In order to ensure the reliability of data transmission, based on the above embodiments, in an embodiment of the present application, an optional method of using a point-to-point transmission communication link for data transmission is provided. Specifically, the first data is written into a second ring buffer queue for a point-to-point transmission type communication link between the first GPU and the second GPU. The first data is read from the second ring buffer queue and transmitted to the second GPU.

[0112] The second ring buffer queue is associated with the point-to-point transmission type communication link between the first GPU and the second GPU. It is worth noting that to ensure efficient data transmission, for a point-to-point transmission communication link connecting two GPUs, memory buffers can be requested at both ends of the communication link to store data transmitted by the two GPUs in different transmission directions.

[0113] For example, reference Figure 2 For NVLink-1 between GPU0 and GPU3, a ring buffer queue can be built at the end of NVLink-1 where GPU0 is located to store data sent from GPU0 to GPU3, and a ring buffer queue can be built at the end of NVLink-1 where GPU3 is located to store data sent from GPU3 to GPU0.

[0114] In an alternative embodiment, the first data can be written into a point-to-point communication link between the first GPU and the second GPU, with the transmission direction being from the first GPU to the second GPU. Subsequently, the first data can be transmitted to the second GPU by reading the first data from the second ring buffer.

[0115] For example, reference Figure 2 When NVLink-1 is used to transmit data from GPU0 to GPU3, the data to be transmitted by GPU0 can be written into the circular buffer queue buffer-0 located at one end of GPU0 in NVLink-1, and then the data can be transmitted to GPU3 by reading the data in buffer-0.

[0116] When NVLink-1 is used to transmit data from GPU3 to GPU0, the data to be transmitted by GPU3 can be written into the circular buffer queue buffer-3 located at one end of GPU3 in NVLink-1, and then the data can be transmitted to GPU0 by reading the data in buffer-3.

[0117] In an embodiment of the present application, by writing the first data into the second ring buffer queue, a point-to-point transmission type communication link reads the first data from the second ring buffer queue, thereby transmitting the first data to the second GPU, thereby ensuring the reliability of data transmission.

[0118] In order to ensure the rationality of data transmission, based on the above embodiments, an optional method of data division is provided in an embodiment of the present application. Specifically, the target data is divided according to the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link to obtain the first data and the second data.

[0119] The link configuration information includes communication bandwidth and / or link quantity. Furthermore, the communication bandwidth is the maximum amount of data that can be transmitted by the communication channel per unit time; the link quantity is the number of communication links.

[0120] In an optional embodiment, in order to ensure the reliability of data division, the data volume ratio between the first data and the second data can be determined based on the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link; then, the target data is divided according to the data volume ratio between the first data and the second data to obtain the data that can be transmitted by each communication link.

[0121] For example, if the link configuration information only includes the communication bandwidth, the ratio of the first data to the second data can be determined based on the ratio of the communication bandwidth of the point-to-point transmission communication link to the communication bandwidth of the PCIe communication link. For example, if the communication bandwidth between the NVLink communication link and the PCIe communication link is 2:1, the ratio of the first data to the second data is also 2:1.

[0122] If the link configuration information only includes the number of links, the ratio of the first data to the second data can be determined by the ratio of the number of point-to-point transmission communication links to the number of PCIe communication links. For example, if the ratio of the number of NVLink communication links to the number of PCIe communication links is 2:1, the ratio of the first data to the second data is also 2:1.

[0123] When the link configuration information includes both the communication bandwidth and the number of links, the ratio of the data volume of the first data to the second data is calculated as the product of the ratio of the communication bandwidth of the point-to-point transmission communication link to the communication bandwidth of the PCIe communication link, and the ratio of the number of links of the point-to-point transmission communication link to the number of links of the PCIe communication link. For example, when the communication bandwidth between the NVLink communication link and the PCIe communication link is 2:1 and the number of links is 2:1, the ratio of the data volume of the first data to the second data is 4:1.

[0124] In an embodiment of the present application, by dividing the target data according to the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link, the rationality of the data division can be ensured.

[0125] In an exemplary embodiment, another data transmission method is provided, which is described by taking the method applied to the second GPU in the computing node as an example. Figure 4 As shown, the specific steps include:

[0126] S401 : When detecting that a first GPU is transmitting data to a second GPU, determine a link type of a communication link between the first GPU and the second GPU.

[0127] In an optional implementation, when a data transmission event from the first GPU to the second GPU is detected, the link type of the communication link between the first GPU and the second GPU may be determined based on hardware interconnection information between the GPUs.

[0128] For example, a data transfer event may be determined when data is written to a ring buffer queue associated with a first GPU and a second GPU. The identification information of the first GPU and the identification information of the second GPU are then used as indexes to query the hardware interconnection information to obtain the communication links between the first GPU and the second GPU, thereby determining the link type of the communication link between the first GPU and the second GPU.

[0129] S402, when the link type includes a point-to-point transmission type and a PCIe type, obtain first data transmitted by the first GPU through a communication link of the point-to-point transmission type between the first GPU and the second GPU, and obtain second data transmitted by the first GPU through a PCIe type communication link between the first GPU and the second GPU based on a shared memory provided by the CPU in the computing node.

[0130] In an optional embodiment, when the link type includes a point-to-point transmission type and a PCIe type, the first data transmitted by the first GPU can be obtained simultaneously through the point-to-point transmission type communication link between the first GPU and the second GPU, and the second data transmitted by the first GPU can be obtained from the shared memory through the PCIe type communication link between the first GPU and the second GPU.

[0131] For example, after the first GPU writes the first data into the second ring buffer queue through a point-to-point transmission type communication link between the first GPU and the second GPU, the second GPU can read the first data from the second ring buffer queue through the point-to-point transmission type communication link.

[0132] After the first GPU writes the second data into the first ring buffer queue of the shared memory through the PCIe type communication link, the second GPU may read the second data from the first ring buffer queue through the PCIe type communication link.

[0133] The above-mentioned data transmission method is applied to a second GPU. By detecting that the first GPU is transmitting data to the second GPU, the link type of the communication link between the first and second GPUs is determined. When the link type includes a point-to-point transmission type and a universal peripheral extension (PCIe) type, the method obtains first data transmitted by the first GPU via the point-to-point transmission type communication link between the first and second GPUs. Furthermore, based on the shared memory provided by the CPU in the computing node, the method obtains second data transmitted by the first GPU via the PCIe type communication link between the first and second GPUs. The above-mentioned method introduces a method of transferring data via the PCIe type communication link based on the shared memory provided by the CPU, thereby simultaneously utilizing both the point-to-point transmission type communication link and the PCIe type communication link to obtain data transmitted by the first GPU. This method can effectively improve the efficiency of communication link utilization, thereby improving the efficiency of data transmission.

[0134] Based on the above embodiment, in an embodiment of the present application, the PCIe-type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU and a second PCIe communication link connected to the second GPU. Furthermore, an optional method for obtaining second data using the PCIe communication link is provided, specifically, reading the second data from the shared memory via the second PCIe communication link. The second data is written to the shared memory by the first GPU via the first PCIe communication link.

[0135] In an optional embodiment, after the second data to be transmitted is written into the shared memory using the first PCIe communication link connected to the first GPU, the second data can be read from the shared memory using the second PCIe communication link and the read second data can be transmitted to the second GPU.

[0136] For example, based on address information of a first ring buffer associated with the first GPU and the second GPU, the second data can be written to the first ring buffer in the shared memory via the first PCIe communication link. Subsequently, the second data in the first ring buffer can be read via the second PCIe communication link and transmitted to the second GPU.

[0137] In the embodiment of the present application, the second data written by the first PCIe communication link is obtained from the shared memory through the second PCIe communication link, which can ensure the reliability of data transmission.

[0138] Figure 5FIG. 1 is a flow chart of data transmission between a first GPU and a second GPU in an embodiment. Based on the above embodiment, this embodiment provides an optional example of a data transmission process. Figure 5 The specific implementation process is as follows:

[0139] S501: When a first GPU has a need to transmit target data to a second GPU in a computing node, the first GPU determines a link type of a communication link between the first GPU and the second GPU.

[0140] S502, when the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type, the target data is divided according to the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link to obtain first data and second data.

[0141] S503: The first GPU writes the first data into the second ring buffer queue through a point-to-point transmission type communication link.

[0142] S504 : The first GPU determines, from candidate ring buffer queues in the shared memory according to the identification information of the first GPU and the identification information of the second GPU, a first ring buffer queue corresponding to the first GPU and the second GPU.

[0143] S505 : The first GPU writes second data to the first ring buffer queue in the shared memory through the first PCIe communication link.

[0144] S506 : The second GPU reads the first data from the second ring buffer queue through a point-to-point transmission type communication link.

[0145] S507: The second GPU reads second data from the first ring buffer queue in the shared memory through the second PCIe communication link.

[0146] The specific process of the above S501-S507 can be found in the description of the above method embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0147] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0148] Based on the same inventive concept, embodiments of the present application further provide a data transmission device for implementing the aforementioned data transmission method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more data transmission device embodiments provided below can be found in the above-mentioned limitations of the data transmission method and will not be further elaborated here.

[0149] In an exemplary embodiment, Figure 6 As shown, a data transmission device 1 is provided, which is applied to a first GPU in a computing node, and includes: a first determination module 10, a first transmission module 20 and a second transmission module 30, wherein:

[0150] A first determining module 10 is configured to determine a link type of a communication link between the first GPU and the second GPU when there is a need to transmit target data to the second GPU in the computing node;

[0151] A first transmission module 20 is configured to transmit the first data to the second GPU through a point-to-point transmission type communication link between the first GPU and the second GPU when the link type includes a point-to-point transmission type and a PCIe type; and

[0152] The second transmission module 30 is used to transmit the second data to the second GPU through the PCIe type communication link between the first GPU and the second GPU based on the shared memory provided by the central processing unit CPU in the computing node; wherein the target data includes the first data and the second data.

[0153] In an exemplary embodiment, the PCIe type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU and a second PCIe communication link connected to the second GPU; the second transmission module 30 is specifically configured to:

[0154] The second data is written to the shared memory via the first PCIe communication link, so that the second data is read from the shared memory via the second PCIe communication link and transmitted to the second GPU.

[0155] In an exemplary embodiment, the second transmission module 30 is further configured to:

[0156] Determine, from each candidate ring buffer queue in the shared memory, a first ring buffer queue corresponding to the first GPU and the second GPU according to the identification information of the first GPU and the identification information of the second GPU;

[0157] The second data is written to the first ring buffer queue in the shared memory via the first PCIe communication link, so that the second data is read from the first ring buffer queue via the second PCIe communication link and transmitted to the second GPU.

[0158] In an exemplary embodiment, the first transmission module 20 is specifically configured to:

[0159] The first data is written into the second ring buffer queue so that the point-to-point transmission type communication link between the first GPU and the second GPU can read the first data from the second ring buffer queue and transmit it to the second GPU; wherein the second ring buffer queue is a ring buffer queue associated with the point-to-point transmission type communication link between the first GPU and the second GPU.

[0160] In an exemplary embodiment, the data transmission device 1 further includes a data partitioning module, wherein the data partitioning module is specifically configured to:

[0161] The target data is divided according to the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link to obtain first data and second data; wherein the link configuration information includes communication bandwidth and / or number of links.

[0162] In an exemplary embodiment, Figure 7 As shown, a data transmission device 2 is provided, which is applied to the second GPU in the computing node, including: a second determination module 40, a first acquisition module 50 and a second acquisition module 60, wherein:

[0163] A second determining module 40 is configured to determine a link type of a communication link between the first GPU and the second GPU when detecting that the first GPU is transmitting data to the second GPU;

[0164] A first acquisition module 50 is configured to acquire first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU when the link type includes a point-to-point transmission type and a universal peripheral extension PCIe type; and

[0165] The second acquisition module 60 is configured to acquire, based on a shared memory provided by a CPU in a computing node, second data transmitted by the first GPU through a PCIe type communication link between the first GPU and the second GPU.

[0166] In an exemplary embodiment, the PCIe type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU and a second PCIe communication link connected to the second GPU; the second acquisition module 60 is specifically configured to:

[0167] Read second data from the shared memory via the second PCIe communication link; wherein the second data is written into the shared memory by the first GPU via the first PCIe communication link.

[0168] Each module in the above-mentioned data transmission device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0169] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store target data to be transmitted. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data transmission method is implemented.

[0170] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0171] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0173] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0174] It should be noted that the data involved in this application (including but not limited to the target data to be transmitted, etc.) are all data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0175] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0176] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0177] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A data transmission method, characterized in that: Applied to a first graphics processing unit (GPU) in a computing node, the method includes: In a case where there is a demand to transmit target data to a second GPU in the computing node, determining a link type of a communication link between the first GPU and the second GPU; In a case where the link type includes a point-to-point transmission type and a PCIe type, transmitting the first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU; and Based on the shared memory provided by the central processing unit (CPU) in the computing node, second data is transmitted to the second GPU via a PCIe type communication link between the first GPU and the second GPU; wherein the target data includes the first data and the second data.

2. The method according to claim 1, characterized in that The PCIe type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU and a second PCIe communication link connected to the second GPU; The transmitting the second data to the second GPU through a PCIe type communication link between the first GPU and the second GPU based on a shared memory provided by a central processing unit (CPU) in the computing node includes: Second data is written to the shared memory via the first PCIe communication link, so that the second PCIe communication link reads the second data from the shared memory and transmits the second data to the second GPU.

3. The method according to claim 2, characterized in that Writing the second data to the shared memory through the first PCIe communication link, so that the second PCIe communication link reads the second data from the shared memory and transmits the second data to the second GPU, includes: Determine, from each candidate ring buffer queue in the shared memory, a first ring buffer queue corresponding to the first GPU and the second GPU according to the identification information of the first GPU and the identification information of the second GPU; The second data is written to the first ring buffer queue in the shared memory via the first PCIe communication link, so that the second PCIe communication link reads the second data from the first ring buffer queue and transmits it to the second GPU.

4. The method according to claim 1, wherein The transmitting the first data to the second GPU through a point-to-point transmission type communication link between the first GPU and the second GPU includes: The first data is written into a second ring buffer queue, so that a point-to-point transmission type communication link between the first GPU and the second GPU can read the first data from the second ring buffer queue and transmit it to the second GPU; wherein the second ring buffer queue is a ring buffer queue associated with the point-to-point transmission type communication link between the first GPU and the second GPU.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The target data is divided according to the link configuration information of the PCIe type communication link and the link configuration information of the point-to-point transmission type communication link to obtain the first data and the second data; wherein the link configuration information includes communication bandwidth and / or number of links.

6. A data transmission method, characterized in that: Applied to a second GPU in a computing node, the method includes: When detecting that the first GPU is transmitting data to the second GPU, determining a link type of a communication link between the first GPU and the second GPU; When the link type includes a point-to-point transmission type and a PCIe type, obtaining first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU; and Based on the shared memory provided by the CPU in the computing node, second data transmitted by the first GPU is obtained through a PCIe type communication link between the first GPU and the second GPU.

7. The method according to claim 6, characterized in that The PCIe type communication link between the first GPU and the second GPU includes a first PCIe communication link connected to the first GPU and a second PCIe communication link connected to the second GPU; The acquiring, based on the shared memory provided by the CPU in the computing node, second data transmitted by the first GPU through a PCIe type communication link between the first GPU and the second GPU, includes: The second data is read from the shared memory via the second PCIe communication link; wherein the second data is written into the shared memory by the first GPU via the first PCIe communication link.

8. A data transmission device, characterized in that: Applied to a first GPU in a computing node, the apparatus comprises: A first determining module is configured to determine a link type of a communication link between a first GPU and a second GPU in a case where there is a demand to transmit target data to a second GPU in the computing node; a first transmission module, configured to transmit first data to the second GPU via a point-to-point transmission type communication link between the first GPU and the second GPU when the link type includes a point-to-point transmission type and a PCIe type; and A second transmission module is used to transmit second data to the second GPU through a PCIe type communication link between the first GPU and the second GPU based on the shared memory provided by the central processing unit CPU in the computing node; wherein the target data includes the first data and the second data.

9. A data transmission device, characterized in that: Applied to a second GPU in a computing node, the device comprises: a second determining module, configured to determine a link type of a communication link between the first GPU and the second GPU when detecting that the first GPU is transmitting data to the second GPU; a first acquiring module, configured to acquire, when the link type includes a point-to-point transmission type and a PCIe type, first data transmitted by the first GPU through a point-to-point transmission type communication link between the first GPU and the second GPU; and The second acquisition module is configured to acquire, based on a shared memory provided by the CPU in the computing node, second data transmitted by the first GPU through a PCIe type communication link between the first GPU and the second GPU.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.