Data transmission method and device, computer, storage medium and program product
By establishing multiple queue pairs between graphics processing units for data transmission, the problem of low data transmission efficiency in the dual-port network architecture is solved, and full utilization of hardware ports and improvement of communication performance are achieved.
Patent Information
- Application Number
- CN202510470479.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-09-26
AI Technical Summary
In the prior art, high-performance communication libraries cannot fully utilize the dual ports in a dual-port network architecture, resulting in low data transmission efficiency and low hardware utilization.
By establishing multiple queue pairs between graphics processing units, the multiple queue pairs are used for data transmission, data is processed in parallel, and the hardware ports of the service device are fully utilized.
It improves data transmission efficiency and hardware utilization of service equipment, realizes the comprehensive application of hardware ports and enhances communication performance.
Smart Images

Figure CN120705106A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data transmission method, device, computer, storage medium, and program product. Background Art
[0002] The High-Performance Communication Library is a communication library designed for hybrid expert systems. It achieves large-scale processing tasks by optimizing Graphics Processing Unit (GPU) data processing and supporting low-precision operations. The library's inter-machine communication (i.e., between service devices) is implemented based on the GPU Shared Memory (SHMEM) communication library and utilizes the InfiniBand Reliable Connection (IBRC) provided by the SHMEM communication library. However, since IBRC only supports a single queue pair (QP), the dual ports in a dual-port network architecture cannot be fully utilized, resulting in reduced data transmission efficiency and low hardware utilization and communication performance for the service devices. Summary of the Invention
[0003] The embodiments of the present application provide a data transmission method, apparatus, computer, storage medium, and program product, which can improve the efficiency of data transmission and enhance the hardware utilization and communication performance of service equipment.
[0004] On the one hand, an embodiment of the present application provides a data transmission method, which is performed by a first service device and includes:
[0005] In response to the data sending request, obtaining first service data, a first graphics processing unit that sends the first service data, and a second graphics processing unit that receives the first service data from the data sending request; the first graphics processing unit is a graphics processing unit in the first service device;
[0006] Determining a first queue pair for sending first service data from S queue pairs associated with the first graphics processing unit, where S is a positive integer;
[0007] A first hardware port corresponding to the first queue pair is obtained, and the first service data is sent to a second graphics processing unit in the second service device through the first hardware port and the first queue pair.
[0008] In one aspect, an embodiment of the present application provides a data transmission device, which is applicable to a first service device and includes:
[0009] a data acquisition module, configured to respond to a data transmission request and acquire, from the data transmission request, first service data, a first graphics processing unit that transmits the first service data, and a second graphics processing unit that receives the first service data; the first graphics processing unit is a graphics processing unit in the first service device;
[0010] a queue pair determining module, configured to determine a first queue pair for sending first service data from S queue pairs associated with the first graphics processing unit; S is a positive integer;
[0011] The data sending module is used to obtain the first hardware port corresponding to the first queue pair, and send the first service data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair.
[0012] The device further comprises:
[0013] A channel construction module, configured to construct D first data channels using a first graphics processing unit; D is an integer multiple of S;
[0014] a data association module, configured to associate the D first data channels with the S queue pairs based on the channel numbers corresponding to the D first data channels and S; each first data channel is associated with one queue pair, and each queue pair is associated with one or more first data channels;
[0015] The queue pair determination module can be used to:
[0016] Through the first graphics processing unit, based on the channel operation status of the D first data channels, a first target data channel is selected from the D first data channels, and the queue pair associated with the first target data channel is determined as the first queue pair for sending the first service data.
[0017] The queue pair determination module may be used to:
[0018] Determine the number of first channels based on the data volume of the first service data and S, and construct H second data channels; H is an integer multiple of S, and H is the number of first channels;
[0019] Splitting the first service data into H service sub-data and allocating a second data channel to each service sub-data;
[0020] Based on the channel number of the second data channel corresponding to each service sub-data, a first queue pair for sending the service sub-data is determined.
[0021] When obtaining the first hardware port corresponding to the first queue pair, the data sending module may be used to:
[0022] Obtaining a network topology corresponding to the first service device and a first queue identifier of the first queue pair;
[0023] Performing hash processing on the network topology and the first queue identifier to obtain a target queue port number of the first queue pair;
[0024] Obtain P hardware ports associated with the first graphics processing unit, and based on queue port parameters corresponding to the P hardware ports, determine the hardware port corresponding to the queue port parameter that matches the target queue port number as the first hardware port corresponding to the first queue pair; P is a positive integer.
[0025] The device further comprises:
[0026] The parameter acquisition module is used to obtain the queue port numbers corresponding to the S queue pairs and obtain A candidate classification parameters; A is a positive integer;
[0027] A port clustering module is used to cluster the S queue port numbers based on A candidate classification parameters to obtain P port number clusters corresponding to the A candidate classification parameters;
[0028] a difference detection module for determining a classification difference degree corresponding to each candidate classification parameter based on the number of queue port numbers included in the P port number clusters corresponding to the candidate classification parameter; the classification difference degree is used to represent the difference between the P number of port numbers of the corresponding candidate classification parameters;
[0029] The parameter determination module is used to determine the candidate classification parameter with the smallest classification difference as the target classification parameter, and allocate queue port parameters to P hardware ports based on the target classification parameter.
[0030] The first service device includes M pieces of device hardware, where M is a positive integer;
[0031] When sending the first service data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair, the data sending module may be configured to:
[0032] Creating a work queue element for the first business data, and adding the work queue element to the first queue pair;
[0033] Sending a data transfer instruction to first device hardware associated with the first graphics processing unit, and obtaining a work queue element from the first queue pair through the first device hardware and the data transfer instruction; the M device hardware includes the first device hardware;
[0034] The first service data corresponding to the work queue element is sent to the second graphics processing unit in the second service device through the first device hardware.
[0035] When adding a work queue element to the first queue pair, the data sending module may be configured to:
[0036] Obtaining an enqueue queue position and an outqueue queue position of the first queue pair in the first service device, and determining the amount of to-be-processed data corresponding to the first queue pair in the first service device according to the enqueue queue position and the outqueue queue position;
[0037] If the amount of data to be processed is less than the queue capacity of the first queue pair, then the work queue element is added to the first queue pair;
[0038] If the amount of data to be processed is greater than or equal to the queue capacity of the first queue pair, the work queue element is cached until the amount of data to be processed is less than the queue capacity of the first queue pair, and the work queue element is added to the first queue pair.
[0039] The device further comprises:
[0040] a signaling generation module, configured to generate first signaling data for the first service data when sending of the first service data is completed;
[0041] The signaling sending module is used to determine a second queue pair for sending the first signaling data from the S queue pairs, and send the first signaling data to the second graphics processing unit through the second queue pair and the second hardware port corresponding to the second queue pair, so that the second graphics processing unit obtains the first business data based on the first signaling data and detects the first business data.
[0042] When the first signaling data is sent to the second graphics processing unit through the second queue pair and the second hardware port corresponding to the second queue pair, the signaling sending module may be configured to:
[0043] generating a signaling queue element for the first signaling data, and adding the signaling queue element to the second queue pair;
[0044] When a signaling queue element is obtained from the second queue pair through the second hardware port corresponding to the second queue pair, the queue state of the second queue pair is updated to a locked state, and the first signaling data is sent to the second graphics processing unit; the locked state is used to indicate that the second queue pair cannot be accessed;
[0045] When the first signaling data is sent successfully, the queue state of the second queue pair is updated to a running state; the running state is used to indicate that the second queue pair is allowed to be accessed.
[0046] The device further comprises:
[0047] a data receiving module, configured to receive second service data sent by a third service device through a third queue pair, and write the second service data into the third queue pair;
[0048] an information acquisition module, configured to, upon receiving second signaling data for second service data, acquire a description parameter for the second service data from the second signaling data, and acquire an actual received parameter corresponding to the description parameter from the second service data;
[0049] a data processing module, configured to obtain second service data from the third queue pair if the description parameter is the same as the actually received parameter;
[0050] The data processing module is further configured to send a data repair request to a third service device based on the parameter difference between the description parameter and the actual reception parameter if the description parameter is different from the actual reception parameter.
[0051] The first service device includes M graphics processing units, the M graphics processing units include a first graphics processing unit, and M is a positive integer; the apparatus further includes:
[0052] a unit group generating module, configured to obtain unit number data corresponding to each of the M graphics processing units, and add the M graphics processing units to the M unit groups based on the unit number data;
[0053] a queue pair building module, configured to build, in each unit group, S queue pairs between the graphics processing unit of the first service device in the unit group and other graphics processing units in the unit group;
[0054] The port mapping module is used to map the S queue pairs corresponding to each unit group to the hardware port of the unit group.
[0055] On the one hand, an embodiment of the present application provides a computer device, including a processor, a memory, and an input and output interface;
[0056] The processor is connected to the memory and the input and output interface respectively, wherein the input and output interface is used to receive and output data, the memory is used to store the computer program, and the processor is used to call the computer program so that the computer device including the processor executes the data transmission method in one aspect of the embodiment of the present application.
[0057] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the data transmission method in one aspect of the embodiment of the present application.
[0058] In one aspect, an embodiment of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional embodiments of the present application. In other words, when the computer instructions are executed by the processor, the methods provided in various optional embodiments of the present application are implemented.
[0059] Implementing the embodiments of this application will have the following beneficial effects:
[0060] In an embodiment of the present application, in response to a data transmission request, first service data, a first graphics processing unit (GPU) that transmits the first service data, and a second graphics processing unit (GPU) that receives the first service data are obtained from the data transmission request; the first graphics processing unit is a graphics processing unit in a first service device; a first queue pair for transmitting the first service data is determined from S queue pairs associated with the first graphics processing unit; S is a positive integer; a first hardware port corresponding to the first queue pair is obtained, and the first service data is transmitted to the second graphics processing unit in the second service device via the first hardware port and the first queue pair. Through the above process, data processing of multiple queue pairs is implemented, and each queue pair can correspond to a hardware port. When a service device has multiple hardware ports, access to different hardware ports can be implemented, thereby fully utilizing the hardware ports of the service device, thereby improving hardware utilization and communication performance of the service device. In addition, the use of multiple queue pairs can implement data parallel processing, so that when there are multiple hardware ports, each hardware port can perform data processing, thereby improving data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0062] Figure 1 This is a diagram of a network interaction architecture for data transmission provided by an embodiment of the present application;
[0063] Figure 2 This is an example diagram of a unit group provided in an embodiment of the present application;
[0064] Figure 3 This is a schematic diagram of a data transmission scenario provided by an embodiment of the present application;
[0065] Figure 4 This is a flow chart of a data transmission method provided by an embodiment of the present application;
[0066] Figure 5 This is a schematic diagram of an inter-unit communication structure provided by an embodiment of the present application;
[0067] Figure 6 This is a schematic diagram of a communication library provided in an embodiment of the present application;
[0068] Figure 7 This is a flowchart of a specific method for data transmission provided by an embodiment of the present application;
[0069] Figure 8 This is a schematic diagram of a data transmission device provided in an embodiment of the present application;
[0070] Figure 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0072] Among them, if it is necessary to collect object (such as user, etc.) data in this application, a prompt interface or pop-up window will be displayed before or during the collection. The prompt interface or pop-up window is used to remind the user that certain data (such as business data in this application, etc.) is currently being collected. Only after the user confirms the prompt interface or pop-up window, the relevant steps for data acquisition will be started, otherwise the process will end. Moreover, the acquired user data will be used in reasonable and legal scenarios or purposes. Optionally, in some scenarios where user data needs to be used but the user has not authorized it, authorization can be requested from the user, and the user data can be used when the authorization is passed. In other words, the use of user data in this application complies with the relevant provisions of laws and regulations.
[0073] Among them, some of the terms that may be involved in this application can be explained as follows:
[0074] 1. SHMEM is a parallel programming interface designed for GPU clusters to achieve efficient and scalable communication. It creates a global address space for data spanning multiple GPU memories and supports data sharing and parallel computing between GPUs.
[0075] 2. InfiniBand is a computer network communication standard for high-performance computing. It offers extremely high throughput and low latency, and is used for data interconnection between computers. InfiniBand is also used as a direct or switched interconnection between servers and storage systems, as well as for interconnection between storage systems.
[0076] 3. A communication library is a software library used to implement data transmission and communication between devices or systems.
[0077] In the examples of this application, see Figure 1 , Figure 1 This is a network interaction architecture diagram for data transmission provided by an embodiment of the present application, such as Figure 1 As shown, it can be considered that the present application implements a data transmission system 101, which may include N service devices, where N is a positive integer, such as Figure 1 The service device 101a, the service device 101b and the service device 101c shown in FIG. Each service device may include M graphics processing units (GPUs), where M is a positive integer, such as Figure 1 As shown in , service device 101b includes M GPUs 102b, such as GPU 1021, ..., and GPU 102M. The M GPUs corresponding to each service device can be organized into M unit groups. Each unit group consists of one GPU included in each of N service devices. In the same unit group, S queue pairs can be established between any two GPUs, where S is a positive integer.
[0078] For details, please refer to Figure 2 , Figure 2 This is an example diagram of a unit group provided in the embodiment of the present application. Figure 2 As shown, assuming that N is 3 and M is 3, that is, the data transmission system includes service device 201, service device 202, and service device 203, wherein service device 201 includes graphics processing unit 2011, graphics processing unit 2012, and graphics processing unit 2013, service device 202 includes graphics processing unit 2021, graphics processing unit 2022, and graphics processing unit 2023, and service device 203 includes graphics processing unit 2031, graphics processing unit 2032, and graphics processing unit 2033. In this case, the graphics processing units included in the N service devices can be divided into M unit groups, as shown in FIG. Figure 2Unit groups 2041, 2042, and 2043 are shown in FIG. Unit group 2041 includes GPU 2011, GPU 2021, and GPU 2031; unit group 2042 includes GPU 2012, GPU 2022, and GPU 2032; and unit group 2043 includes GPU 2013, GPU 2023, and GPU 2033. The GPUs included in each unit group can exchange data with each other. Any two GPUs in a unit group can have S queue pairs between them, and these two GPUs can transmit data via these S queue pairs, where S is a positive integer. One GPU corresponds to one piece of device hardware. That is, a service device that includes M GPUs also includes M pieces of device hardware. Device hardware refers to computer hardware, such as a network card, that enables the service device to communicate on a computer network. This system architecture enables multi-QP-based data transmission, enabling parallel data processing and improving data processing efficiency. Furthermore, when a GPU transmits data using multiple QPs, regardless of the number of hardware ports on the GPU's corresponding device hardware, multiple hardware ports can be used simultaneously, thereby improving hardware utilization and communication performance of the service device.
[0079] It is understandable that the service device mentioned in the embodiments of the present application may be a computer device, including but not limited to a terminal device or a server. In other words, the computer device may be a server or a terminal device, or a system consisting of a server and a terminal device. The service device includes a graphics processing unit and is integrated with device hardware. The terminal device mentioned above may be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer, a laptop computer, a PDA, a vehicle-mounted device, an augmented reality / virtual reality (AR / VR) device, a helmet display, a smart TV, a wearable device, a smart speaker, a digital camera, a camera and other mobile internet devices (MID) with network access capabilities, or terminal devices in scenarios such as trains, ships, and flights. Among them, the servers mentioned above can be independent physical servers, or they can be server clusters or distributed systems composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, vehicle-road collaboration, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.
[0080] For details, see Figure 3 , Figure 3 This is a schematic diagram of a data transmission scenario provided by an embodiment of the present application. Figure 3 As shown, the first service device 301 can respond to the data sending request, obtain the first business data, the first graphics processing unit 3011 that sends the first business data, and the second graphics processing unit 3021 that receives the first business data from the data sending request. The first service device 301 can determine the first queue pair for sending the first business data from the S queue pairs associated with the first graphics processing unit 3011 (such as queue pair 1, ... and queue pair S), and the number of the first queue pairs is one or more. Among them, the first graphics processing unit 3011 corresponds to the first device hardware 3012, and the first device hardware 3012 includes P hardware ports, where P is a positive integer, such as Figure 3. The first service device 301 can obtain the first hardware port corresponding to the first queue pair and send the first service data to the second graphics processing unit 3021 in the second service device 302 through the first hardware port and the first queue pair. For example, assuming that the first queue pair is queue pair S, and that queue pair S corresponds to hardware port 301a, the first service device 301 can send the first service data to the second graphics processing unit 3021 in the second service device 302 through queue pair S and hardware port 301a. The first service device 301 and the second service device 302 can be any service device in the data transmission system. Since data transmission is based on multiple QPs in this application, when data transmission is required, as long as there is a QP that can receive new data (such as an idle QP or a QP with insufficient queue space), the data to be transmitted can be transmitted and processed, thereby achieving parallel data transmission and improving data transmission efficiency.
[0081] Optionally, the data involved in the embodiments of the present application can be stored in a computer device, or the data can be stored based on cloud storage technology or a blockchain network, which is not limited here.
[0082] Further, see Figure 4 , Figure 4 This is a flow chart of a data transmission method provided by an embodiment of the present application. Figure 4 As shown, the data transmission process can be implemented by any service device, which can be recorded as a first service device. The data transmission process includes the following steps:
[0083] Step S401 : responding to a data sending request, obtaining first service data, a first graphics processing unit that sends the first service data, and a second graphics processing unit that receives the first service data from the data sending request.
[0084] In an embodiment of the present application, a first service device may respond to a data transmission request and obtain, from the data transmission request, first service data, a first graphics processing unit that transmits the first service data, and a second graphics processing unit that receives the first service data, wherein the first graphics processing unit is a graphics processing unit in the first service device. The first service data may be a complete data set or may be composed of multiple complete data sets. The data transmission request is used to indicate transmission information for data transmission from the first service device to the second service device, such as the type of data to be transmitted, from which graphics processing unit the data is to be transmitted, and to which graphics processing unit the data is to be transmitted.
[0085] Optionally, the first service device can respond to the data sending request and can obtain the first business data, the first graphics processing unit that sends the first business data, and the receiving graphics processing unit that receives the first business data from the data sending request. If the first graphics processing unit and the receiving graphics processing unit belong to the same unit group, the receiving graphics processing unit is determined as the second graphics processing unit for receiving the first business data; if the first graphics processing unit and the receiving graphics processing unit do not belong to the same unit group, the second service device to which the receiving graphics processing unit belongs is obtained, and the graphics processing unit in the second service device that belongs to the unit group where the first graphics processing unit is located is determined as the second graphics processing unit for receiving the first business data. Figure 2 As shown in , it is assumed that the first graphics processing unit obtained is graphics processing unit 2011, and the receiving graphics processing unit is graphics processing unit 2022, wherein graphics processing unit 2011 belongs to unit group 2041, and graphics processing unit 2022 belongs to unit group 2042, that is, graphics processing unit 2011 and graphics processing unit 2022 do not belong to the same unit group, then the first service device can obtain the second service device (here is service device 202) to which graphics processing unit 2022 belongs, and can determine the graphics processing unit (here is graphics processing unit 2021) belonging to unit group 2041 in the second service device as the second graphics processing unit for receiving the first business data.
[0086] Step S402: Determine a first queue pair for sending first service data from the S queue pairs associated with the first graphics processing unit.
[0087] In an embodiment of the present application, a first service device may determine a first queue pair for sending first service data from S queue pairs associated with a first graphics processing unit, where S is a positive integer. The S queue pairs associated with the first graphics processing unit herein refer to the S queue pairs established between the first graphics processing unit and the second graphics processing unit. That is, the first service device may determine the first queue pair for sending the first service data from the S queue pairs associated between the first graphics processing unit and the second graphics processing unit. Specifically, the first service device may obtain a target data channel associated with the first service data and determine the queue pair corresponding to the target data channel as the first queue pair for sending the first service data. A queue pair is a virtual interface between hardware and software for implementing information transmission. Each queue pair includes two queues, which may be referred to as a first queue and a second queue. When one queue in a queue pair serves as a send queue (SQ), the other queue serves as a receive queue (RQ).
[0088] The first service device may determine a target data channel associated with the first service data from existing data channels. Specifically, the first service device may establish D first data channels using the first graphics processing unit; D is an integer multiple of S. Optionally, to enhance the convenience of parallel data transmission within the service device, D may be equal to S. The D first data channels are data channels corresponding to the first graphics processing unit and the second graphics processing unit. By setting D to an integer multiple of S, each queue pair has the same number of data channels, thereby ensuring more balanced data processing across the queue pairs. Based on the channel numbers corresponding to the D first data channels and S, the D first data channels are associated with S queue pairs; each first data channel is associated with a queue pair, and each queue pair is associated with one or more first data channels. For example, the remainder of the channel number corresponding to the i-th first data channel and S may be determined as the queue identifier associated with the i-th first data channel, and the queue pair associated with the queue identifier associated with the i-th first data channel is determined as the queue pair associated with the i-th first data channel, where i is a natural number less than D. For example, if the channel number of the i-th first data channel (Channel i) is i, then the queue identifier of the queue pair associated with the i-th first data channel is i%S. Here, "%" refers to the remainder operation. Of course, in this method, the queue identifiers corresponding to the S queue pairs are 0 to S-1, respectively. When the queue identifiers corresponding to the S queue pairs are 1 to S, respectively, the remainder of the channel number corresponding to the i-th first data channel and S can be added by one to obtain the queue identifier associated with the i-th first data channel, i.e., i%S+1. Simply put, the first service device can cyclically correspond D first data channels with S queue pairs one by one, thereby associating the D first data channels with the S queue pairs. The cyclic one-to-one correspondence means that one data is read from each of the two copies of data of the D first data channels and the S queue pairs to form a set of association relationships. When the reading of a certain copy of data is completed, the next reading is performed from the starting position of the data copy.
[0089] For example, see Figure 5 , Figure 5 This is a schematic diagram of an inter-unit communication structure provided by an embodiment of the present application. Figure 5 As shown, there are S queue pairs between GPU 1 and GPU 2, and GPU 1 includes D data channels. It can be assumed that data channel 1 is associated with queue pair 1, data channel 2 is associated with queue pair 2, ..., and data channel D is associated with queue pair S. For example, assuming S is 2 and D is 4, data channel 1 is associated with queue pair 1, data channel 2 is associated with queue pair 2, data channel 3 is associated with queue pair 1, and data channel 4 is associated with queue pair 2.
[0090] In this case, when the first service device determines a first queue pair for transmitting the first service data from the S queue pairs associated with the first graphics processing unit, the first service device may, through the first graphics processing unit, select a first target data channel from the D first data channels based on the channel operation statuses of the D first data channels, and determine the queue pair associated with the first target data channel as the first queue pair for transmitting the first service data. The channel operation status may include a channel working state and a channel idle state. The channel working state indicates that the corresponding first data channel is processing data, and the channel idle state indicates that the corresponding first data channel is not processing data. Specifically, the first service device may determine the first data channel whose channel operation status is the channel idle state as the first target data channel. Optionally, the first service device may split the first service data into H service sub-data, and based on the channel operation statuses of the D first data channels, select the first target data channels corresponding to the H service sub-data from the D first data channels, respectively, and determine the queue pair associated with the first target data channel corresponding to each service sub-data as the first queue pair for transmitting the service sub-data, thereby obtaining first queue pairs corresponding to the H service sub-data.
[0091] Alternatively, the first service device can create a data channel for the data that needs to be sent. Specifically, the first service device can determine the number of first channels based on the data volume of the first business data and S, and construct H second data channels; H is an integer multiple of S, and H is the number of first channels. Specifically, the first service device can obtain the unit data volume, obtain the data volume multiple between the data volume of the first business data and the unit data volume, adjust the data volume multiple based on S, and obtain the number of first channels. The data volume multiple refers to the quotient between the data volume of the first business data and the unit data volume. The unit data volume refers to the theoretical data volume of a queue for a single processing of data. That is, when the number of data processed by a queue at a single time is the unit data volume, the queue has a higher efficiency in processing data. Among them, when adjusting the data volume multiple based on S, the value that is closest to the data volume multiple and is an integer multiple of S can be determined as the number of first channels. Furthermore, the first service device can split the first business data into H business sub-data and allocate a second data channel to each business sub-data; based on the channel number of the second data channel corresponding to each business sub-data, determine the first queue pair for sending the business sub-data. This process can refer to the above-mentioned process of associating D first data channels with S queue pairs.
[0092] Through this process, data transmission based on multiple QPs can be achieved. Multiple QPs can perform parallel data transmission, thereby improving data transmission efficiency. In addition, data channels are generated based on integer multiples of QPs, so that when transmitting the first service data, data balanced processing and full utilization of QPs can be achieved, and resource utilization of the data transmission system can be improved.
[0093] Step S403: Acquire the first hardware port corresponding to the first queue pair, and send the first service data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair.
[0094] In an embodiment of the present application, the first service device can obtain the first hardware port corresponding to the first queue pair, and in the first hardware port, the first service data is sent to the second graphics processing unit in the second service device through the first queue pair; the second service device can obtain the first service data from the first queue pair through the second graphics processing unit. Optionally, when there are H first queue pairs corresponding to each of the service sub-data, the first service device can obtain the first hardware ports corresponding to each of the H first queue pairs. Through the first hardware port corresponding to the jth service sub-data and the first queue pair corresponding to the jth service sub-data, the jth service sub-data is sent to the second graphics processing unit, where j is a positive integer less than or equal to H. In this way, when the number of the first hardware ports is one or more, all the first hardware ports can be applied to the data transmission process to achieve full operation of the hardware ports, thereby improving the hardware utilization of the service device and improving communication performance.
[0095] The correspondence between the queue pair and the hardware port can be determined by the queue port number (UDP srcport) of the queue pair. Specifically, the first service device can obtain the network topology corresponding to the first service device and the first queue identifier of the first queue pair. The network topology and the first queue identifier are hashed to obtain the target queue port number of the first queue pair. P hardware ports associated with the first graphics processing unit are obtained. Based on the queue port parameters corresponding to the P hardware ports, the hardware port corresponding to the queue port parameter that matches the target queue port number is determined as the first hardware port corresponding to the first queue pair; P is a positive integer. For example, if P is 2, the queue port parameter corresponding to hardware port 1 is an odd number, and the queue port parameter corresponding to hardware port 2 is an even number, the parity of the target queue port number can be obtained. If the target queue port number is odd, hardware port 1 is determined as the first hardware port corresponding to the first queue pair; if the target queue port number is even, hardware port 2 is determined as the first hardware port corresponding to the first queue pair.
[0096] Furthermore, the first service device includes M pieces of device hardware, where M is a positive integer and one graphics processing unit corresponds to one piece of device hardware. The first service device can send first service data to the second graphics processing unit in the second service device via a first hardware port and a first queue pair. Specifically, the first service device can create a work queue element (WQE) for the first service data and add the work queue element to the first queue pair, specifically, adding the work queue element to the first queue corresponding to the first queue pair in the first service device. The WQE is a queue element that can be used for remote direct memory access (RDMA). Furthermore, the first service device can send a data transfer instruction to the first piece of device hardware associated with the first graphics processing unit, and obtain the work queue element from the first queue pair via the first piece of device hardware and the data transfer instruction. The M pieces of device hardware include the first piece of device hardware. The data transfer instruction indicates to the first piece of device hardware that data needs to be sent, and the data transfer instruction can be considered a doorbell notification. The first service device can send the first service data corresponding to the work queue element to the second graphics processing unit in the second service device via the first piece of device hardware.
[0097] Optionally, when adding a work queue element to the first queue pair, the first service device may obtain the enqueue queue position (producer index, PI) and the dequeue queue position (consumer index, CI) of the first queue pair in the first service device, and determine the number of pending data corresponding to the first queue pair in the first service device based on the enqueue queue position and the dequeue queue position. The number of pending data may be recorded as PI-CI, which may be used to indicate the number of WQEs that have not yet been sent in the first queue pair; PI is used to indicate the position of the most recently enqueued WQE in the first queue pair, and CI is used to indicate the position of the dequeued WQE in the first queue pair. Each time a new WQE is added to the first queue pair, PI may be updated, and the first service device may periodically obtain CI through device hardware.
[0098] Furthermore, if the amount of data to be processed is less than the queue capacity of the first queue pair, the work queue element is added to the first queue pair. Optionally, the enqueue queue position of the first queue pair in the first service device may be updated based on the position of the work queue element in the first queue pair. The queue capacity may be used to indicate the total number of WQEs that can be stored in the first queue pair, and may be used to indicate the depth of the first queue pair. If the amount of data to be processed is greater than or equal to the queue capacity of the first queue pair, it indicates that there is no free position in the first queue pair, and the first service device may cache the work queue element until the amount of data to be processed is less than the queue capacity of the first queue pair, at which point the work queue element is added to the first queue pair.
[0099] Optionally, the first service device can use the InfiniBand GPUDirect Async (IBGDA) technology via the first hardware port and the first queue pair to send the first service data to the second graphics processing unit in the second service device. Through the above process, the data transmission process can be implemented through the GPU, eliminating the use of the central processing unit (CPU) in the data transmission process, thereby minimizing latency and improving data transmission efficiency. Specifically, IBGDA is a technology that directly transmits data between the GPU memory and the memory of the remote system, bypassing the CPU to achieve asynchronous communication.
[0100] Further, see Figure 6 , Figure 6 This is a schematic diagram of a communication library provided by an embodiment of the present application. Figure 6 As shown, it can be considered that the present application implements a service-unaware many-to-many collective communication (Alltoall) performance acceleration library, which can also be called a remote memory transport (Remote Memory Transport) high-performance communication library, wherein the many-to-many collective communication performance acceleration library can include a shared communication library and a high-performance communication library, the shared communication library is used to generate prefabricated port numbers for queue pairs, and the high-performance communication library is used for end-to-end (i.e., between graphics processing units) data transmission. Among them, the many-to-many collective communication performance acceleration library can be divided into three parts: 1. Establishing a communication connection; 2. Multi-channel data transmission; 3. Sending signaling data. The above process can be implemented based on IBGDA to improve data transmission efficiency. Specifically, these three parts can be shown as follows:
[0101] Step 1: Establish a communication connection.
[0102] In an embodiment of the present application, the data transmission system can establish unit groups between multiple GPUs respectively, and the unit groups can be considered as SHMEM communication groups. In each unit group, multiple groups of communication connections are established between any two GPUs, that is, multiple queue pairs are established between any two GPUs in each unit group. Specifically, assuming that the data transmission system includes N service devices, each service device includes M graphics processing units, and the number of each graphics processing unit can be considered as a binary group (x, y), where x refers to the service device number and y refers to the unit number data of the GPU in the service device, then all GPUs can be divided into M unit groups, and the unit number data y of the GPUs included in each unit group is the same. In each unit group, communication connections are established between all GPUs and other GPUs, and each communication connection corresponds to multiple QPs. As Figure 2 As shown in FIG, in the unit group 2041, among the graphics processing units 2011, 2021 and 2031, a communication connection is established between any two graphics processing units, and S queue pairs are constructed between any two graphics processing units. For example, there are S queue pairs between the graphics processing units 2011 and 2021. Here, only S queue pairs are established. Figure 2 An example of partial communication connections in the service device is shown in . That is, in any unit group, S queue pairs can be established for any two GPUs in the unit group.
[0103] A QP has two numbers: a queue identifier (QP num) and a queue port number (UDP srcport). UDP stands for User Datagram Protocol. The queue identifier is generated by the device hardware of the first service device, which can record queue information for the S queue pairs of the corresponding graphics processing unit. The queue information for a queue pair can include the queue identifier and other information. This other information may include, but is not limited to, the device number of the service device to which the queue pair belongs and the hardware port number of the device hardware corresponding to the queue pair. The queue port number is generated using a pre-configured port number generated by the Shared Communication Library (SHMEM) and assigned to the queue pair based on the pre-configured port number. Specifically, taking the first service device as an example, the first service device can obtain a network topology and generate a pre-configured port number based on the network topology and the device hash algorithm of the first service device. The pre-configured port numbers may be multiple, and any two pre-configured port numbers are different. The first service device can determine the queue port numbers corresponding to each of the S queue pairs from the pre-configured port numbers. Alternatively, the first service device may hash the network topology and the queue identifier of the rth queue pair to obtain the queue port number of the rth queue pair, where r is a positive integer less than or equal to S. Based on this process, the queue port numbers of all queue pairs included in the first service device may be obtained. The QP selection of hardware ports and switch ports, etc., is performed via a five-tuple hash (including the queue port number of the QP). The above method for determining the queue port number of the QP utilizes the linear offset characteristic of hashing, so that the QP is hash-balanced across the hardware port at the transmitting end (e.g., a dual-port network card), the hardware port at the receiving end (e.g., a dual-port network card), and the network switch. This improves the load balancing of the service device's device hardware, reduces the probability of hash conflicts on the network switch, and thereby improves the network security and communication performance of data transmission.
[0104] Step 2: Multi-channel data transmission.
[0105] In an embodiment of the present application, this step may include the following process: associating the data channel with the queue pair -> issuing a work queue element -> issuing a data sending reminder. Simply put, the first service device can write the first business data into the target data channel, map the target data channel to the S queue pairs established between the first graphics processing unit and the second graphics processing unit, and determine the first queue pair corresponding to the target data channel; then generate a work queue element for the first business data, and add the work queue element to the first queue pair; send a data transmission instruction to the device hardware corresponding to the first graphics processing unit (i.e., issuing a data sending reminder), wherein the device hardware here can be a remote direct memory access (RDMA) network card. The first service device can send the first business data to the second graphics processing unit in the second service device through the device hardware.
[0106] Among them, when the first service device distributes (Dispatch) and merges (Combine) data, each GPU will communicate with multiple GPUs in the unit group established in step 1. Assume that the current GPU is numbered GPU1 in the unit group, and the other GPUs in the unit group are numbered GPU2, GPU3, GPU4, ..., GPUN. Taking the communication between GPU1 and GPU2 as an example, GPU1 will establish multiple channels, each channel is responsible for different data, and multiple channels send data in parallel. Each channel will be mapped to the QP created in step 1: Assuming that GPU1 and each other GPU in the group have established S QPs in step 1, then the queue port number of the QP mapped in Channel i is i%S (the number of channels is an integer multiple of the number of QPs, for example, the number of channels and the number of QPs can be equal). Within each Channel, when the data to be sent to a target GPU is ready, a corresponding RDMA Work Queue Element (WQE) is created, the WQE is filled into the corresponding QP, and then Doorbell is used to notify the RDMA device hardware that there is data to be sent. Figure 4 Through this process, data channels can be evenly distributed on queue pairs, and queue pairs can also be evenly distributed on hardware ports of device hardware, thereby achieving load balancing of service devices and improving application balance among queue pairs and hardware ports, thereby improving hardware utilization of service devices and improving communication performance.
[0107] Step 3: Send signaling data.
[0108] In an embodiment of the present application, after the data sending operation in step 2 is completed, signaling data needs to be sent. Similar to step 2, the Channel and QP must first be mapped to determine which QP to use to send the signaling data. Furthermore, the first service device can directly perform WQE assembly of the signaling data in the GPU, and then use the atomic sending mode of IBGDA to send the signaling data to the destination GPU, that is, the above-mentioned second graphics processing unit. In the data transmission process, it must be ensured that the same QP is used in the same Channel, data is sent first, and then signaling data is sent, so as to realize the sending of service data and related description information of service data (i.e., signaling data), thereby ensuring the integrity and security of data transmission.
[0109] For details, please refer to Figure 7 , Figure 7 This is a flow chart of a specific method for data transmission provided by an embodiment of the present application. Figure 7 As shown, the data transmission process includes the following steps:
[0110] Step S701: Establish a communication connection.
[0111] In an embodiment of the present application, a first service device includes M graphics processing units, including the first graphics processing unit, where M is a positive integer. One graphics processing unit corresponds to one piece of device hardware, and one piece of device hardware includes P hardware ports, where P is a positive integer. A data transmission system includes N service devices, including the first service device, where N is a positive integer, and each service device includes M graphics processing units.
[0112] Specifically, the first service device can obtain the unit number data corresponding to the M graphics processing units, and add the M graphics processing units to the M unit groups based on the unit number data. The unit number data is used to represent the number of the corresponding graphics processing unit in the corresponding service device. Each service device can add the M graphics processing units to the M unit groups based on the unit number data corresponding to the M graphics processing units included in it. It can be considered that the unit number data of the graphics processing units in a unit group are the same, which can be seen in Figure 2. Further, in each unit group, S queue pairs are constructed between the graphics processing unit in the unit group and other graphics processing units in the unit group. That is, S queue pairs are constructed between any two graphics processing units in the same unit group. At this time, there are S queue pairs between the two graphics processing units in any unit group. The S queue pairs corresponding to each unit group are mapped to the hardware port of the unit group. That is to say, the queue pair associated with the graphics processing unit is mapped to the hardware port of the device hardware corresponding to the graphics processing unit. For details, please refer to Figure 4 The queue pairs associated with a graphics processing unit include S queue pairs between the graphics processing unit and any other graphics processing unit in the unit group to which the graphics processing unit belongs. For example, a possible composition of a service device can be seen in Table 1:
[0113] Table 1
[0114]
[0115] As shown in Table 1, service device 1 includes M GPUs, each GPU belongs to a unit group, one GPU corresponds to one device hardware, and one device hardware includes P hardware ports. For example, "hardware port 1.k" represents the kth hardware port in the device hardware corresponding to GPU1, and "hardware port Mk" represents the kth hardware port in the device hardware corresponding to GPUM, etc., where k is a positive integer less than or equal to P.
[0116] The composition of a possible GPU queue pair can be seen in Table 2:
[0117] Table 2
[0118]
[0119] As shown in Table 2, assuming that a unit group includes GPUs 1 through 2, S queue pairs are established between GPUs 1 and 2, ..., and S queue pairs are established between GPUs 1 and 2. For example, "queue pair 12" represents a queue pair between GPUs 1 and 2, "queue pair 1N" represents a queue pair between GPUs 1 and 2, and so on.
[0120] When mapping a queue pair to a hardware port, queue port parameters corresponding to each of the P hardware ports can be obtained, and the hardware port that matches the queue port number can be determined as the queue pair corresponding to the queue port number. Optionally, the queue port parameters corresponding to each of the P hardware ports can be provided manually. Alternatively, the first service device can obtain queue port numbers corresponding to each of the S queue pairs and obtain A candidate classification parameters; A is a positive integer, wherein the candidate classification parameter refers to the data characteristics used when mapping the queue pair to the hardware port, such as parity and the remainder with P. The first service device can cluster the S queue port numbers based on the A candidate classification parameters to obtain P port number clusters corresponding to the A candidate classification parameters. Based on the number of queue port numbers included in the P port number clusters corresponding to each candidate classification parameter, the classification difference degree corresponding to the candidate classification parameter is determined; the classification difference degree is used to represent the difference between the number of P port numbers of the corresponding candidate classification parameters. For example, the first service device may determine the average of the difference between the numbers of any two port numbers in the P number of candidate classification parameters as the classification difference degree of the candidate classification parameter. Furthermore, the first service device may determine the candidate classification parameter with the smallest classification difference degree as the target classification parameter, and assign queue port parameters to the P hardware ports based on the target classification parameter. The smallest classification difference degree means that when the queue pairs are mapped to the hardware ports using the candidate classification parameter corresponding to the classification difference degree, the queue pairs are evenly hashed on the hardware ports, thereby improving the load balancing of the hardware ports.
[0121] Step S702: respond to a data sending request, and obtain first service data, a first graphics processing unit that sends the first service data, and a second graphics processing unit that receives the first service data from the data sending request.
[0122] In the embodiments of this application, please refer to Figure 4 The relevant description in step S401.
[0123] Step S703: split the first business data into H business sub-data, and determine target data channels corresponding to the H business sub-data.
[0124] In the embodiments of this application, please refer to Figure 4 In the relevant description of step S402, the target data channels corresponding to the H business sub-data can be Figure 4 The first target data channel or the second data channel shown in step S402.
[0125] Step S704 : determining first queue pairs corresponding to H target data channels from the S queue pairs associated with the first graphics processing unit.
[0126] In the embodiment of this application, this process can be seen in Figure 4 In the service device, one data channel corresponds to one queue pair, and one queue pair may correspond to one or more data channels. The first service device may determine the first queue pairs corresponding to the H target data channels, respectively, from the S queue pairs between the first graphics processing unit and the second graphics processing unit.
[0127] Step S705 : Generate work queue elements corresponding to the H business sub-data respectively, and add the work queue elements corresponding to the H business sub-data respectively to the first queue pairs corresponding to the H business sub-data respectively.
[0128] In an embodiment of the present application, the first service device can generate a work queue element corresponding to the j-th business sub-data, and add the work queue element corresponding to the j-th business sub-data to the first queue pair corresponding to the j-th business sub-data. Similarly, the work queue elements corresponding to H business sub-data can be added to the first queue pairs corresponding to H business sub-data. Optionally, the processing of the H business sub-data can be asynchronously processed simultaneously, which can improve the efficiency of data processing. For details, please refer to Figure 4 The relevant description in step S403.
[0129] Step S706: Obtain a work queue element from each first queue pair through the first hardware port corresponding to the first queue pair, and send the service sub-data corresponding to the work queue element to the second graphics processing unit in the second service device.
[0130] In the embodiment of this application, this process can be seen in Figure 4 Related description of step S403.
[0131] Step S707: When the sending of the first service data is completed, first signaling data is generated for the first service data, and the first signaling data is sent to the second graphics processing unit.
[0132] In an embodiment of the present application, when the first service data is sent, the first service device can generate first signaling data for the first service data; determine a second queue pair for sending the first signaling data from the S queue pairs, and send the first signaling data to the second graphics processing unit through the second queue pair and the second hardware port corresponding to the second queue pair, so that the second graphics processing unit obtains the first service data based on the first signaling data and detects the first service data. The sending process of the first signaling data can refer to the sending process of the first service data. The first signaling data is descriptive information of the first service data, including but not limited to the data quantity and data composition, etc. The data quantity is used to indicate the quantity of data sent to the second service device, that is, how many complete data are sent to the second service device; the composition of the data is used to indicate the composition content and slicing method of the data sent to the second service device.
[0133] Optionally, when the first signaling data is sent to the second graphics processing unit via the second queue pair and the second hardware port corresponding to the second queue pair, the first service device may generate a signaling queue element for the first signaling data and add the signaling queue element to the second queue pair. When the signaling queue element is obtained from the second queue pair via the second hardware port corresponding to the second queue pair, the queue state of the second queue pair is updated to a locked state, and the first signaling data is sent to the second graphics processing unit; the locked state indicates that the second queue pair is inaccessible. When the first signaling data is successfully sent, the queue state of the second queue pair is updated to a running state; the running state indicates that access to the second queue pair is permitted.
[0134] Optionally, the first service device receives the second business data sent by the third service device through the third queue pair, and writes the second business data into the third queue pair; when receiving the second signaling data for the second business data, obtains the description parameters for the second business data from the second signaling data, and obtains the actual receiving parameters corresponding to the description parameters from the second business data; if the description parameters are the same as the actual receiving parameters, obtains the second business data from the third queue pair; if the description parameters are different from the actual receiving parameters, sends a data repair request to the third service device based on the parameter difference between the description parameters and the actual receiving parameters. For example, the description parameters for the second service data include "data quantity: 5; data composition: H' sub-data", and the actual received parameters include "data quantity: 4; data composition: H' sub-data". It can be seen that the third service device sent 5 complete data to the first service device, but the first service device only received 4 complete data. It can be considered that the data received by the first service device is abnormal. Based on the parameter difference between the description parameters and the actual received parameters, a data repair request can be sent to the third service device to repair the received second service data and improve the security and accuracy of data transmission. Similarly, it can be used in any process of detecting the service data corresponding to the signaling data based on signaling data, such as the process of the second service device detecting the first service data based on the first signaling data.
[0135] In an embodiment of the present application, in response to a data transmission request, first service data, a first graphics processing unit (GPU) that transmits the first service data, and a second graphics processing unit (GPU) that receives the first service data are obtained from the data transmission request; the first graphics processing unit is a graphics processing unit in a first service device; a first queue pair for transmitting the first service data is determined from S queue pairs associated with the first graphics processing unit; S is a positive integer; a first hardware port corresponding to the first queue pair is obtained, and the first service data is transmitted to the second graphics processing unit in the second service device via the first hardware port and the first queue pair. Through the above process, data processing of multiple queue pairs is implemented, and each queue pair can correspond to a hardware port. When a service device has multiple hardware ports, access to different hardware ports can be implemented, thereby fully utilizing the hardware ports of the service device, thereby improving hardware utilization and communication performance of the service device. In addition, the use of multiple queue pairs can implement data parallel processing, so that when there are multiple hardware ports, each hardware port can perform data processing, thereby improving data transmission efficiency.
[0136] Optionally, when this application is used for the training and reasoning tasks of the Mixture of Experts (MOE) model, the technical solution of this application can be used to realize the Alltoall communication of the MOE model. At this time, the first business data refers to the model parameters or adjustment gradients of the MOE model, that is, during the training or reasoning process of the MOE model, data that needs to be shared between various service devices, thereby improving the Dispatch and Combine bandwidth (the amount of data transmitted per unit time) in the MOE model and reducing the time consumption of large model training / reasoning. This application can give full play to the bandwidth of multiple hardware ports and improve the hardware utilization of service equipment.
[0137] Furthermore, the present application was tested in different server environments, such as Server Environment 1 and Server Environment 2, where Server Environment 1 and Server Environment 2 refer to the device models of the service equipment, Server Environment 1 is an artificial intelligence accelerator, and Server Environment 2 is a high-performance computer server. The test results shown in Table 3 were obtained:
[0138] Table 3
[0139]
[0140]
[0141] As shown in Table 3, the number of nodes refers to the number of service devices used during the test, the communication library version is used to indicate the version of the communication library being tested, the existing communication library mirror is used to indicate the prior art, and the communication library mirror of this application is used to indicate the technical solution of this application (i.e., the many-to-many collective communication performance acceleration library). By testing the distribution (Dispatch) and merging (Combine) of 2 machines, as well as the distribution and merging of 4 machines in server environment 1 and server environment 2, 2 machines refer to 2 service devices, and 4 machines refer to 4 service devices. As can be seen from Table 3, in server environment 1, the RDMA performance of 2-machine merging and distribution is improved by 35.2% and 37.69% respectively, and the LINK (high-speed interconnection) performance is improved by 35.2% and 37.69% respectively; the RDMA performance of 4-machine Dispatch and Combine is improved by 105.96% and 119.32% respectively, and the LINK performance is improved by 105.96% and 119.32% respectively. In server environment 2, the RDMA performance of 2-machine merge and dispatch improved, the RDMA performance of 4-machine dispatch and combine increased by 120.43% and 111.52% respectively, and the LINK performance increased by 120.43% and 111.52% respectively. It can be seen that the communication library implemented in this application has a significant performance improvement compared to existing communication libraries.
[0142] Among them, it can be seen from Table 3 that when the number of deployed service devices is 4, the technical solution of the present application can achieve a performance improvement of about 100% compared with the existing technical solution. Therefore, in the training and inference deployment of the Mixture of Experts (MoE) model, the optimal number of deployed service devices is 4.
[0143] Further, see Figure 8 , Figure 8 Schematic diagram of a data transmission device provided in an embodiment of the present application. The data transmission device may be a computer program (including program code, etc.) running on a computer device, for example, the data transmission device may be an application software; the device may be used to execute the corresponding steps of the method provided in an embodiment of the present application. Figure 8 As shown, the data transmission device 800 can be used to Figure 3 The computer device in the corresponding embodiment may specifically include: a data acquisition module 11 , a queue pair determination module 12 and a data sending module 13 .
[0144] A data acquisition module 11 is configured to respond to a data transmission request and acquire, from the data transmission request, first service data, a first graphics processing unit that transmits the first service data, and a second graphics processing unit that receives the first service data; the first graphics processing unit is a graphics processing unit in the first service device;
[0145] The queue pair determining module 12 is configured to determine a first queue pair for sending the first service data from the S queue pairs associated with the first graphics processing unit; S is a positive integer;
[0146] The data sending module 13 is configured to obtain the first hardware port corresponding to the first queue pair, and send the first service data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair.
[0147] The device 800 further includes:
[0148] The channel construction module 14 is configured to construct D first data channels using the first graphics processing unit; D is an integer multiple of S;
[0149] A data association module 15 is configured to associate the D first data channels with S queue pairs based on the channel numbers corresponding to the D first data channels and S; each first data channel is associated with one queue pair, and each queue pair is associated with one or more first data channels;
[0150] The queue pair determination module 12 may be used to:
[0151] Through the first graphics processing unit, based on the channel operation status of the D first data channels, a first target data channel is selected from the D first data channels, and the queue pair associated with the first target data channel is determined as the first queue pair for sending the first service data.
[0152] The queue pair determination module 12 may be configured to:
[0153] Determine the number of first channels based on the data volume of the first service data and S, and construct H second data channels; H is an integer multiple of S, and H is the number of first channels;
[0154] Splitting the first service data into H service sub-data and allocating a second data channel to each service sub-data;
[0155] Based on the channel number of the second data channel corresponding to each service sub-data, a first queue pair for sending the service sub-data is determined.
[0156] When obtaining the first hardware port corresponding to the first queue pair, the data sending module 13 may be used to:
[0157] Obtaining a network topology corresponding to the first service device and a first queue identifier of the first queue pair;
[0158] Performing hash processing on the network topology and the first queue identifier to obtain a target queue port number of the first queue pair;
[0159] Obtain P hardware ports associated with the first graphics processing unit, and based on queue port parameters corresponding to the P hardware ports, determine the hardware port corresponding to the queue port parameter that matches the target queue port number as the first hardware port corresponding to the first queue pair; P is a positive integer.
[0160] The device 800 further includes:
[0161] The parameter acquisition module 16 is used to obtain the queue port numbers corresponding to the S queue pairs and obtain A candidate classification parameters; A is a positive integer;
[0162] A port clustering module 17 is configured to perform clustering processing on the S queue port numbers based on the A candidate classification parameters, and obtain P port number clusters corresponding to the A candidate classification parameters;
[0163] The difference detection module 18 is configured to determine a classification difference degree corresponding to each candidate classification parameter based on the number of queue port numbers included in the P port number clusters corresponding to the candidate classification parameter; the classification difference degree is used to represent the difference between the P number of port numbers of the corresponding candidate classification parameters;
[0164] The parameter determination module 19 is configured to determine the candidate classification parameter with the smallest classification difference as the target classification parameter, and allocate queue port parameters to the P hardware ports based on the target classification parameter.
[0165] The first service device includes M pieces of device hardware, where M is a positive integer;
[0166] When sending the first service data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair, the data sending module 13 may be configured to:
[0167] Creating a work queue element for the first business data, and adding the work queue element to the first queue pair;
[0168] Sending a data transfer instruction to first device hardware associated with the first graphics processing unit, and obtaining a work queue element from the first queue pair through the first device hardware and the data transfer instruction; the M device hardware includes the first device hardware;
[0169] The first service data corresponding to the work queue element is sent to the second graphics processing unit in the second service device through the first device hardware.
[0170] When adding a work queue element to the first queue pair, the data sending module 13 may be configured to:
[0171] Obtaining an enqueue queue position and an outqueue queue position of the first queue pair in the first service device, and determining the amount of to-be-processed data corresponding to the first queue pair in the first service device according to the enqueue queue position and the outqueue queue position;
[0172] If the amount of data to be processed is less than the queue capacity of the first queue pair, then the work queue element is added to the first queue pair;
[0173] If the amount of data to be processed is greater than or equal to the queue capacity of the first queue pair, the work queue element is cached until the amount of data to be processed is less than the queue capacity of the first queue pair, and the work queue element is added to the first queue pair.
[0174] The device 800 further includes:
[0175] The signaling generation module 20 is configured to generate first signaling data for the first service data when the sending of the first service data is completed;
[0176] The signaling sending module 21 is used to determine a second queue pair for sending the first signaling data from the S queue pairs, and send the first signaling data to the second graphics processing unit through the second queue pair and the second hardware port corresponding to the second queue pair, so that the second graphics processing unit obtains the first business data based on the first signaling data and detects the first business data.
[0177] When the first signaling data is sent to the second graphics processing unit through the second queue pair and the second hardware port corresponding to the second queue pair, the signaling sending module 21 can be used to:
[0178] generating a signaling queue element for the first signaling data, and adding the signaling queue element to the second queue pair;
[0179] When a signaling queue element is obtained from the second queue pair through the second hardware port corresponding to the second queue pair, the queue state of the second queue pair is updated to a locked state, and the first signaling data is sent to the second graphics processing unit; the locked state is used to indicate that the second queue pair cannot be accessed;
[0180] When the first signaling data is sent successfully, the queue state of the second queue pair is updated to a running state; the running state is used to indicate that the second queue pair is allowed to be accessed.
[0181] The device 800 further includes:
[0182] a data receiving module 22, configured to receive second service data sent by a third service device through a third queue pair, and write the second service data into the third queue pair;
[0183] The information acquisition module 23 is configured to, upon receiving second signaling data for the second service data, acquire a description parameter for the second service data from the second signaling data, and acquire an actual received parameter corresponding to the description parameter from the second service data;
[0184] a data processing module 24, configured to obtain second service data from the third queue pair if the description parameter is the same as the actually received parameter;
[0185] The data processing module 24 is further configured to send a data repair request to the third service device based on the parameter difference between the description parameter and the actual reception parameter if the description parameter is different from the actual reception parameter.
[0186] The first service device includes M graphics processing units, the M graphics processing units include a first graphics processing unit, and M is a positive integer; the apparatus 800 further includes:
[0187] a unit group generating module 25 for obtaining unit number data corresponding to each of the M graphics processing units, and adding the M graphics processing units to the M unit groups based on the unit number data;
[0188] a queue pair building module 26 for building, in each unit group, S queue pairs between the graphics processing unit of the first service device in the unit group and other graphics processing units in the unit group;
[0189] The port mapping module 27 is used to map the S queue pairs corresponding to each unit group to the hardware port of the unit group.
[0190] An embodiment of the present application provides a data transmission device, which can respond to a data transmission request, obtain first service data, a first graphics processing unit (GPU) for transmitting the first service data, and a second graphics processing unit (GPU) for receiving the first service data from the data transmission request; the first GPU is a GPU in a first service device; determine a first queue pair for transmitting the first service data from S queue pairs associated with the first GPU; S is a positive integer; obtain a first hardware port corresponding to the first queue pair, and transmit the first service data to the second GPU in a second service device via the first hardware port and the first queue pair. Through the above process, data processing of multiple queue pairs is implemented, and each queue pair can correspond to a hardware port. When a service device has multiple hardware ports, access to different hardware ports can be implemented, thereby fully utilizing the hardware ports of the service device, thereby improving hardware utilization and communication performance of the service device. In addition, the use of multiple queue pairs can implement data parallel processing, so that when there are multiple hardware ports, each hardware port can perform data processing, thereby improving data transmission efficiency.
[0191] See also Figure 9 , Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 9 As shown, the computer device in the embodiment of the present application may include: one or more processors 901, memory 902, and input / output interface 903. The processor 901, memory 902, and input / output interface 903 are connected via a bus 904. The memory 902 is used to store computer programs, which include program instructions. The input / output interface 903 is used to receive and output data, such as for data exchange between a host computer and the computer device, or for data exchange between virtual machines in the host computer. The processor 901 is used to execute the program instructions stored in the memory 902.
[0192] The processor 901 may perform the following operations:
[0193] In response to the data sending request, obtaining first service data, a first graphics processing unit that sends the first service data, and a second graphics processing unit that receives the first service data from the data sending request; the first graphics processing unit is a graphics processing unit in the first service device;
[0194] Determining a first queue pair for sending first service data from S queue pairs associated with the first graphics processing unit, where S is a positive integer;
[0195] A first hardware port corresponding to the first queue pair is obtained, and the first service data is sent to a second graphics processing unit in the second service device through the first hardware port and the first queue pair.
[0196] In some feasible implementations, the processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.
[0197] The memory 902 may include a read-only memory and a random access memory, and provides instructions and data to the processor 901 and the input / output interface 903. A portion of the memory 902 may also include a non-volatile random access memory. For example, the memory 902 may also store device type information.
[0198] In a specific implementation, the computer device can execute the following operations through its built-in functional modules: Figure 3 or Figure 6 For details on the implementation methods provided in each step, please refer to the Figure 3 or Figure 6 The implementation methods provided in each step are not repeated here.
[0199] The embodiment of the present application provides a computer device, including: a processor, an input and output interface, and a memory, wherein the processor obtains a computer program in the memory and executes the computer program. Figure 4The steps of the method shown in the embodiment of the present application are used to perform data transmission operations. The embodiment of the present application realizes responding to a data transmission request, obtaining first business data from the data transmission request, a first graphics processing unit that sends the first business data, and a second graphics processing unit that receives the first business data; the first graphics processing unit is a graphics processing unit in a first service device; determining a first queue pair for sending the first business data from S queue pairs associated with the first graphics processing unit; S is a positive integer; obtaining a first hardware port corresponding to the first queue pair, and sending the first business data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair. Through the above process, data processing of multiple queue pairs is realized, and each queue pair can correspond to a hardware port. When there are multiple hardware ports on a service device, access to different hardware ports can also be realized, thereby fully utilizing the hardware ports of the service device, thereby improving the hardware utilization and communication performance of the service device. In addition, the use of multiple queue pairs can realize data parallel processing, so that when there are multiple hardware ports, each hardware port can perform data processing, thereby improving data transmission efficiency.
[0200] The present invention also provides a computer-readable storage medium storing a computer program suitable for being loaded and executed by the processor. Figure 4 The data transmission methods provided in each step are detailed in the Figure 4 The implementation methods provided in each step will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the computer program can be deployed to be executed on one computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected by a communication network.
[0201] The computer-readable storage medium may be the data transmission device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0202] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs Figure 4 The method provided in the various optional modes realizes data processing of multiple queue pairs, and each queue pair can correspond to a hardware port, so that when there are multiple hardware ports on the service device, access to different hardware ports can be achieved, so that the hardware ports existing in the service device can be fully utilized, thereby improving the hardware utilization and communication performance of the service device. Moreover, the use of multiple queue pairs can realize data parallel processing, so that when there are multiple hardware ports, each hardware port can perform data processing, thereby improving data transmission efficiency.
[0203] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0204] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0205] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in this description according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0206] The methods and related devices provided in the embodiments of the present application are described with reference to the method flow charts and / or structural diagrams provided in the embodiments of the present application. Specifically, each process and / or block in the method flow charts and / or structural diagrams, as well as the combination of processes and / or blocks in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data transmission device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data transmission device generate instructions for implementing the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data transmission device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data transmission device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 The flow or flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.
[0207] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0208] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0209] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data transmission method, characterized in that: The method is performed by a first service device, and includes: In response to a data sending request, obtaining first service data, a first graphics processing unit that sends the first service data, and a second graphics processing unit that receives the first service data from the data sending request; the first graphics processing unit is a graphics processing unit in the first service device; Determine, from S queue pairs associated with the first graphics processing unit, a first queue pair for sending the first service data; S is a positive integer; A first hardware port corresponding to the first queue pair is obtained, and the first service data is sent to the second graphics processing unit in the second service device through the first hardware port and the first queue pair.
2. The method according to claim 1, characterized in that The method further comprises: Constructing D first data channels by using the first graphics processing unit; D is an integer multiple of S; Based on the channel numbers corresponding to the D first data channels and S, the D first data channels are associated with the S queue pairs; each first data channel is associated with one queue pair, and each queue pair is associated with one or more first data channels; The determining, from the S queue pairs associated with the first graphics processing unit, a first queue pair for sending the first service data includes: Through the first graphics processing unit, based on the channel operation status of the D first data channels, a first target data channel is selected from the D first data channels, and the queue pair associated with the first target data channel is determined as the first queue pair for sending the first business data.
3. The method according to claim 1, characterized in that The determining, from the S queue pairs associated with the first graphics processing unit, a first queue pair for sending the first service data includes: Determine the number of first channels according to the data volume of the first service data and S, and construct H second data channels; H is an integer multiple of S, and H is the number of the first channels; Splitting the first service data into H service sub-data and allocating a second data channel to each service sub-data; Based on the channel number of the second data channel corresponding to each service sub-data, a first queue pair for sending the service sub-data is determined.
4. The method according to claim 1, wherein The obtaining the first hardware port corresponding to the first queue pair includes: Obtaining a network topology corresponding to the first service device and a first queue identifier of the first queue pair; Performing hash processing on the network topology and the first queue identifier to obtain a target queue port number of the first queue pair; Obtain P hardware ports associated with the first graphics processing unit, and based on queue port parameters corresponding to the P hardware ports, determine the hardware port corresponding to the queue port parameter that matches the target queue port number as the first hardware port corresponding to the first queue pair; P is a positive integer.
5. The method according to claim 4, characterized in that The method further comprises: Obtain the queue port numbers corresponding to the S queue pairs, and obtain A candidate classification parameters; A is a positive integer; Clustering the S queue port numbers based on the A candidate classification parameters to obtain P port number clusters corresponding to the A candidate classification parameters; Determining a classification difference degree corresponding to each candidate classification parameter based on the number of queue port numbers respectively included in the P port number clusters corresponding to the candidate classification parameter; the classification difference degree is used to represent the difference between the number of P port numbers of the corresponding candidate classification parameters; The candidate classification parameter with the smallest classification difference is determined as the target classification parameter, and queue port parameters are respectively allocated to the P hardware ports based on the target classification parameter.
6. The method according to claim 1, characterized in that The first service device includes M device hardware, where M is a positive integer; The step of sending the first service data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair includes: Creating a work queue element for the first service data, and adding the work queue element to the first queue pair; Sending a data transfer instruction to first device hardware associated with the first graphics processing unit, and obtaining the work queue element from the first queue pair through the first device hardware and the data transfer instruction, wherein the M device hardware includes the first device hardware; The first service data corresponding to the work queue element is sent to the second graphics processing unit in the second service device through the first device hardware.
7. The method according to claim 6, characterized in that Adding the work queue element to the first queue pair includes: Obtaining an enqueue queue position and an outqueue queue position of the first queue pair in the first service device, and determining the amount of to-be-processed data corresponding to the first queue pair in the first service device according to the enqueue queue position and the outqueue queue position; If the amount of data to be processed is less than the queue capacity of the first queue pair, adding the work queue element to the first queue pair; If the amount of data to be processed is greater than or equal to the queue capacity of the first queue pair, the work queue element is cached until the amount of data to be processed is less than the queue capacity of the first queue pair, and then the work queue element is added to the first queue pair.
8. The method according to claim 1, characterized in that The method further comprises: When the sending of the first service data is completed, generating first signaling data for the first service data; From the S queue pairs, determine a second queue pair for sending the first signaling data, and send the first signaling data to the second graphics processing unit through the second queue pair and the second hardware port corresponding to the second queue pair, so that the second graphics processing unit obtains the first business data based on the first signaling data and detects the first business data.
9. The method according to claim 8, characterized in that The sending the first signaling data to the second graphics processing unit through the second queue pair and the second hardware port corresponding to the second queue pair includes: generating a signaling queue element for the first signaling data, and adding the signaling queue element to the second queue pair; When the signaling queue element is obtained from the second queue pair through the second hardware port corresponding to the second queue pair, updating the queue state of the second queue pair to a locked state, and sending the first signaling data to the second graphics processing unit; the locked state is used to indicate that the second queue pair is inaccessible; When the first signaling data is sent successfully, the queue state of the second queue pair is updated to a running state; the running state is used to indicate that the second queue pair is allowed to be accessed.
10. The method according to claim 1, characterized in that The method further comprises: receiving second service data sent by a third service device through a third queue pair, and writing the second service data into the third queue pair; When second signaling data for the second service data is received, obtaining a description parameter for the second service data from the second signaling data, and obtaining an actual reception parameter corresponding to the description parameter from the second service data; If the description parameter is the same as the actually received parameter, obtaining the second service data from the third queue pair; If the description parameter is different from the actually received parameter, a data repair request is sent to the third service device based on the parameter difference between the description parameter and the actually received parameter.
11. The method according to claim 1, wherein The first service device includes M graphics processing units, the M graphics processing units include the first graphics processing unit, and M is a positive integer; the method further includes: Obtaining unit number data corresponding to each of the M graphics processing units, and adding the M graphics processing units to M unit groups based on the unit number data; In each unit group, establishing S queue pairs between the graphics processing unit in the unit group and other graphics processing units in the unit group by the first service device; Map the S queue pairs corresponding to each unit group to the hardware port of the unit group.
12. A data transmission device, characterized in that: The device is applicable to a first service device, and includes: a data acquisition module, configured to respond to a data transmission request and acquire, from the data transmission request, first service data, a first graphics processing unit that transmits the first service data, and a second graphics processing unit that receives the first service data; the first graphics processing unit being a graphics processing unit in the first service device; a queue pair determining module, configured to determine a first queue pair for sending the first service data from S queue pairs associated with the first graphics processing unit; S is a positive integer; The data sending module is configured to obtain the first hardware port corresponding to the first queue pair, and send the first service data to the second graphics processing unit in the second service device through the first hardware port and the first queue pair.
13. A computer device, characterized in that: Includes processor, memory, input and output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Cited By
Communication processing device and method, electronic equipment and storage medium
CN121785981A