Data exchange method and device, product and electronic equipment
By using inter-process channels and host channel adapters in nodes to realize synchronous data exchange and using asynchronous data exchange between nodes and within nodes, the problem of low data exchange efficiency in the prior art is solved and computer performance is improved.
Patent Information
- Application Number
- CN202411081044.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-08
AI Technical Summary
The prior art performs data exchange between nodes after data exchange is completed, resulting in low data exchange efficiency and high computer performance burden.
Synchronous data exchange of processes within nodes is realized through inter-process channels and host channel adapters, and data exchange operations between nodes and within nodes are performed in an asynchronous manner, so that data exchange between nodes and within nodes is carried out in parallel to balance process communication workloads.
It improves data exchange efficiency, reduces the computer performance burden, and realizes synchronization of process data exchange within nodes and parallelism of data exchange between nodes.
Smart Images

Figure CN118916191A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data exchange method, a data exchange device, a computer program product, and an electronic device. Background Art
[0002] Host Channel Adapter (HCA) enables managed systems to connect to other devices through ports. Specifically, an HCA can connect a port to another HCA, a target device, or a switch, and the switch can redirect data entering one of its ports outward to a device connected to another port. Multi-HCA refers to the integration or use of multiple HCAs. In a multi-HCA setting, the system can use multiple HCAs to process data transmission and communication tasks in parallel, thereby improving the overall data transmission speed and performance.
[0003] In related technologies, in order to optimize algorithms such as collective communication algorithms, Multi-HCA is usually set on each image processor to implement inter-node data exchange through Multi-HCA after implementing intra-node data exchange, thereby implementing multi-node collective data exchange. However, the solution of first performing intra-node data exchange and then performing inter-node data exchange has the problem of low data exchange efficiency.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute an existing solution known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present application is to provide a data exchange method, a data exchange device, a computer program product and an electronic device, which can support data exchange between processes within a node through an inter-process channel and a host channel adapter. In this case, synchronous data exchange of processes within the node can be achieved. Compared with the prior art that needs to wait for the data exchange of processes within the node to be completed in sequence before performing data exchange between nodes, the present application does not need to wait for the data exchange within the node to be completed. Since the data exchange of each process within the node is synchronous, the inter-node data exchange operation and the intra-node data exchange operation can be performed in an asynchronous manner, so that the data exchange between nodes and within the node is carried out in parallel, so as to improve the data exchange efficiency, and balance the communication workload of each process by using the inter-process channel and the host channel adapter in parallel, thereby reducing the performance burden of the computer.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of the present application, a data exchange method is provided, the method comprising:
[0008] Based on the mapping relationship between the process of each node and each host channel adapter, determine the inter-process channel and the inter-process track based on each host channel adapter and the inter-node track;
[0009] Trigger each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, trigger each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track;
[0010] Trigger each node to cyclically asynchronously execute inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed.
[0011] In an exemplary embodiment of the present application, it further includes:
[0012] Determine a graphics processor set corresponding to each node; wherein each graphics processor in the graphics processor set corresponds to a host channel adapter;
[0013] Determine the processes running in each graphics processor, and map the processes to the corresponding graphics processors to determine the mapping relationship.
[0014] In an exemplary embodiment of the present application, each node is triggered to cyclically and asynchronously perform inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed, including:
[0015] When each node is triggered to perform the third inter-node data exchange operation, each node is triggered to synchronously perform the second intra-node data exchange operation based on the inter-process channel and the inter-process track, and each node is triggered to continue to cycle and asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0016] In an exemplary embodiment of the present application, it further includes:
[0017] Determine data exchange parameters, the total number of execution steps corresponding to the data exchange task, and the amount of data exchange in a single step corresponding to the data exchange task; wherein the data exchange parameters include a data sending buffer, a data receiving buffer, the amount of data corresponding to the data exchange task, the number of graphics processors of each node, and the total number of processes;
[0018] Initialize the data sending buffer and the data receiving buffer based on the data volume corresponding to the data exchange task, the total number of execution steps, and the data exchange volume in a single step;
[0019] Each node is initialized within and between nodes based on the data exchange parameters.
[0020] In an exemplary embodiment of the present application, each node includes a first node and a second node, and each node is triggered to perform a first inter-node data exchange operation based on an inter-node track, and when each node is triggered to perform a second inter-node data exchange operation, each node is triggered to synchronously perform a first intra-node data exchange operation based on an inter-process channel and an inter-process track, including:
[0021] Triggering the first node to perform a first inter-node data exchange operation based on the data exchange amount in a single step; wherein the first inter-node data exchange operation is used to exchange target data stored in a data sending buffer;
[0022] When the first node is triggered to perform the second inter-node data exchange operation, the first node and the second node are triggered to synchronously perform the first intra-node data exchange operation based on the inter-process channel and the inter-process track, respectively; wherein the first intra-node data exchange operation is used to exchange target data.
[0023] In an exemplary embodiment of the present application, it further includes:
[0024] In response to the execution result of the data exchange task, storing the execution result;
[0025] If there is a node task that uses the execution result as the execution basis, the execution result is called to trigger the execution of the node task.
[0026] In an exemplary embodiment of the present application, it further includes:
[0027] Generate the data exchange duration corresponding to the data exchange task based on the duration corresponding to the data exchange operation between each node and the duration corresponding to the data exchange operation within each node;
[0028] Output data exchange duration.
[0029] According to one aspect of the present application, a data exchange device is provided, comprising:
[0030] A track determination unit, for determining, based on a mapping relationship between a process of each node and each host channel adapter, an inter-process channel and an inter-process track based on each host channel adapter and an inter-node track;
[0031] A data exchange unit, used to trigger each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, trigger each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track;
[0032] The data exchange unit is also used to trigger each node to cyclically and asynchronously execute inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed.
[0033] In an exemplary embodiment of the present application, it further includes:
[0034] A graphics processor determination unit, used to determine a graphics processor set corresponding to each node; wherein each graphics processor in the graphics processor set corresponds to a host channel adapter;
[0035] The mapping relationship determination unit is used to determine the processes running in each graphics processor, and map the processes to the corresponding graphics processors to determine the mapping relationship.
[0036] In an exemplary embodiment of the present application, the data exchange unit triggers each node to cyclically and asynchronously perform inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed, including:
[0037] When each node is triggered to perform the third inter-node data exchange operation, each node is triggered to synchronously perform the second intra-node data exchange operation based on the inter-process channel and the inter-process track, and each node is triggered to continue to cycle and asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0038] In an exemplary embodiment of the present application, it further includes:
[0039] A parameter determination unit, used to determine data exchange parameters, the total number of execution steps corresponding to the data exchange task, and the amount of data exchange in a single step corresponding to the data exchange task; wherein the data exchange parameters include a data sending buffer, a data receiving buffer, the amount of data corresponding to the data exchange task, the number of graphics processors of each node, and the total number of processes;
[0040] An initialization unit, used to initialize a data sending buffer and a data receiving buffer based on the amount of data corresponding to the data exchange task, the total number of execution steps, and the amount of data exchange in a single step;
[0041] The initialization unit is also used to perform intra-node initialization and inter-node initialization on each node based on the data exchange parameters.
[0042] In an exemplary embodiment of the present application, each node includes a first node and a second node, and a data exchange unit triggers each node to perform a first inter-node data exchange operation based on an inter-node track, and when triggering each node to perform a second inter-node data exchange operation, triggers each node to synchronously perform a first intra-node data exchange operation based on an inter-process channel and an inter-process track, including:
[0043] Triggering the first node to perform a first inter-node data exchange operation based on the data exchange amount in a single step; wherein the first inter-node data exchange operation is used to exchange target data stored in a data sending buffer;
[0044] When the first node is triggered to perform the second inter-node data exchange operation, the first node and the second node are triggered to synchronously perform the first intra-node data exchange operation based on the inter-process channel and the inter-process track, respectively; wherein the first intra-node data exchange operation is used to exchange target data.
[0045] In an exemplary embodiment of the present application, it further includes:
[0046] A storage unit, for storing the execution result in response to the execution result of the data exchange task;
[0047] The calling unit is used to call the execution result to trigger the execution of the node task if there is a node task that uses the execution result as an execution basis.
[0048] In an exemplary embodiment of the present application, it further includes:
[0049] A duration determination unit, used to generate a data exchange duration corresponding to the data exchange task based on the duration corresponding to the data exchange operation between each node and the duration corresponding to the data exchange operation within each node;
[0050] The duration output unit is used to output the data exchange duration.
[0051] According to one aspect of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above methods is implemented.
[0052] According to one aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0053] The exemplary embodiments of the present application may have some or all of the following beneficial effects:
[0054] In a data exchange method provided in an example embodiment of the present application, data exchange between processes within a node can be supported through an inter-process channel and a host channel adapter. In this case, synchronous data exchange of processes within a node can be achieved. Compared with the prior art that needs to wait for the processes within a node to complete data exchange in sequence before performing data exchange between nodes, the present application does not need to wait for the data exchange within the node to be completed. Since the data exchange of each process within a node is synchronous, the inter-node data exchange operation and the intra-node data exchange operation can be performed asynchronously, so that data exchange between nodes and within a node is performed in parallel, so as to improve data exchange efficiency. The communication workload of each process is balanced by using the inter-process channel and the host channel adapter in parallel, thereby reducing the performance burden of the computer.
[0055] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0057] Figure 1 A flowchart of a data exchange method according to an embodiment of the present application is schematically shown;
[0058] Figure 2 A schematic diagram of data exchange within a node according to an embodiment of the present application is schematically shown;
[0059] Figure 3 A flowchart of a data exchange method according to another embodiment of the present application is schematically shown;
[0060] Figure 4 The structure block diagram of a data exchange device according to an embodiment of the present application is schematically shown;
[0061] Figure 5 The structure diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0062] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present application will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present application.
[0063] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0064] See also Figure 1 , Figure 1 The following is a schematic diagram of a data exchange method according to an embodiment of the present application. Figure 1 As shown, the data exchange method may include: steps S110 to S130.
[0065] Step S110: based on the mapping relationship between the processes of each node and each host channel adapter, determine the inter-process channel and the inter-process track and the inter-node track based on each host channel adapter.
[0066] Step S120: triggering each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, triggering each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track.
[0067] Step S130: triggering each node to cyclically and asynchronously execute the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0068] Implementation Figure 1 The method shown can support data exchange between processes within a node through inter-process channels and host channel adapters. In this case, synchronous data exchange of processes within the node can be achieved. Compared with the prior art that needs to wait for the processes within the node to complete data exchange in sequence before performing data exchange between nodes, the present application does not need to wait for the data exchange within the node to be completed. Since the data exchange of each process within the node is synchronous, the inter-node data exchange operation and the intra-node data exchange operation can be performed in an asynchronous manner, so that the data exchange between nodes and within the node is carried out in parallel to improve the data exchange efficiency. By using the inter-process channel and the host channel adapter in parallel, the communication workload of each process is balanced, thereby reducing the performance burden of the computer.
[0069] Next, the above steps of this exemplary embodiment are described in more detail.
[0070] In step S110, based on the mapping relationship between the processes of each node and each host channel adapter, an inter-process channel and an inter-process track based on each host channel adapter and an inter-node track are determined.
[0071] Specifically, in the present application, each node may refer to each server or each terminal device, which is not limited in the present embodiment. The execution subject of steps S110 to S130 may be a control terminal to trigger each node to realize collective communication.
[0072] Any of the nodes may include multiple graphics processing units (GPUs), each GPU may run one or more processes, and each graphics processor corresponds to a host channel adapter (HCA), which is used to provide data exchange within and between nodes.
[0073] For example, graphics processor A corresponds to host channel adapter A, then there is a mapping relationship between each process running in graphics processor A and host channel adapter A, and the process in graphics processor A can exchange data with processes in other graphics processors through host channel adapter A, and the data exchange can be understood as data exchange within the node; among which, host channel adapter A constitutes an inter-process track.
[0074] In addition, in addition to exchanging data through the inter-process track, the graphics processors within the node can also communicate through the original inter-process channel; wherein the inter-process channel can be a channel for communicating with other processes built when the process is established, and the channel is not an HCA channel. The communication efficiency within the node can be improved by using the inter-process channel and the inter-process track based on each host channel adapter to communicate within the node. Compared with the prior art that makes the inter-process channel bear all the data exchange work, the present application can balance the data exchange load between the inter-process channel and the inter-process track.
[0075] As an optional embodiment, it also includes:
[0076] Determine a graphics processor set corresponding to each node; wherein each graphics processor in the graphics processor set corresponds to a host channel adapter;
[0077] Determine the processes running in each graphics processor, and map the processes to the corresponding graphics processors to determine the mapping relationship.
[0078] It can be seen that by implementing this optional embodiment, the capabilities of the host channel adapter can be fully utilized to achieve more efficient data exchange.
[0079] Specifically, the number of processes running in each graphics processor can be any value, and is not limited in the embodiments of the present application.
[0080] As an optional embodiment, it also includes:
[0081] Determine data exchange parameters, the total number of execution steps corresponding to the data exchange task, and the amount of data exchange in a single step corresponding to the data exchange task; wherein the data exchange parameters include a data sending buffer, a data receiving buffer, the amount of data corresponding to the data exchange task, the number of graphics processors of each node, and the total number of processes;
[0082] Initialize the data sending buffer and the data receiving buffer based on the data volume corresponding to the data exchange task, the total number of execution steps, and the data exchange volume in a single step;
[0083] Each node is initialized within and between nodes based on the data exchange parameters.
[0084] It can be seen that implementing this optional embodiment can help each process of each node to obtain consistent data, improve bandwidth utilization, and accelerate data transmission and processing speed.
[0085] Specifically, the data sending buffer can be represented as sb; the data receiving buffer can be represented as rb; the amount of data corresponding to the data exchange task can be represented as sz; the number of graphics processors of each node can be represented as GPN; and the total number of processes can be represented as numRanks. Specifically, the data exchange parameters can be input into the allgatherOpt function, and the total number of execution steps ns corresponding to the data exchange task and the amount of data exchange stepSize in a single step corresponding to the data exchange task can be calculated through the allgatherOpt function. Furthermore, the data sending buffer and the data receiving buffer can be initialized through the statement localCopyInit(sb,rb,sz), and each node can be initialized within the node through the statement localIntraExchangeInit(sb,rb,sz,GPN,numRanks), and each node can be initialized between nodes through the statement interExchangeInit(sb,rb,stepSize,sz,GPN,numRanks,step); wherein initialization refers to operations such as assigning values to parameters.
[0086] In step S120, each node is triggered to perform a first inter-node data exchange operation based on the inter-node track, and when each node is triggered to perform a second inter-node data exchange operation, each node is triggered to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track.
[0087] Specifically, the data exchanged within a node and between nodes is data belonging to the same data set, and the data exchanged can be text data, image data, video data, etc. For example, when each node is a game server, the exchanged data can be game screen data. The data exchanged in a single time corresponding to the data exchange within a node and the data exchange between nodes can be different.
[0088] For details, please refer to Figure 2 , Figure 2 The following schematically shows a schematic diagram of data exchange within a node according to an embodiment of the present application. Figure 2 As shown, compared with the data exchange within the node achieved by the first step 211, the second step 212, and the third step 213 in the related art, the present application can achieve more efficient data exchange within the node only through the first step 221 and the second step 222. In the related art, HCA is not used to build the inter-process track within the node, while the present application builds the inter-process track within the node. Therefore, in the first step 221, process 1 can send data to process 3 based on the inter-process track, and process 4 can send data to process 2 based on the inter-process track. Data can be exchanged between process 1 and process 4 through the inter-process channel. Similarly, in the second step 222, process 2 can send data to process 1 based on the inter-process track, and process 3 can send data to process 4 based on the inter-process track. The related art can only achieve data exchange within the node by executing the first step 211, the second step 212, and the third step 213 in sequence. Therefore, the implementation of the solution of the present application can improve the efficiency of data exchange.
[0089] As an optional embodiment of step S120, each node includes a first node and a second node, and each node is triggered to perform a first inter-node data exchange operation based on the inter-node track, and when each node is triggered to perform a second inter-node data exchange operation, each node is triggered to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track, including:
[0090] Step S1201: triggering the first node to perform a first inter-node data exchange operation based on the data exchange amount in a single step; wherein the first inter-node data exchange operation is used to exchange target data stored in a data sending buffer;
[0091] Step S1202: When the first node is triggered to perform the second inter-node data exchange operation, the first node and the second node are triggered to synchronously perform the first intra-node data exchange operation based on the inter-process channel and the inter-process track, respectively; wherein the first intra-node data exchange operation is used to exchange target data.
[0092] It can be seen that by implementing this optional embodiment, HCA resources can be effectively utilized to implement data exchange within and between nodes, thereby maximizing system throughput and reducing resource waste.
[0093] Specifically, the first node and the second node can be servers / terminal devices. For example, the first node and the second node can be servers of different banks that need data synchronization. In addition, the target data refers to the data exchanged in a single time. Since the second inter-node data exchange operation is performed simultaneously with the first intra-node data exchange operation, when the first inter-node data exchange operation exchanges the target data, the first intra-node data exchange operation also exchanges the target data, and the second inter-node data exchange operation exchanges other data after the target data. By exchanging data in such an asynchronous manner, data exchange within and between nodes can be synchronized.
[0094] In step S130, each node is triggered to cyclically and asynchronously execute the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0095] Specifically, the statement for step←1 to ns-1 do can be used to trigger each node to cyclically asynchronously execute the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed. The intra-node data exchange operation can be implemented based on the statement intraExchangeInit(sb,rb,stepSize,sz,GPN,numRanks,step-1), and the inter-node data exchange operation can be implemented based on the statement interExchangeInit(sb,rb,stepSize,sz,GPN,numRanks,step).
[0096] As an optional embodiment of step S130, triggering each node to cyclically and asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed includes:
[0097] Step S1301: When each node is triggered to perform the third inter-node data exchange operation, each node is triggered to synchronously perform the second intra-node data exchange operation based on the inter-process channel and the inter-process track, and each node is triggered to continue to cycle and asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0098] It can be seen that implementing this optional embodiment can reduce the delay of data exchange, improve bandwidth utilization, and accelerate data transmission and processing speed.
[0099] Specifically, the statement interExchangeComplete(step) can be used to determine that the second inter-node data exchange operation before the third inter-node data exchange operation has been completed, and the statement intraExchangeComplete(step-1) can be used to determine that the first intra-node data exchange operation before the second intra-node data exchange operation has been completed. Therefore, interExchangeComplete(step) and intraExchangeComplete(step-1) can be used to determine whether the data exchange task is completed.
[0100] As an optional embodiment, it also includes:
[0101] Generate the data exchange duration corresponding to the data exchange task based on the duration corresponding to the data exchange operation between each node and the duration corresponding to the data exchange operation within each node;
[0102] Output data exchange duration.
[0103] It can be seen that by implementing this optional embodiment, the total data exchange duration can be generated so that the user can understand the data exchange efficiency, thereby improving the interactivity with the user.
[0104] Specifically, the duration corresponding to each inter-node data exchange operation and the duration corresponding to each intra-node data exchange operation can be input into the expression: 总 =Max(T 内 ,T 间 )+(n-1)*Max(T 内 ,T 间 )+T 内 , to generate the data exchange duration T corresponding to the data exchange task 总 Among them, T 总 It can be used to characterize the collective communication efficiency for user reference. 总 You can adjust the GPU settings / HCA settings.
[0105] In an exemplary embodiment of the present application, it further includes:
[0106] In response to the execution result of the data exchange task, storing the execution result;
[0107] If there is a node task that uses the execution result as the execution basis, the execution result is called to trigger the execution of the node task.
[0108] It can be seen that by implementing this optional embodiment, a calling function can be provided so that the execution result can be applied to other tasks.
[0109] Specifically, the execution result includes information such as the node identification participating in the data exchange, the total amount of data exchange, the total number of data exchange steps, the data exchange fields, etc. The present application supports data calling for the execution results. When a node task (such as a periodic summary task of collective communication results) needs to be executed based on the execution result, the execution result can be called.
[0110] See also Figure 3 , Figure 3 The following schematically shows a flow chart of a data exchange method according to another embodiment of the present application. Figure 3 As shown, the data exchange method includes: steps S310 to S370.
[0111] Step S310: determining a graphics processor set corresponding to each node; wherein each graphics processor in the graphics processor set corresponds to a host channel adapter; determining a process running in each graphics processor, and mapping the process to a corresponding graphics processor to determine a mapping relationship.
[0112] Step S320: Based on the mapping relationship between the processes of each node and each host channel adapter, determine the inter-process channel and the inter-process track based on each host channel adapter and the inter-node track.
[0113] Step S330: Determine data exchange parameters, the total number of execution steps corresponding to the data exchange task, and the amount of data exchange in a single step corresponding to the data exchange task; wherein the data exchange parameters include a data sending buffer, a data receiving buffer, the amount of data corresponding to the data exchange task, the number of graphics processors of each node, and the total number of processes.
[0114] Step S340: Initialize the data sending buffer and the data receiving buffer based on the data volume corresponding to the data exchange task, the total number of execution steps, and the data exchange volume in a single step; and initialize each node within the node and between nodes based on the data exchange parameters.
[0115] Step S350: triggering each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, triggering each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track.
[0116] Step S360: When each node is triggered to perform the third inter-node data exchange operation, each node is triggered to synchronously perform the second intra-node data exchange operation based on the inter-process channel and the inter-process track, and each node is triggered to continue to cycle and asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0117] Step S370: Based on the duration corresponding to the data exchange operation between each sub-node and the duration corresponding to the data exchange operation within each sub-node, generate the data exchange duration corresponding to the data exchange task; and output the data exchange duration.
[0118] It should be noted that steps S310 to S370 are Figure 1 The steps and their embodiments shown correspond to each other. For the specific implementation of steps S310 to S370, please refer to Figure 1 The steps and embodiments shown are not described in detail here.
[0119] It can be seen that implementation Figure 3 The method shown can support data exchange between processes within a node through inter-process channels and host channel adapters. In this case, synchronous data exchange of processes within the node can be achieved. Compared with the prior art that needs to wait for the processes within the node to complete data exchange in sequence before performing data exchange between nodes, the present application does not need to wait for the data exchange within the node to be completed. Since the data exchange of each process within the node is synchronous, the inter-node data exchange operation and the intra-node data exchange operation can be performed in an asynchronous manner, so that the data exchange between nodes and within the node is carried out in parallel to improve the data exchange efficiency. By using the inter-process channel and the host channel adapter in parallel, the communication workload of each process is balanced, thereby reducing the performance burden of the computer.
[0120] See also Figure 4 , Figure 4 The structure block diagram of the data exchange device according to an embodiment of the present application is schematically shown. Figure 1 The method shown corresponds to Figure 4 As shown, the data exchange device 400 includes:
[0121] The track determination unit 401 is used to determine the inter-process channel and the inter-process track based on each host channel adapter and the inter-node track based on the mapping relationship between the process of each node and each host channel adapter;
[0122] The data exchange unit 402 is used to trigger each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, trigger each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track;
[0123] The data exchange unit 402 is also used to trigger each node to cyclically and asynchronously perform inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed.
[0124] It can be seen that implementation Figure 4The device shown can support data exchange between processes within a node through an inter-process channel and a host channel adapter. In this case, synchronous data exchange of processes within the node can be achieved. Compared with the prior art that needs to wait for the processes within the node to complete data exchange in sequence before performing data exchange between nodes, the present application does not need to wait for the data exchange within the node to be completed. Since the data exchange of each process within the node is synchronous, the inter-node data exchange operation and the intra-node data exchange operation can be performed asynchronously, so that the data exchange between nodes and within the node is carried out in parallel to improve the data exchange efficiency. The communication workload of each process is balanced by using the inter-process channel and the host channel adapter in parallel, thereby reducing the performance burden of the computer.
[0125] In an exemplary embodiment of the present application, it further includes:
[0126] A graphics processor determination unit, used to determine a graphics processor set corresponding to each node; wherein each graphics processor in the graphics processor set corresponds to a host channel adapter;
[0127] The mapping relationship determination unit is used to determine the processes running in each graphics processor, and map the processes to the corresponding graphics processors to determine the mapping relationship.
[0128] It can be seen that by implementing this optional embodiment, the capabilities of the host channel adapter can be fully utilized to achieve more efficient data exchange.
[0129] In an exemplary embodiment of the present application, the data exchange unit 402 triggers each node to cyclically and asynchronously perform inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed, including:
[0130] When each node is triggered to perform the third inter-node data exchange operation, each node is triggered to synchronously perform the second intra-node data exchange operation based on the inter-process channel and the inter-process track, and each node is triggered to continue to cycle and asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0131] It can be seen that implementing this optional embodiment can reduce the delay of data exchange, improve bandwidth utilization, and accelerate data transmission and processing speed.
[0132] In an exemplary embodiment of the present application, it further includes:
[0133] A parameter determination unit, used to determine data exchange parameters, the total number of execution steps corresponding to the data exchange task, and the amount of data exchange in a single step corresponding to the data exchange task; wherein the data exchange parameters include a data sending buffer, a data receiving buffer, the amount of data corresponding to the data exchange task, the number of graphics processors of each node, and the total number of processes;
[0134] An initialization unit, used to initialize a data sending buffer and a data receiving buffer based on the amount of data corresponding to the data exchange task, the total number of execution steps, and the amount of data exchange in a single step;
[0135] The initialization unit is also used to perform intra-node initialization and inter-node initialization on each node based on the data exchange parameters.
[0136] It can be seen that implementing this optional embodiment can help each process of each node to obtain consistent data, improve bandwidth utilization, and accelerate data transmission and processing speed.
[0137] In an exemplary embodiment of the present application, each node includes a first node and a second node, and the data exchange unit 402 triggers each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, triggers each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track, including:
[0138] Triggering the first node to perform a first inter-node data exchange operation based on the data exchange amount in a single step; wherein the first inter-node data exchange operation is used to exchange target data stored in a data sending buffer;
[0139] When the first node is triggered to perform the second inter-node data exchange operation, the first node and the second node are triggered to synchronously perform the first intra-node data exchange operation based on the inter-process channel and the inter-process track, respectively; wherein the first intra-node data exchange operation is used to exchange target data.
[0140] It can be seen that by implementing this optional embodiment, HCA resources can be effectively utilized to implement data exchange within and between nodes, thereby maximizing system throughput and reducing resource waste.
[0141] In an exemplary embodiment of the present application, it further includes:
[0142] A storage unit, for storing the execution result in response to the execution result of the data exchange task;
[0143] The calling unit is used to call the execution result to trigger the execution of the node task if there is a node task that uses the execution result as an execution basis.
[0144] It can be seen that by implementing this optional embodiment, a calling function can be provided so that the execution result can be applied to other tasks.
[0145] In an exemplary embodiment of the present application, it further includes:
[0146] A duration determination unit, used to generate a data exchange duration corresponding to the data exchange task based on the duration corresponding to the data exchange operation between each node and the duration corresponding to the data exchange operation within each node;
[0147] The duration output unit is used to output the data exchange duration.
[0148] It can be seen that by implementing this optional embodiment, the total data exchange duration can be generated so that the user can understand the data exchange efficiency, thereby improving the interactivity with the user.
[0149] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0150] See also Figure 5 , Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0151] It should be noted that Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0152] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. Various programs and data required for system operation are also stored in the RAM 503. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0153] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0154] In particular, according to an embodiment of the present application, the process described with reference to the flowchart above can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the method and apparatus of the present application are executed.
[0155] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the data exchange method is implemented.
[0156] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0157] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0158] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0159] Computer programs can be carried or transmitted by electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals, thereby running computer programs. When a computer program is running on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device can be executed) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned data exchange method, which includes the following steps: based on the mapping relationship between the process of each node and each host channel adapter, determine the inter-process channel and the inter-process track and the inter-node track based on each host channel adapter; trigger each node to perform the first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform the second inter-node data exchange operation, trigger each node to synchronously perform the first intra-node data exchange operation based on the inter-process channel and the inter-process track; trigger each node to cyclically asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
[0160] By executing the above method steps through a computer program, data exchange between processes within a node can be supported through an inter-process channel and a host channel adapter. In this case, synchronous data exchange of processes within a node can be achieved. Compared with the prior art that needs to wait for the processes within a node to complete data exchange in sequence before performing data exchange between nodes, the present application does not need to wait for the data exchange within a node to be completed. Since the data exchange of each process within a node is synchronous, the inter-node data exchange operation and the intra-node data exchange operation can be performed asynchronously, so that data exchange between nodes and within a node is performed in parallel, so as to improve data exchange efficiency. The communication workload of each process is balanced by using the inter-process channel and the host channel adapter in parallel, thereby reducing the performance burden of the computer.
[0161] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0162] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0163] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
Claims
1. A data exchange method, characterized in that: include: Based on the mapping relationship between the processes of each node and each host channel adapter, determine the inter-process channel and the inter-process track and the inter-node track based on each host channel adapter; Triggering each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, triggering each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track; Each node is triggered to cyclically and asynchronously execute inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed.
2. The method according to claim 1, characterized in that Also includes: Determine a graphics processor set corresponding to each of the nodes; wherein each graphics processor in the graphics processor set corresponds to a host channel adapter; Determine the processes running in each of the graphics processors, and map the processes to corresponding graphics processors to determine the mapping relationship.
3. The method according to claim 1, characterized in that Triggering each node to cyclically and asynchronously execute inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed, including: When each node is triggered to perform the third inter-node data exchange operation, each node is triggered to synchronously perform the second intra-node data exchange operation based on the inter-process channel and the inter-process track, and each node is triggered to continue to cycle and asynchronously perform the inter-node data exchange operation and the intra-node data exchange operation until the data exchange task is completed.
4. The method according to claim 1, characterized in that: Also includes: Determine data exchange parameters, the total number of execution steps corresponding to the data exchange task, and the amount of data exchange in a single step corresponding to the data exchange task; wherein the data exchange parameters include a data sending buffer, a data receiving buffer, the amount of data corresponding to the data exchange task, the number of graphics processors of each node, and the total number of processes; Initializing the data sending buffer and the data receiving buffer based on the data volume corresponding to the data exchange task, the total number of execution steps, and the data exchange volume in the single step; Based on the data exchange parameters, each node is initialized within a node and between nodes.
5. The method according to claim 4, characterized in that Each node includes a first node and a second node, and each node is triggered to perform a first inter-node data exchange operation based on the inter-node track, and when each node is triggered to perform a second inter-node data exchange operation, each node is triggered to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track, including: Triggering the first node to perform a first inter-node data exchange operation based on the data exchange amount in the single step; wherein the first inter-node data exchange operation is used to exchange target data stored in the data sending buffer; When the first node is triggered to perform a second inter-node data exchange operation, the first node and the second node are triggered to respectively and synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track; wherein the first intra-node data exchange operation is used to exchange the target data.
6. The method according to claim 1, characterized in that Also includes: In response to the execution result of the data exchange task, storing the execution result; If there is a node task that uses the execution result as an execution basis, the execution result is called to trigger the execution of the node task.
7. The method according to any one of claims 1 to 6, characterized in that: Also includes: Generate a data exchange duration corresponding to the data exchange task based on the duration corresponding to the data exchange operation between each node and the duration corresponding to the data exchange operation within each node; The data exchange duration is output.
8. A data exchange device, characterized in that: include: A track determination unit, configured to determine, based on a mapping relationship between a process of each node and each host channel adapter, an inter-process channel and an inter-process track based on each host channel adapter and an inter-node track; a data exchange unit, configured to trigger each node to perform a first inter-node data exchange operation based on the inter-node track, and when triggering each node to perform a second inter-node data exchange operation, trigger each node to synchronously perform a first intra-node data exchange operation based on the inter-process channel and the inter-process track; The data exchange unit is also used to trigger each node to cyclically and asynchronously perform inter-node data exchange operations and intra-node data exchange operations until the data exchange task is completed.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.
