Alltoall method for dragonfly topology
By optimizing the Alltoall communication method in the Dragonfly topology, determining the total number of processes and decision parameters, and adjusting the communication node objects, the link congestion problem was solved, and the communication speed was significantly improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT UNIV OF DEFENSE TECH
- Filing Date
- 2023-03-15
- Publication Date
- 2026-06-05
AI Technical Summary
The existing Alltoall operation fails to fully utilize the topology characteristics in the Dragonfly topology, leading to link congestion and reduced communication speed.
By determining the total number of server node processes participating in Alltoall communication and their decision parameters, the communication node object for each process at each step is determined based on the decision parameters and the preset communication model. At each step of each process, the data to be received is received from the sending process, and the data to be sent is sent to the receiving process. This changes the communication mode between nodes and distributes the data evenly in the Dragonfly network.
It effectively alleviates link congestion in the Dragonfly topology and significantly improves the speed of Alltoall communication, especially in shortest route and adaptive route, with improvements of 999.58% and 372.85% respectively.
Smart Images

Figure CN116489095B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more particularly to an Alltoall method for Dragonfly topology. Background Technology
[0002] Dragonfly topology is a novel, low-diameter, highly scalable, and cost-effective topology primarily used in supercomputer interconnection network systems. A typical Dragonfly topology consists of several groups, each with the same number of switches. These switches connect to compute nodes, and the switches within each group are fully interconnected. When all switches in a group are considered as a larger virtual switch, the groups themselves are also fully interconnected. Given a fixed number of switch ports, to interconnect as many compute nodes as possible, there must be only one direct link between groups. Dragonfly topology exhibits excellent performance under uniform traffic conditions, meeting the high bandwidth and low latency requirements of supercomputer networks.
[0003] Message Passing Interface (MPI) is the most important and mainstream parallel programming framework in the field of high-performance computing today. MPI not only includes basic one-to-one communication interfaces for sending and receiving, but also many aggregate communication interfaces, such as MPI_Alltoall, MPI_Allgather, and MPI_Alltoall. Programmers only need to call the function interfaces to complete the communication, without needing to worry about the implementation of the communication algorithm or the hardware used for communication. The parallel applications written also have excellent portability.
[0004] In common open-source MPI implementations, the Alltoall operation uses the Pairwise and BatchedSendrecv algorithms. However, these algorithms do not fully utilize the characteristics of the Dragonfly topology, resulting in significant link congestion between groups and greatly reducing communication speed. This is due to the characteristics of the Dragonfly topology; therefore, it is essential to optimize the Alltoall operation implementation for the Dragonfly topology.
[0005] While aggregation communication methods for Dragonfly topology optimization exist, such as the PAARD (Proximity-AwareAll-Reduce) algorithm and the SDTA (Stepwise Dissemination, Transfer, or Aggregation) series, these optimization schemes all assume the use of all computing nodes in the entire Dragonfly topology. This assumption of using all computing nodes in a high-performance computing system is difficult to apply in real-world deployments. High-performance computing systems often need to serve a large number of users simultaneously, making it difficult to allocate all system resources to a single user. Furthermore, high-performance computing systems with massive numbers of computing nodes often have faulty nodes, making it difficult to guarantee that all computing nodes are available simultaneously. Summary of the Invention
[0006] The main objective of this invention is to provide an Alltoall method for Dragonfly topologies, aiming to solve the technical problem of how to alleviate link congestion in Dragonfly topologies.
[0007] To achieve the above objectives, the present invention provides an Alltoall method for Dragonfly topology, comprising the following steps:
[0008] The total number of processes on the server nodes participating in the Alltoall communication is obtained based on the user-input parameters.
[0009] The decision parameters corresponding to the Alltoall communication are determined based on the total number of processes. The communication node object for each process at each step is determined based on the decision parameters and the preset communication model. The communication node object includes the receiving process and the sending process.
[0010] At each step of the current process, receive the data to be received sent by the sending process corresponding to the current process, and send the preset data to be sent to the receiving process corresponding to the current process.
[0011] Optionally, the step of determining the decision parameters corresponding to the Alltoall communication based on the total number of processes includes:
[0012] Determine all prime factors of the total number of processes, and calculate the first product among the prime factors;
[0013] If the total number of processes is a multiple of 4, the first product is doubled to obtain a doubled result, and the total number of processes is moduloed based on the doubled result to obtain decision parameters.
[0014] Optionally, the steps for determining the communication node object for each process at each step based on the decision parameters and the preset communication model include:
[0015] If the decision parameter is not 0, and the ratio between the total number of processes and the decision parameter is greater than or equal to a preset value, then the communication node object for each process at each step is determined according to the preset first communication model.
[0016] If the decision parameter is 0, or the ratio between the total number of processes and the decision parameter is less than a preset value, then the communication node object for each step of each process is determined according to the preset second communication model, wherein the preset communication model includes the first communication model and the second communication model.
[0017] Optionally, the steps for determining the communication node object for each process at each step according to a preset first communication model include:
[0018] Determine the preset first iteration variable, and calculate the reverse iteration variable based on the first iteration variable;
[0019] Determine the first initial receiving process and the first initial sending process for each process at step zero;
[0020] Based on the preset first communication model, the first iteration variable, and the first initial sending process, iterative calculations are performed to obtain the receiving process at each step of each process;
[0021] Based on the first communication model, the reverse iteration variable, and the first initial receiving process, iterative calculations are performed to obtain the sending process of each step of each process;
[0022] The first communication model includes: x i =(ax i-1 +c)%N, Wherein, the x i For the receiving process of process x at step i, the... For process x, the sending process at step i, x i-1 For the receiving process of process x at step i-1, the... Let x be the sending process at step i-1, where a and c are the first iteration variables, and a / and c / N is the total number of processes, which is the variable used for reverse iteration.
[0023] Optionally, the first iteration variable includes iteration variable a and iteration variable c, and the step of determining the preset first iteration variable includes:
[0024] A positive integer is randomly selected from a first preset interval, and the positive integer is input into a first preset formula to calculate the iteration variable 'a', where the first preset interval is... The first preset formula is a = (bs + 1) % N, where N is the total number of processes, b is the decision parameter, s is a positive integer, and a is the iteration variable a;
[0025] Set the value of the iteration variable c to 1.
[0026] Optionally, the step of calculating the reverse iteration variable based on the first iteration variable includes:
[0027] The iteration variable 'a' is input into the second preset formula to calculate the reverse iteration variable 'a'. / Wherein, the second preset formula is a / =a N-1 %N;
[0028] The iterative variable 'a' is input into the third preset formula to calculate the reverse iterative variable 'c'. / The third preset formula is:
[0029] The reverse iteration variable includes the reverse iteration variable a. / and the reverse iteration variable c / .
[0030] Optionally, the steps for determining the communication nodes of each process at each step according to a preset second communication model include:
[0031] Determine a preset second iteration variable, wherein the second iteration variable includes iteration variable A and iteration variable C;
[0032] The iteration variables A and C are input into the fourth preset formula for calculation to obtain the second initial receiving process of each process in step zero, wherein the fourth preset formula is: x is the current process number;
[0033] The iteration variables A and C are input into the fifth preset formula for calculation to obtain the second initial sending process of each process in step zero, wherein the fifth preset formula is: x is the current process number;
[0034] Based on the preset second communication model, the second iteration variable, and the second initial sending process, iterative calculations are performed to obtain the sending process of each step of each process;
[0035] Based on the second communication model, the second iteration variable, and the second initial receiving process, iterative calculations are performed to obtain the receiving process at each step of each process;
[0036] The second communication model includes: x i =(Ax i-1 +C)%N, Wherein, the x i For the receiving process of process x at step i, the... For process x, the sending process at step i, x i-1 For the receiving process of process x at step i-1, the... x0 is the sending process of process x at step i-1, and x0 is the second initial receiving process of process x at step zero. Let C be the second initial sending process of process x at step zero, where C is the iteration variable C, A is the iteration variable A, and N is the total number of processes.
[0037] Optionally, the step of determining the preset second iteration variable includes:
[0038] The total number of processes and the decision parameters are input into the sixth preset formula for calculation to obtain the iterative variable A, wherein the sixth preset formula is A = (b+1)%N;
[0039] A number coprime to the total number of processes is selected from the second preset interval as the iteration variable C, where the second preset interval is... N is the total number of processes, and b is the decision parameter.
[0040] Furthermore, to achieve the above objectives, the present invention also provides an apparatus comprising a memory, a processor, and an Alltoall program for Dragonfly topology stored in the memory and executable on the processor. When the Alltoall program for Dragonfly topology is executed by the processor, it implements the steps of the Alltoall method for Dragonfly topology as described above.
[0041] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing an Alltoall program for the Dragonfly topology, wherein when the Alltoall program for the Dragonfly topology is executed by a processor, it implements the steps of the Alltoall method for the Dragonfly topology as described above.
[0042] This invention first determines the total number of processes and their decision parameters on the server nodes participating in Alltoall communication. Then, based on these decision parameters, it determines the communication node object for each process at each step. At each step of each process, it receives data to be received from the sending process and sends data to be sent to the receiving process. This changes the communication mode between server nodes, distributing data evenly across the Dragonfly network and reducing link congestion in the Dragonfly topology. Furthermore, it approximately randomly shuffles the communication order between the nodes containing the processes, evenly distributing the data (communication traffic) in each round across the inter-group links of the Dragonfly topology, further alleviating link congestion in the Dragonfly topology. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the terminal / device structure of the hardware operating environment involved in the embodiments of the present invention;
[0044] Figure 2 This is a flowchart illustrating the first embodiment of the Alltoall communication method for Dragonfly topology according to the present invention;
[0045] Figure 3 This diagram illustrates a performance comparison between the Alltoall operation of this invention applicable to the Dragonfly topology and the traditional Alltoall implementation.
[0046] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0047] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0048] like Figure 1 As shown, Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of the present invention.
[0049] In this embodiment of the invention, the terminal is an Alltoall device used in the Dragonfly topology.
[0050] like Figure 1As shown, the terminal may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0051] Optionally, the terminal may also include a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, and so on. These sensors may include light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display screen according to the ambient light level, while the proximity sensor can turn off the display screen and / or backlight when the terminal device is moved to the ear. Of course, the terminal device may also be equipped with other sensors such as a gyroscope, barometer, hygrometer, thermometer, and infrared sensor, which will not be elaborated upon here.
[0052] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0053] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an Alltoall program for the Dragonfly topology.
[0054] exist Figure 1 In the terminal shown, network interface 1004 is mainly used to connect to the backend server and communicate with it; user interface 1003 is mainly used to connect to the client (user terminal) and communicate with it; while processor 1001 can call the Alltoall program for Dragonfly topology stored in memory 1005 and perform the following operations:
[0055] Reference Figure 2This invention provides an Alltoall method for Dragonfly topology, which can be an Alltoall communication method for Dragonfly topology. In a first embodiment of the Alltoall communication method for Dragonfly topology, the Alltoall communication method for Dragonfly topology includes the following steps:
[0056] Step S10: Obtain the total number of processes of the server nodes participating in the Alltoall communication based on the input parameters passed by the user.
[0057] Currently, there are other methods to alleviate link congestion in Dragonfly topology optimization aggregation communication, such as randomly mapping processes in MPI programs to nodes assigned to jobs by the scheduling system. However, random mapping degrades the performance of neighbor communication within the program. To further address this, to avoid compromising neighbor communication performance, we can assume that nodes with similar numbers have closer physical distances. By optimizing the implementation of the Alltoall operation in the MPI library, we can overcome the link congestion problem in the Dragonfly topology. This optimization is applicable to any number of nodes participating in communication within the Dragonfly topology (without imposing any restrictions on the scheduling system), and processes in the MPI program are linearly mapped to nodes assigned to jobs by the scheduling system. Specifically, in this embodiment, the optimization of the Alltoall operation implementation in the MPI library overcomes the link congestion problem in the Dragonfly topology, making it applicable to any number of nodes participating in communication within the Dragonfly topology (without imposing any restrictions on the scheduling system), and processes in the MPI program are linearly mapped to nodes assigned to jobs by the scheduling system. The nodes can be enterprise servers. Data transmission between processes can be data transmission between enterprise servers. In this embodiment, the data (such as stored data, data to be sent, and data to be received) can be communication traffic.
[0058] Furthermore, this embodiment changes the communication mode between nodes, distributing traffic evenly across the Dragonfly network to reduce congestion. In the Dragonfly topology, the number of direct links between groups is limited, especially under full configuration, where there may only be one direct link between groups. In each round of communication, it's easy for many nodes within the same group to communicate with nodes in another group, leading to significant congestion on the direct links between groups. Using the shortest route significantly reduces the bandwidth of each flow; using adaptive routing forces many data packets to take detours. Therefore, this embodiment approximately randomizes the communication order between the nodes containing the process, effectively avoiding these problems and evenly distributing the communication traffic in each round across the inter-group links of the Dragonfly topology with almost no additional overhead.
[0059] Furthermore, in this embodiment, if a process in a certain node obtains the input user-provided parameters, it parses the communication domain from the user-provided parameters and obtains the total number N of the server nodes communicating with the parameter Alltoall based on the parsing result.
[0060] Step S20: Determine the decision parameters corresponding to the Alltoall communication based on the total number of processes, and determine the communication node object for each process at each step based on the decision parameters and the preset communication model, wherein the communication node object includes the receiving process and the sending process;
[0061] In this embodiment, after determining the total number of processes, it is necessary to determine the decision parameters corresponding to the Alltoall communication. These decision parameters can serve as the basis for subsequent judgment of communication node objects. The decision parameters can be calculated based on the total number of processes.
[0062] Specifically, the step of determining the decision parameters corresponding to the Alltoall communication based on the total number of processes includes:
[0063] Determine all prime factors of the total number of processes, and calculate the first product among the prime factors;
[0064] If the total number of processes is a multiple of 4, the first product is doubled to obtain a doubled result, and the total number of processes is moduloed based on the doubled result to obtain decision parameters.
[0065] For example, if the total number of processes N = 16, its prime factor is 2 and is a multiple of 4, the decision parameter b = 4 is calculated.
[0066] However, if the total number of processes is not a multiple of 4, the decision parameter is obtained by taking the modulo of the total number of processes based on the first product. For example, if the total number of processes N = 15, and its prime factors are 3 and 5, the decision parameter b = 0 is calculated.
[0067] Once the decision parameters are determined, they need to be evaluated. If the decision parameter b is not 0, and the ratio between the total number of processes and the decision parameter is greater than or equal to 3, then the processes in each server node use the first communication model (i.e., the first preset communication model) to calculate and obtain the communication node object for each step. However, if the decision parameter b is 0, or the ratio between the total number of processes and the decision parameter is less than 3, then the processes in each server node use the second communication model (i.e., the second preset communication model) to calculate and obtain the communication node object for each step. The communication node object includes a receiving process and a sending process. The sending process sends the data required by the current process, and the receiving process receives the data sent by the current process.
[0068] Step S30: In each step of the current process, receive the data to be received sent by the sending process corresponding to the current process, and send the preset data to be sent to the receiving process corresponding to the current process.
[0069] In this embodiment, once the current process determines its corresponding receiving and sending processes, data transmission can proceed. For example, if a process on one of the servers participating in the aggregation communication receives user-input traffic data, the traffic data can be divided according to the number of processes, and each divided piece of traffic data can be sent to a process on each server node, ensuring that each process on each server node receives a portion of the input traffic data. Therefore, at each step of the current process, it can receive the data to be received from the sending process corresponding to the current process and send the data to be sent to the receiving process corresponding to the current process, until each process on each server node participating in the aggregation communication receives a portion of the traffic data. Here, the data to be received is the traffic data needed by the current process, and the data to be sent is the traffic data needed by the receiving process. For example,
[0070] For process x, in the i-th step of the N-round communication, the corresponding data is sent to process x. i and from process x / i Receive the corresponding data.
[0071] Where x∈[0, N-1], i∈[0, N-1]. Process x i For the receiving process, process x / i The process is as follows.
[0072] In addition, to aid in understanding the Alltoall communication operation process applicable to the Dragonfly topology in this embodiment, an example is provided below.
[0073] For example, if there are 16 processes participating in Alltoall communication, i.e., N=16, and their prime factors are 2 and are multiples of 4, the calculated decision quantity b=4; in this case, the decision quantity b is not 0 and The first communication model should be selected.
[0074] At this point, the available values for s are 1 and 2, corresponding to a values of 5 and 9, and c is 1. Taking a = 5 as an example, we can calculate a using fast exponentiation. / =13 and c / =3; Through iterative calculation, it can be seen that process 0 needs to send data to processes 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5, 10, 3 respectively in steps 0 to 15, and needs to receive data from processes 0, 3, 10, 5, 4, 7, 14, 9, 8, 11, 2, 13, 12, 15, 6, 1 respectively in steps 0 to 15; process 1 needs to send data to processes 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5, 10, 3, 0 respectively in steps 0 to 15, and needs to receive data from processes 1, 0, 3, 10, 5, 4, 7, 14, 9, 8, 11, 2, 13, 12 respectively in steps 0 to 15. Process 15 and 6 receive data; Process 2 sends data to processes 2, 11, 8, 9, 14, 7, 4, 5, 10, 3, 0, 1, 6, 15, 12, 13 respectively in steps 0 to 15, and receives data from processes 2, 13, 12, 15, 6, 1, 0, 3, 10, 5, 4, 7, 14, 9, 8, 11 respectively in steps 0 to 15; Process 3 sends data to processes 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5, 10 respectively in steps 0 to 15, and receives data from processes 3, 10, 5, 4, 7, 14, 9, 8, 11, 2, 13, 12, 15, 6, 1 respectively in steps 0 to 15. Process 0 receives data; Process 4 sends data to processes 4, 5, 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7 respectively in steps 0 to 15, and receives data from processes 4, 7, 14, 9, 8, 11, 2, 13, 12, 15, 6, 1, 0, 3, 10, 5 respectively in steps 0 to 15; Process 5 sends data to processes 5, 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4 respectively in steps 0 to 15, and receives data from processes 5, 4, 7, 14, 9, 8, 11, 2, 13, 12, 15, 6, 1, 0, 3, 10 respectively in steps 0 to 15. Data; Process 6 needs to send data to processes 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5, 10, 3, 0, 1 respectively in steps 0 to 15, and receive data from processes 6, 1, 0, 3, 10, 5, 4, 7, 14, 9, 8, 11, 2, 13, 12, 15 respectively in steps 0 to 15; Process 7 needs to send data to processes 7, 4, 5, 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14 respectively in steps 0 to 15, and receive data from processes 7, 14, 9, 8, 11, 2, 13, 12, 15, 6, 1, 0, 3, 10, 5, 4 respectively in steps 0 to 15.Process 8 sends data to processes 8, 9, 14, 7, 4, 5, 10, 3, 0, 1, 6, 15, 12, 13, 2, 11 respectively in steps 0 to 15, and receives data from processes 8, 11, 2, 13, 12, 15, 6, 1, 0, 3, 10, 5, 4, 7, 14, 9 respectively in steps 0 to 15; Process 9 sends data to processes 9, 14, 7, 4, 5, 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8 respectively in steps 0 to 15, and receives data from processes 9, 8, 11, 2, 13, 12, 15, 6, 1, 0, 3, 10, 5, 4, 7, 14 respectively in steps 0 to 15; Process 10 sends data to processes 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5 respectively in steps 0 to 15, and receives data from processes 10, 5, 4, 7, 14, 9, 8, 11, 2, 13, 12, 15, 6, 1, 0, 3 respectively in steps 0 to 15; Process 11 sends data to processes 11, 8, 9, 14, 7, 4, 5, 10, 3, 0, 1, 6, 15, 12, 13, 2 respectively in steps 0 to 15, and receives data from processes 11, 2, 13, 12, 15, 6, 1, 0, 3, 10, 5, 4, 7, 14, 9, 8 respectively in steps 0 to 15; Process 12 sends data to processes 12, 13, 2, 11, 8, 9, 14, 7, 4, 5, 10, 3, 0, 1, 6, 15 respectively in steps 0 to 15, and receives data from processes 12, 15, 6, 1, 0, 3, 10, 5, 4, 7, 14, 9, 8, 11, 2, 13 respectively in steps 0 to 15; Process 13 sends data to processes 13, 2, 11, 8, 9, 14, 7, 4, 5, 10, 3, 0, 1, 6, 15, 12 respectively in steps 0 to 15, and receives data from processes 13, 12, 15, 6, 1, 0, 3, 10, 5, 4, 7, 14, 9, 8, 11, 2 respectively in steps 0 to 15. Process 14 sends data to processes 14, 7, 4, 5, 10, 3, 0, 1, 6, 15, 12, 13, 2, 11, 8, and 9 respectively in steps 0 to 15, and receives data from processes 14, 9, 8, 11, 2, 13, 12, 15, 6, 1, 0, 3, 10, 5, 4, and 7 respectively in steps 0 to 15; Process 15 sends data to processes 15, 12, 13, 2, 11, 8, 9, 14, 7, 4, 5, 10, 3, 0, 1, and 6 respectively in steps 0 to 15, and receives data from processes 15, 6, 1, 0, 3, 10, 5, 4, 7, 14, 9, 8, 11, 2, 13, and 12 respectively in steps 0 to 15.
[0075] If there are 15 processes participating in Alltoall communication, i.e., N=15, with prime factors of 3 and 5, the calculated decision quantity b=0. In this case, since b=0, the second communication model should be chosen. A=1, and the available C values are 2, 4, 7, 8, and 11. Taking C=7 as an example, through iterative calculation, process 0 will send data to processes 0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, and 8 respectively in steps 0 to 14, and will receive data from processes 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, and 1 respectively in steps 0 to 14. Process 1 will send data to processes 7, 14, 6, and 13 respectively in steps 0 to 14. Process 1, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, and in steps 0 to 14, it needs to receive data from processes 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 14 respectively; Process 2 needs to send data to processes 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7 in steps 0 to 14 respectively, and needs to receive data from processes 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12 in steps 0 to 14 respectively; Process 3 needs to send data to processes 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 14 in steps 0 to 14 respectively, and Furthermore, in steps 0 to 14, process 4 receives data from processes 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, and 10 respectively; process 4 sends data to processes 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 14, and 6 respectively in steps 0 to 14, and receives data from processes 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, 10, 9, and 8 respectively in steps 0 to 14; process 5 sends data to processes 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 14, 6, and 13 respectively in steps 0 to 14, and receives data from processes 5, 4, 3, 2, 1, and 0 respectively in steps 0 to 14. Process 14, 13, 12, 11, 10, 9, 8, 7, 6 receive data; Process 6 sends data to processes 12, 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 14, 6, 13, 5 respectively in steps 0 to 14, and receives data from processes 3, 2, 1, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4 respectively in steps 0 to 14; Process 7 sends data to processes 4, 11, 3, 10, 2, 9, 1, 8, 0, 7, 14, 6, 13, 5, 12 respectively in steps 0 to 14, and receives data from processes 1, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2 respectively in steps 0 to 14.Process 8, in steps 0 to 14, sends data to processes 11, 3, 10, 2, 9, 1, 8, 0, 7, 14, 6, 13, 5, 12, 4 respectively, and receives data from processes 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 respectively; process 9, in steps 0 to 14, sends data to processes 3, 10, 2, 9, 1, 8, 0, 7, 14, 6, 13, 5 respectively. Process 12, 4, 11, and in steps 0 to 14, it receives data from processes 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13 respectively; process 10 sends data to processes 10, 2, 9, 1, 8, 0, 7, 14, 6, 13, 5, 12, 4, 11, 3 in steps 0 to 14, and in steps 0 to 14, it receives data from processes 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 respectively. Process 11 receives data from processes 14, 13, 12, and 11 respectively in steps 0 to 14; and in steps 0 to 14, process 11 sends data to processes 2, 9, 1, 8, 0, 7, 14, 6, 13, 5, 12, 4, 11, 3, and 10 respectively, and receives data from processes 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, 10, and 9 respectively; process 12 sends data to processes 9, 1, 8, and 0 respectively in steps 0 to 14. , 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, and in steps 0 to 14, respectively, data is received from processes 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, 10, 9, 8, 7; process 13 in steps 0 to 14 is to send data to processes 1, 8, 0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, and in steps 0 to 14, respectively, data is received from process 4, ;
[0076] 3, 2, 1, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5 receive data; process 14 needs to send data to processes 8, 0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1 respectively in steps 0 to 14, and needs to receive data from processes 2, 1, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3 respectively in steps 0 to 14;
[0077] If we use the CODES simulator to simulate a 44310-node Dragonfly network, we can compare the MPI_Alltoall implementation method in this invention with the traditional MPI_Alltoall implementation method: The network uses 40-port switches, with 10 ports connected to compute nodes, 20 ports connected to other switches within the group, and 10 ports connected to switches in other groups; each group has 210 compute nodes, there are 211 groups in total, for a total of 44310 compute nodes; the link bandwidth is set to 12GB / s, the inter-group link latency is 150ns, the inter-group link latency is 350ns, and the switch latency is 150ns; the simulation incorporates computation and data movement overhead.
[0078] In the Dragonfly topology network described above, a simulation of MPI_Alltoall was performed on 32768 nodes. One MPI process ran on each node, and each process needed to send and receive 128MB of data. Comparisons were made among shortest route, non-shortest route, and adaptive route. The results are as follows: Figure 3 As shown.
[0079] Simulation results show that, in shortest routing, the Alltoall implementation method suitable for Dragonfly topology improves speed by 999.58% compared to traditional methods; in adaptive routing, it improves speed by 372.85%; at the same time, it brings the performance of Alltoall in shortest routing close to that of adaptive routing, indicating that the method in this invention results in almost no link contention in the network.
[0080] This demonstrates that the Alltoall implementation method applicable to the Dragonfly topology in this invention can effectively reduce link congestion and significantly improve the speed of Alltoall aggregation communication in the Dragonfly topology.
[0081] In this embodiment, the total number of processes and their decision parameters of the server nodes participating in the Alltoall communication are first determined. Then, the communication node object for each process at each step is determined based on the decision parameters. At each step of each process, the data to be received from the sending process is received, and the data to be sent is sent to the receiving process. Furthermore, the communication order between the nodes where the processes reside is shuffled in an approximately random manner, so that the data in each round, such as communication traffic, is evenly distributed in the inter-group links of the Dragonfly topology, thus alleviating link congestion in the Dragonfly topology.
[0082] Furthermore, based on the first embodiment of the present invention described above, a second embodiment of the All-to-All communication method for Dragonfly topology is proposed. In this embodiment, the refinement of the steps for determining the communication node object for each process at each step according to the decision parameters and the preset communication model, as described in the above embodiment, includes:
[0083] If the decision parameter is not 0, and the ratio between the total number of processes and the decision parameter is greater than or equal to a preset value, then the communication node object for each process at each step is determined according to the preset first communication model.
[0084] If the decision parameter is 0, or the ratio between the total number of processes and the decision parameter is less than a preset value, then the communication node object for each step of each process is determined according to the preset second communication model, wherein the preset communication model includes the first communication model and the second communication model.
[0085] In this embodiment, when determining the communication node object, the decision parameters need to be detected so that different methods can be used to determine the communication node object of the process at each step based on different detection results. Therefore, when the decision parameter b is not equal to 0 and N / b-1≥2, that is, N / b is greater than or equal to 3, the first communication model can be selected for iterative training to determine the communication node object of each process at each step. However, if the decision parameter b is equal to 0, or N / b-1<2, that is, N / b is less than 3, the second communication model can be selected for iterative training. Here, N is the total number of processes, and the preset value can be set to 3. And the preset communication model can include the first communication model and the second communication model.
[0086] In this embodiment, by selecting different communication models based on different decision parameters, and then determining the communication node object for each process at each step based on the selected communication model, it is possible to evenly distribute the data, such as communication traffic, in each round across the inter-group links of the Dragonfly topology, thereby alleviating link congestion in the Dragonfly topology.
[0087] Specifically, the steps for determining the communication node object for each process at each step based on the preset first communication model include:
[0088] Determine the preset first iteration variable, and calculate the reverse iteration variable based on the first iteration variable;
[0089] Determine the first initial receiving process and the first initial sending process for each process at step zero;
[0090] Based on the preset first communication model, the first iteration variable, and the first initial sending process, iterative calculations are performed to obtain the receiving process at each step of each process;
[0091] Based on the first communication model, the reverse iteration variable, and the first initial receiving process, iterative calculations are performed to obtain the sending process of each step of each process.
[0092] In this embodiment, when the preset communication model is the first communication model, it is necessary to first calculate and determine the parameters for the first communication model to run, such as the first iteration variable and the reverse iteration variable. Specifically, when determining the receiving process at each step of each process, it is necessary to determine and calculate the first iteration variable and input it into the first communication model for calculation. When determining the sending process at each step of each process, it is necessary to determine and calculate the reverse iteration variable and input it into the first communication model for calculation.
[0093] Furthermore, since the communication node object for each process at each step is determined based on the communication node object from the previous step, it is necessary to first determine the communication node object for each process at step zero, such as the first initial receiving process and the first initial sending process. That is, each process calculates x0 = x. Where x is the current process number, and x0 is the communication object (i.e., the first initial receiving process) that process x sends data in step 0. Let x be the communication object that receives data in step 0 (i.e., the first initial sending process), where x∈[0,N-1].
[0094] Each process performs iterative calculations using the first communication model to obtain the receiving and sending processes at each step. The first communication model is as follows:
[0095]
[0096] Where x is the current process number. i The communication object that sends data to process x at step i (i.e., the receiving process of process x at step i). The communication object that receives data for process x in step i (i.e., the sending process of process x in step i). i-1 The communication object that sends data to process x at step i-1 (i.e., the receiving process of process x at step i-1). Let x be the communication object that receives data in step i-1 of process x (i.e., the sending process in step i-1 of process x). x ∈ [0, N-1]; i ∈ [1, N-1]. N is the total number of processes. a and c are the first iteration variables, where a... / and c / This is the variable for reverse iteration.
[0097] For example, when i = 1, the first communication model is x1 = (ax0 + c) % N.
[0098] In this embodiment, by iteratively calculating based on a preset first communication model, a first iteration variable, and a first initial sending process, the number corresponding to the receiving process is obtained, and the process with that number is taken as the receiving process. Then, by iteratively calculating based on the preset first communication model, a reverse iteration variable, and the first initial receiving process, the number corresponding to the sending process is obtained, and the process with that number is taken as the sending process. This ensures the accuracy and effectiveness of determining the receiving and sending processes.
[0099] Specifically, the first iteration variable includes iteration variable a and iteration variable c, and the step of determining the preset first iteration variable includes:
[0100] A positive integer is randomly selected from a first preset interval, and the positive integer is input into a first preset formula to calculate the iteration variable 'a', where the first preset interval is... The first preset formula is a = (bs + 1) % N, where N is the total number of processes, b is the decision parameter, s is a positive integer, and a is the iteration variable a;
[0101] Set the value of the iteration variable c to 1.
[0102] When determining the first iteration variable, since it includes iteration variable a and iteration variable c, in order to ensure the effective operation of the first communication model and reduce conflicts between links, iteration variable c can be directly set to 1. As for iteration variable a, specifically, it can be first set to a value within a first preset interval. Select a positive integer s, and input the positive integer s, decision parameter b, and total number of processes N into the first preset formula a = (bs + 1) % N for calculation to obtain the iteration variable a.
[0103] After calculating the iteration variables a and c in the first iteration variables, it is necessary to calculate the reverse iteration variable based on the iteration variable a in the first iteration variables.
[0104] Specifically, the step of calculating the reverse iteration variable based on the first iteration variable includes:
[0105] The iteration variable 'a' is input into the second preset formula to calculate the reverse iteration variable 'a'. / Wherein, the second preset formula is a / =a N-1 %N;
[0106] The iterative variable 'a' is input into the third preset formula to calculate the reverse iterative variable 'c'. / The third preset formula is:
[0107] The reverse iteration variable includes the reverse iteration variable a. / and the reverse iteration variable c / .
[0108] In this embodiment, the reverse iteration variables also include at least two, namely, the reverse iteration variable a. / and the reverse iteration variable c / Therefore, in calculating the reverse iteration variable a / At that time, the iteration variable 'a' and the total number of processes 'N' are input into the second preset formula 'a'. / =a N-1 The calculation is performed in %N to obtain the reverse iteration variable a. / Simultaneously, the iteration variable 'a' and the total number of processes 'N' are input into the third preset formula. The calculation is performed to obtain the reverse iteration variable c. / .
[0109] In this embodiment, the accuracy and effectiveness of the calculated first iteration variable and the reverse iteration variable are ensured by first determining the first iteration variable based on the decision parameters and the total number of processes, and then calculating the reverse iteration variable based on the first iteration variable.
[0110] Furthermore, the steps for determining the communication nodes for each process at each step according to the preset second communication model include:
[0111] Determine a preset second iteration variable, wherein the second iteration variable includes iteration variable A and iteration variable C;
[0112] The iteration variables A and C are input into the fourth preset formula for calculation to obtain the second initial receiving process of each process in step zero, wherein the fourth preset formula is:
[0113] The iteration variables A and C are input into the fifth preset formula for calculation to obtain the second initial sending process of each process in step zero, wherein the fifth preset formula is:
[0114] Based on the preset second communication model, the second iteration variable, and the second initial sending process, iterative calculations are performed to obtain the sending process of each step of each process;
[0115] Based on the second communication model, the second iteration variable, and the second initial receiving process, iterative calculations are performed to obtain the receiving process at each step of each process;
[0116] Where x0 is the second initial receiving process of process x in step zero, x / 0 represents the second initial sending process of process x in step zero, C is the iteration variable C, A is the iteration variable A, and N is the total number of processes.
[0117] In this embodiment, when the preset communication model is the second communication model, it is necessary to first calculate and determine the parameters for the second communication model to run, such as the second iteration variable. Specifically, when determining the receiving process at each step of each process, it is necessary to determine and calculate the second iteration variable and input it into the first communication model for calculation. When determining the sending process at each step of each process, it is necessary to determine and calculate the reverse iteration variable and input it into the second communication model for calculation.
[0118] Furthermore, since the communication node object for each process at each step is determined based on the communication node object of the previous step, it is necessary to first determine the communication node object for each process at step zero, such as the second initial receiving process and the second initial sending process.
[0119] For example, each process x uses fast exponentiation. Where x∈[0, N-1], x0 is the communication object that process x sends data in step 0; each process x solves... To get Where x∈[0,N-1], This is the communication object for process x to receive data in step 0.
[0120] Each process iteratively calculates using the second communication model to obtain the receiving and sending processes at each step. The second communication model is as follows:
[0121]
[0122] Where x is the current process number. i The communication object that sends data to process x at step i (i.e., the receiving process of process x at step i). The communication object that receives data for process x in step i (i.e., the sending process of process x in step i). i-1 The communication object (the receiving process of process x in step i-1) for sending data to process x. For process x, the communication object that receives data at step i (i.e., the sending process of process x at step i-1). And x∈[0, N-1]; i∈[1, N-1].
[0123] In this embodiment, by iteratively calculating based on a preset second communication model, a second iteration variable, and a second initial sending process, the number corresponding to the receiving process is obtained, and the process with that number is taken as the receiving process. Then, by iteratively calculating based on the preset second communication model, the second iteration variable, and the second initial receiving process, the number corresponding to the sending process is obtained, and the process with that number is taken as the sending process. This ensures the accuracy and effectiveness of determining the receiving and sending processes.
[0124] Specifically, the steps for determining the preset second iteration variable include:
[0125] The total number of processes and the decision parameters are input into the sixth preset formula for calculation to obtain the iterative variable A, wherein the sixth preset formula is A = (b+1)%N;
[0126] A number coprime to the total number of processes is selected from the second preset interval as the iteration variable C, where the second preset interval is... N is the total number of processes, and b is the decision parameter.
[0127] Since the second iteration variable includes iteration variable C and iteration variable A, after determining the total number of processes N and the decision parameter b, they can be directly input into the sixth preset formula for calculation to obtain iteration variable A. Within the specified interval, a number coprime to the total number of processes is selected as the iteration variable C. The iteration variables A and C are then input into the second communication model for calculation to determine the sending process, i.e., the server node where the sending process resides.
[0128] In this embodiment, the accuracy and effectiveness of the obtained second iteration variable are ensured by determining the second iteration variable based on the decision parameters and the total number of processes.
[0129] Furthermore, the present invention also provides an apparatus comprising: a memory, a processor, and an Alltoall program for Dragonfly topology stored in the memory; the processor is configured to execute the Alltoall program for Dragonfly topology to implement the steps of the various embodiments of the Alltoall method for Dragonfly topology described above.
[0130] The present invention also provides a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the steps of the various embodiments of the Alltoall method for Dragonfly topology described above.
[0131] The specific implementation of the computer-readable storage medium of the present invention is basically the same as the various embodiments of the Alltoall method for Dragonfly topology described above, and will not be repeated here.
[0132] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0133] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0135] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. An Alltoall method for Dragonfly topology, characterized in that, The Alltoall method for Dragonfly topology includes the following steps: The total number of processes on the server nodes participating in the Alltoall communication is obtained based on the user-input parameters. The decision parameters corresponding to the Alltoall communication are determined based on the total number of processes. The communication node object for each process at each step is determined based on the decision parameters and the preset communication model. The communication node object includes the receiving process and the sending process. At each step of the current process, receive the data to be received sent by the sending process corresponding to the current process, and send the preset data to be sent to the receiving process corresponding to the current process; The step of determining the communication node object for each process at each step based on the decision parameters and the preset communication model includes: If the decision parameter is not 0, and the ratio between the total number of processes and the decision parameter is greater than or equal to a preset value, then the communication node object for each process at each step is determined according to the preset first communication model. If the decision parameter is 0, or the ratio between the total number of processes and the decision parameter is less than a preset value, then the communication node object for each step of each process is determined according to the preset second communication model, wherein the preset communication model includes the first communication model and the second communication model.
2. The Alltoall method for Dragonfly topology as described in claim 1, characterized in that, The step of determining the decision parameters corresponding to the Alltoall communication based on the total number of processes includes: Determine all prime factors of the total number of processes, and calculate the first product among the prime factors; If the total number of processes is a multiple of 4, the first product is doubled to obtain a doubled result, and the total number of processes is moduloed based on the doubled result to obtain decision parameters.
3. The Alltoall method for Dragonfly topology as described in claim 1, characterized in that, The step of determining the communication node object for each process at each step according to the preset first communication model includes: Determine the preset first iteration variable, and calculate the reverse iteration variable based on the first iteration variable; Determine the first initial receiving process and the first initial sending process for each process at step zero; Based on the preset first communication model, the first iteration variable, and the first initial sending process, iterative calculations are performed to obtain the receiving process at each step of each process; Based on the first communication model, the reverse iteration variable, and the first initial receiving process, iterative calculations are performed to obtain the sending process of each step of each process; The first communication model includes: , , wherein For the receiving process of process x at step i, the... For the sending process of process x at step i, the... For the receiving process of process x at step i-1, the... For process x, the sending process at step i-1, where a and c are the first iteration variables, the... and N is the total number of processes, which is the variable used for reverse iteration.
4. The Alltoall method for Dragonfly topology as described in claim 3, characterized in that, The first iteration variable includes iteration variable a and iteration variable c. The step of determining the preset first iteration variable includes: A positive integer is randomly selected from a first preset interval, and the positive integer is input into a first preset formula to calculate the iteration variable 'a', where the first preset interval is... The first preset formula is a = (bs + 1) % N, where N is the total number of processes, b is the decision parameter, s is a positive integer, and a is the iteration variable a; Set the value of the iteration variable c to 1.
5. The Alltoall method for Dragonfly topology as described in claim 3, characterized in that, The step of calculating the reverse iteration variable based on the first iteration variable includes: The iterative variable 'a' is input into the second preset formula to calculate the reverse iterative variable. Wherein, the second preset formula is ; The iterative variable 'a' is input into the third preset formula to calculate the reverse iterative variable. The third preset formula is: ; Wherein, the reverse iteration variable includes the reverse iteration variable and reverse iteration variables .
6. The Alltoall method for Dragonfly topology as described in claim 1, characterized in that, The step of determining the communication node for each process at each step according to the preset second communication model includes: Determine a preset second iteration variable, wherein the second iteration variable includes iteration variable A and iteration variable C; The iteration variables A and C are input into the fourth preset formula for calculation to obtain the second initial receiving process of each process in step zero, wherein the fourth preset formula is: , where x is the current process number; The iteration variables A and C are input into the fifth preset formula for calculation to obtain the second initial sending process of each process in step zero, wherein the fifth preset formula is: , where x is the current process number; Based on the preset second communication model, the second iteration variable, and the second initial sending process, iterative calculations are performed to obtain the sending process of each step of each process; Iterative calculations are performed based on the second communication model, the second iteration variable, and the second initial receiving process to obtain the receiving process at each step of each process; The second communication model includes: , , wherein For the receiving process of process x at step i, the... For the sending process of process x at step i, the... For the receiving process of process x at step i-1, the... For the sending process of process x at step i-1, the... For process x, the second initial receiving process in step zero, the Let C be the second initial sending process of process x at step zero, where C is the iteration variable C, A is the iteration variable A, and N is the total number of processes.
7. The Alltoall method for Dragonfly topology as described in claim 6, characterized in that, The step of determining the preset second iteration variable includes: The total number of processes and the decision parameters are input into the sixth preset formula for calculation to obtain the iterative variable A, wherein the sixth preset formula is A = (b+1)%N; A number coprime to the total number of processes is selected from the second preset interval as the iteration variable C, where the second preset interval is... N is the total number of processes, and b is the decision parameter.
8. A device, characterized in that, The device includes: a memory, a processor, and an Alltoall program for Dragonfly topology stored in the memory and executable on the processor, wherein the Alltoall program for Dragonfly topology, when executed by the processor, implements the steps of the Alltoall method for Dragonfly topology as claimed in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an Alltoall program for the Dragonfly topology, which, when executed by a processor, implements the steps of the Alltoall method for the Dragonfly topology as claimed in any one of claims 1 to 7.