Collective communication method and communication device
By transmitting messages carrying process and network device information between terminal devices and network devices and planning short-distance communication paths, the problem of long communication paths under the Fat-tree networking architecture is solved, saving resource overhead.
Patent Information
- Application Number
- CN202110387422.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-09
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-04-09
AI Technical Summary
In the Fat-tree networking architecture, terminal devices cannot perceive the location of the destination terminal device in the network topology, resulting in long communication paths and high resource overhead.
By transmitting messages carrying process and network device information between terminal devices and network devices, the terminal devices aggregate the information to generate a third message, plan short-range communication paths, and reduce communication paths across network devices.
It achieves short-range communication, saves resource overhead, and avoids the additional Netloc library deployment work.
Smart Images

Figure CN115208964B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a collective communication method and a communication device. Background Art
[0002] Collective communication refers to a communication method in which all processes in a specific group participate. Under the Fat-tree networking architecture, taking the example that the child nodes of the second network device (such as a core (spine) switch) include a first network device (such as an access (leaf) switch) and a third network device (such as an access switch), and the child nodes of the first network device and the third network device each include four terminal devices, a process is deployed on each terminal device, and different processes are deployed on different terminal devices. Different processes correspond to different ranks. In order to complete a global reduction (allreduce), some collective communication algorithms (such as recursive doubling algorithms) require each terminal device to perform three communications with other terminal devices, and the source terminal device and destination terminal device involved in each communication are determined based on the process number.
[0003] However, the source terminal device cannot perceive the location of the destination terminal device in the network topology, and may communicate multiple times across the second network device. In this case, the communication path between the two terminal devices is long and the resource overhead is high. Summary of the Invention
[0004] The embodiments of the present application provide a collective communication method and a communication device, which can determine and reduce the number of long communication paths and save resource overhead.
[0005] To achieve the above objectives, the present invention adopts the following technical solutions:
[0006] In the first aspect, an embodiment of the present application provides a method for collective communication, wherein the execution subject of the method can be a first terminal device or a chip applied to the first terminal device. The following description is made by taking the execution subject being the first terminal device as an example. The method includes: the first terminal device receives at least one second message from the first network device. The second message includes information about the first process and information about the network device corresponding to the first process, the first process is used to perform the first task, and the information about the network device corresponding to the first process is information about the network device to which the terminal device where the first process is located belongs. Then, the first terminal device determines a third message based on the at least one second message. The third message includes information about the target network device and information about all first processes that perform the first task corresponding to the target network device, and the target network device is at least one of the network devices corresponding to the first task. Afterwards, the first terminal device sends the third message to the first network device.
[0007] That is to say, the second message received by the first terminal device carries both the information of the first process and the information of the network device corresponding to the first process. The first terminal device summarizes the second message to obtain a third message. Then, the first terminal device sends a third message. Since the third message includes at least the information of a target network device and the information of all first processes that execute the first task corresponding to the target network device, for terminal devices belonging to the same network device, each terminal device can know all first processes that execute the first task corresponding to the target network device, thereby planning communication paths, realizing short-range communication, minimizing the communication path across the second network device, and saving resource overhead. In addition, the above-mentioned first network device and the first terminal device do not need to support other protocols, and the first terminal device does not need to deploy the Netloc library, and no additional Netloc library deployment work is introduced.
[0008] In one possible design, the target network devices are all network devices corresponding to the first task. The first terminal device determines the third message based on the at least one second message, including: when the number of the at least one second message is a target value, the first terminal device determines the third message based on the at least one second message. The target value indicates the number of all terminal devices where the first process executing the first task is located.
[0009] That is, the first terminal device generates the third message only when it determines that all the second messages have arrived, so that the third message carries information of all the first processes executing the first task.
[0010] In one possible design, the target network device is one of the network devices corresponding to the first task; and the first terminal device determines the third message based on the at least one second message, including: when the number of the at least one second message is a target value, the first terminal device determines the third message based on the target message in the at least one second message. The target value indicates the number of all terminal devices where the first process executing the first task is located, and the target message belongs to the at least one second message and carries information about the same target network device.
[0011] That is, when the first terminal device determines that all second messages have arrived, it generates a third message based on the target message in the second message that carries information about the same target network device. In this case, a third message carries information about all first processes executing the first task deployed on terminal devices belonging to a certain target network device.
[0012] In one possible design, the third message also includes first information, the first information including at least one quantity value, the number of quantity values being consistent with the number of target network devices and corresponding one-to-one. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process executing the first task, the first quantity value being one of the at least one quantity value, and the terminal devices in the terminal device set belonging to the target network device corresponding to the first quantity value.
[0013] That is, in the third message, the first quantity value indicates the number of terminal devices on which the first process is deployed among the terminal devices belonging to a certain target network device.
[0014] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message, thereby indicating the message type of the third message.
[0015] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0016] In one possible design, the second message also includes third information, which indicates that the second message includes information about the network device corresponding to the first process, so that the first terminal device knows that the second message carries information about the network device corresponding to the first process.
[0017] In one possible design, the third information includes the second field in the second message, and the value of the second field in the second message is a second preset value.
[0018] In one possible design, the second message also includes fourth information, and the fourth information indicates that the type of the second message is a query message, thereby indicating the message type of the second message.
[0019] In one possible design, the fourth information includes the first field in the second message, and the value of the first field in the second message is a third preset value.
[0020] In one possible design, the third message satisfies the protocol format of Remote Direct Memory Access (RoCE) over Converged Ethernet. That is, the third message can be transmitted using the RoCE protocol format.
[0021] In one possible design, the second message satisfies the RoCE protocol format. That is, the second message can be transmitted using the RoCE protocol format.
[0022] In a second aspect, an embodiment of the present application provides a method for collective communication, wherein the execution subject of the method may be a first network device or a chip applied to the first network device. The following description is made using the execution subject being the first network device as an example. The method comprises: the first network device sends at least one second message to the first terminal device. The second message comprises information about the first process and information about the network device corresponding to the first process, the first process being used to perform the first task, and the information about the network device corresponding to the first process being information about the network device to which the terminal device where the first process is located belongs. The first network device receives a third message from the first terminal device. The third message comprises information about the target network device and information about all first processes performing the first task corresponding to the target network device, the target network device being at least one of the network devices corresponding to the first task. The first network device sends the third message to the target terminal device. The target terminal device is deployed with the first process performing the first task, and the target terminal device belongs to the target network device.
[0023] That is to say, the second message provided by the first network device to the first terminal device carries both the information of the first process and the information of the network device corresponding to the first process, so that the first terminal device generates a third message. Then, the first network device receives the third message from the first terminal device and forwards it to the corresponding target terminal device. Since the third message includes at least the information of one target network device and the information of all first processes that execute the first task corresponding to the target network device, for terminal devices belonging to the same network device, each terminal device can obtain the information of all first processes that execute the first task corresponding to the target network device, thereby planning the communication path, realizing short-range communication, minimizing the communication path across the second network device, and saving resource overhead. In addition, the above-mentioned first network device and the first terminal device do not need to support other protocols, and the terminal device does not need to deploy the Netloc library, and no additional Netloc library deployment work is introduced.
[0024] In one possible design, the third message also includes first information, the first information including at least one quantity value, and the number of quantity values is consistent with the number of target network devices and corresponds one-to-one. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the target network device corresponding to the first quantity value.
[0025] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message.
[0026] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0027] In one possible design, when the target network device includes a first network device, the collective communication method of an embodiment of the present application further includes: the first network device receiving a first message from a second terminal device. The first message includes information about the first process, and the second terminal device is a target terminal device. The first network device determines the second message based on the first message.
[0028] That is, the second message is generated by the first network device, that is, the first network device adds its own information to the first message to generate the second message.
[0029] In one possible design, the first network device determines the second message based on the first message, including: if a preset condition is met, the first network device determines the second message based on the first message. The preset condition includes: the first message type is a target type, and the first message includes fifth information, the fifth information indicating that the first message does not carry information about the network device corresponding to the first process. The target type may be a query message.
[0030] That is, only when the first message belongs to the target type and the first message does not carry the information of the network device corresponding to the first process, the first network device generates the second message based on the first message.
[0031] In one possible design, the fifth information includes the second field in the first message, and the value of the second field in the first message is a fourth preset value.
[0032] In one possible design, the first message also includes sixth information, where the sixth information indicates that the type of the first message is a query message, thereby indicating the message type of the first message.
[0033] In one possible design, the sixth information includes the first field in the first message, and the value of the first field in the first message is a third preset value.
[0034] In one possible design, when the target network device includes a first network device, the method for collective communication in the embodiment of the present application further includes: the first network device receiving a second message from a second terminal device, wherein the second terminal device belongs to the target terminal device.
[0035] That is, for a second terminal device belonging to a first network device, if the second terminal device has learned the information of the network device corresponding to the first process, the first network device obtains a second message from the second terminal device, and the second message carries both the information of the first process and the information of the network device corresponding to the first process. The first network device only needs to forward the second message without processing the second message.
[0036] In one possible design, when the target network device includes a third network device, the method for collective communication in the embodiment of the present application further includes: the first network device receiving a second message from the second network device, wherein the third network device belongs to the second network device.
[0037] That is, for a terminal device belonging to a third network device, once it has learned the information of the network device corresponding to the first process (i.e., the third network device), the first network device obtains the second message through the second network device. The second message carries both the information of the first process and the information of the network device corresponding to the first process. The first network device only needs to forward the second message without processing it.
[0038] In one possible design, the second message also includes third information, wherein the third information indicates that the second message includes information about the network device corresponding to the first process, so that the first terminal device can quickly know whether the second message carries the information about the network device.
[0039] In one possible design, the third information includes the second field in the second message, and the value of the second field in the second message is a second preset value.
[0040] In one possible design, the second message also includes fourth information, and the fourth information indicates that the type of the second message is a query message, so as to indicate the message type of the second message.
[0041] In one possible design, the fourth information includes the first field in the second message, and the value of the first field in the second message is a third preset value.
[0042] In a possible design, the third message meets the protocol format of Remote Direct Memory Access (RoCE) of Converged Ethernet.
[0043] In one possible design, the second message complies with the RoCE protocol format.
[0044] On the third aspect, an embodiment of the present application provides a method for collective communication, wherein the execution subject of the method can be a third network device or a chip applied to the third network device. The following description is made using the execution subject being the third network device as an example. The method includes: the third network device sends at least one second message to the second network device. The second message includes information about the first process and information about the third network device. The first process is deployed on a third terminal device, the third terminal device belongs to the third network device, and the first process is used to perform a first task. Then, the third network device receives a third message from the second network device. The third message includes at least information about the third network device and information about all first processes that perform the first task corresponding to the third network device. Afterwards, the third network device sends a third message to the third terminal device.
[0045] That is, if the third terminal device belongs to a third network device and the first process is deployed on each of the third terminal devices, the second message provided by the third network device to the second network device carries both information about the first process and information about the third network device, causing the first terminal device to generate a third message. The third network device then receives the third message from the second network device and forwards it to the third terminal device. Because the third message includes at least information about the third network device and information about all first processes executing the first task corresponding to the third network device, the third terminal device can obtain information about all first processes executing the first task corresponding to the third network device, thereby planning a communication path and achieving close-range communication, minimizing communication paths across the second network device and saving resource overhead. Furthermore, in the above process, if a third terminal device does not have the first process deployed, the above steps are not performed on that third terminal device, thus avoiding wasting transmission resources. Furthermore, the third network device, the second network device, and the third terminal device do not need to support other protocols, and the third terminal device does not need to deploy the Netloc library, eliminating the need for additional Netloc library deployment.
[0046] In one possible design, the third message also includes information about the target network device and information about all first processes executing the first task corresponding to the target network device. The target network device is all network devices corresponding to the first task except the third network device.
[0047] That is to say, in addition to the third terminal device, there are other terminal devices deployed with the first process executing the first task, and these terminal devices belong to other target network devices. The third message can also carry information of other target network devices and information of all first processes executing the first task corresponding to the target network devices, so that the third terminal device can know the distribution status of all first processes corresponding to the first task in the network topology.
[0048] In one possible design, the third message also includes first information, the first information including at least one quantity value, and the number of quantity values is consistent with the number of network devices corresponding to the first task, and has a one-to-one correspondence. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the network device corresponding to the first quantity value.
[0049] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message.
[0050] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0051] In one possible design, the method for collective communication in an embodiment of the present application further includes: a third network device receiving a first message from a third terminal device. The first message includes information about the first process. Then, the third network device determines the second message based on the first message.
[0052] That is, the second message is generated by the third network device, that is, the third network device adds its own information to the first message to generate the second message.
[0053] In one possible design, the third network device determines the second message based on the first message, including: if a preset condition is met, the third network device determines the second message based on the first message. The preset condition includes: the first message type is a target type, and the first message includes fifth information. The fifth information indicates that the first message does not carry information about the third network device.
[0054] That is, only when the first message belongs to the target type and the first message does not carry the information of the third network device, the third network device generates the second message based on the first message.
[0055] In one possible design, the fifth information includes the second field in the first message, and the value of the second field in the first message is a fourth preset value.
[0056] In one possible design, the first message also includes sixth information, and the sixth information indicates that the type of the first message is a query message.
[0057] In one possible design, the sixth information includes the first field in the first message, and the value of the first field in the first message is a third preset value.
[0058] In one possible design, the collective communication method of an embodiment of the present application further includes: a third network device receiving a second message from a third terminal device. That is, the third network device obtains the second message from the third terminal device, and the second message carries both information about the first process and information about the third network device. The third network device simply forwards the second message without processing the second message.
[0059] In one possible design, the second message further includes third information, wherein the third information indicates that the second message includes information about a third network device, so that the third network device can quickly learn whether the second message carries the information about the third network device.
[0060] In one possible design, the third information includes the second field in the second message, and the value of the second field in the second message is a second preset value.
[0061] In one possible design, the second message also includes fourth information, and the fourth information indicates that the type of the second message is a query message.
[0062] In one possible design, the fourth information includes the first field in the second message, and the value of the first field in the second message is a third preset value.
[0063] In one possible design, the third message satisfies the protocol format of Remote Direct Memory Access (RoCE) over Converged Ethernet. That is, the third message can be transmitted using the RoCE protocol format.
[0064] In one possible design, the second message satisfies the RoCE protocol format. That is, the second message can be transmitted using the RoCE protocol format.
[0065] In a fourth aspect, an embodiment of the present application provides a method for collective communication, wherein the execution subject of the method may be a fourth terminal device or a chip applied to the fourth terminal device. The following description is made using the fourth terminal device as an example. The method includes: the fourth terminal device sends a first message to a fourth network device. The first message includes at least information about a first process, the first process is deployed on the fourth terminal device, and the first process is used to perform a first task. Then, the fourth terminal device receives a third message from the fourth network device. The third message includes at least information about the fourth network device and information about all first processes that perform the first task corresponding to the fourth network device.
[0066] That is to say, when the fourth terminal device sends the first message to the fourth network device, the first message carries at least the information of the first process, so that the first terminal device summarizes the information of the first process, thereby generating a third message. Then, the fourth terminal device receives the third message from the fourth network device to at least obtain the information belonging to the fourth network device and the information of all the first processes that perform the first task corresponding to the fourth network device, so that the fourth terminal device can plan the communication path, realize short-range communication, minimize the communication path across the second network device, and save resource overhead. Moreover, in the above process, if a fourth terminal device does not deploy the first process, the fourth terminal device does not execute the above steps to avoid wasting transmission resources. In addition, the above-mentioned fourth network device and the fourth terminal device do not need to support other protocols, and the fourth terminal device does not need to deploy the Netloc library, and no additional Netloc library deployment work is introduced.
[0067] In one possible design, the third message also includes information about a fifth network device and information about all first processes executing the first task corresponding to the fifth network device. The fifth network device is all network devices corresponding to the first task except the fourth network device.
[0068] That is, in addition to the fourth terminal device, there are other first processes deployed on terminal devices belonging to the fifth network device. In this case, the third message can also carry information about the fifth network device and information about all first processes executing the first task corresponding to the fifth network device, so that the fourth terminal device can know the distribution status of all first processes corresponding to the first task in the network topology.
[0069] In one possible design, the third message also includes first information, the first information including at least one quantity value, and the number of quantity values is consistent with the number of network devices corresponding to the first task, and has a one-to-one correspondence. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the network device corresponding to the first quantity value.
[0070] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message.
[0071] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0072] In one possible design, the first message includes fifth information, and the fifth information indicates that the first message does not carry information of the fourth network device.
[0073] In one possible design, the fifth information includes the second field in the first message, and the value of the second field in the first message is a fourth preset value.
[0074] In one possible design, the first message also includes information about the fourth network device.
[0075] In one possible design, the first message also includes sixth information, and the sixth information indicates that the type of the first message is a query message.
[0076] In one possible design, the sixth information includes the first field in the first message, and the value of the first field in the first message is a third preset value.
[0077] In one possible design, the third message satisfies the protocol format of Remote Direct Memory Access (RoCE) over Converged Ethernet. That is, the third message can be transmitted using the RoCE protocol format.
[0078] In one possible design, the first message satisfies the RoCE protocol format. That is, the first message can be transmitted using the RoCE protocol format.
[0079] In a fifth aspect, an embodiment of the present application provides a communication device, which may be the first terminal device in the first aspect or any possible design of the first aspect, or a device provided in the first terminal device, or a chip that implements the functions of the first terminal device; the communication device includes a module, unit, or means corresponding to the above method, which may be implemented by hardware, software, or hardware executing the corresponding software implementation. The hardware or software includes one or more modules or units corresponding to the above functions.
[0080] The communication device includes a sending unit, a receiving unit, and a processing unit. The receiving unit is configured to receive at least one second message from a first network device. The second message includes information about a first process and information about a network device corresponding to the first process. The first process is configured to execute a first task. The information about the network device corresponding to the first process is information about the network device to which the terminal device where the first process is located belongs. The processing unit is configured to determine a third message based on the at least one second message. The third message includes information about a target network device and information about all first processes executing the first task corresponding to the target network device. The target network device is at least one of the network devices corresponding to the first task. The sending unit is configured to send the third message to the first network device.
[0081] In one possible design, the target network devices are all network devices corresponding to the first task. The processing unit is specifically configured to: determine a third message based on the at least one second message when the number of the at least one second message is a target value. The target value indicates the number of all terminal devices where the first process executing the first task is located.
[0082] In one possible design, the target network device is one of the network devices corresponding to the first task. The processing unit is specifically configured to, when the number of the at least one second message reaches a target value, determine a third message based on the target message in the at least one second message. The target value indicates the number of all terminal devices where the first process executing the first task is located, and the target message belongs to the at least one second message and carries information about the same target network device.
[0083] In one possible design, the third message also includes first information, the first information including at least one quantity value, and the number of quantity values is consistent with the number of target network devices and corresponds one-to-one. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the target network device corresponding to the first quantity value.
[0084] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message.
[0085] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0086] In one possible design, the second message also includes third information, and the third information indicates that the second message includes information of the network device corresponding to the first process.
[0087] In one possible design, the third information includes the second field in the second message, and the value of the second field in the second message is a second preset value.
[0088] In one possible design, the second message also includes fourth information, and the fourth information indicates that the type of the second message is a query message.
[0089] In one possible design, the fourth information includes the first field in the second message, and the value of the first field in the second message is a third preset value.
[0090] In a possible design, the third message meets the protocol format of Remote Direct Memory Access (RoCE) of Converged Ethernet.
[0091] In one possible design, the second message complies with the RoCE protocol format.
[0092] In a sixth aspect, an embodiment of the present application provides a communication device, which may be the first network device in the second aspect or any possible design of the second aspect, or a device provided in the first network device, or a chip that implements the functions of the first network device; the communication device includes a module, unit, or means corresponding to the above method, which may be implemented by hardware, software, or hardware executing the corresponding software implementation. The hardware or software includes one or more modules or units corresponding to the above functions.
[0093] The communication device includes a sending unit and a receiving unit. The sending unit is used to send at least one second message to the first terminal device. The second message includes information about the first process and information about the network device corresponding to the first process. The first process is used to perform the first task. The information about the network device corresponding to the first process is the information about the network device to which the terminal device where the first process is located belongs. The receiving unit is used to receive a third message from the first terminal device. The third message includes information about the target network device and information about all first processes that perform the first task corresponding to the target network device. The target network device is at least one of the network devices corresponding to the first task. The sending unit is also used to send a third message to the target terminal device. The target terminal device is deployed with the first process that performs the first task, and the target terminal device belongs to the target network device.
[0094] In one possible design, the third message also includes first information, the first information including at least one quantity value, and the number of quantity values is consistent with the number of target network devices and corresponds one-to-one. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the target network device corresponding to the first quantity value.
[0095] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message.
[0096] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0097] In one possible design, when the target network device includes a first network device, the receiving unit is further configured to receive a first message from a second terminal device. The first message includes information about the first process, and the second terminal device is a target terminal device. The communication apparatus further includes a processing unit configured to determine the second message based on the first message.
[0098] In one possible design, the processing unit is specifically configured to: determine, based on the first message, the second message when a preset condition is satisfied. The preset condition includes: the first message being of a target type, and the first message including fifth information indicating that the first message does not carry information about the network device corresponding to the first process.
[0099] In one possible design, the fifth information includes the second field in the first message, and the value of the second field in the first message is a fourth preset value.
[0100] In one possible design, the first message also includes sixth information, and the sixth information indicates that the type of the first message is a query message.
[0101] In one possible design, the sixth information includes the first field in the first message, and the value of the first field in the first message is a third preset value.
[0102] In a possible design, when the target network device includes the first network device, the receiving unit is further configured to receive a second message from a second terminal device, wherein the second terminal device belongs to the target terminal device.
[0103] In one possible design, when the target network device includes a third network device, the receiving unit is further configured to receive a second message from the second network device, wherein the third network device belongs to the second network device.
[0104] In one possible design, the second message further includes third information, wherein the third information indicates that the second message includes information about the network device corresponding to the first process.
[0105] In one possible design, the third information includes the second field in the second message, and the value of the second field in the second message is a second preset value.
[0106] In one possible design, the second message also includes fourth information, and the fourth information indicates that the type of the second message is a query message.
[0107] In one possible design, the fourth information includes the first field in the second message, and the value of the first field in the second message is a third preset value.
[0108] In a possible design, the third message meets the protocol format of Remote Direct Memory Access (RoCE) of Converged Ethernet.
[0109] In one possible design, the second message complies with the RoCE protocol format.
[0110] In a seventh aspect, an embodiment of the present application provides a communication device, which may be the third network device in the third aspect or any possible design of the third aspect, or a device provided in the third network device, or a chip that implements the functions of the third network device; the communication device includes a module, unit, or means corresponding to the above method, which may be implemented by hardware, software, or hardware executing the corresponding software implementation. The hardware or software includes one or more modules or units corresponding to the above functions.
[0111] The communication device includes a sending unit and a receiving unit. The sending unit is configured to send at least one second message to a second network device. The second message includes information about a first process and information about the communication device. The first process is deployed on a third terminal device, the third terminal device belongs to the communication device, and the first process is configured to perform a first task. The receiving unit is configured to receive a third message from the second network device. The third message includes at least information about the communication device and information about all first processes corresponding to the communication device that are performing the first task. The sending unit is further configured to send the third message to the third terminal device.
[0112] In one possible design, the third message also includes information about the target network device and information about all first processes executing the first task corresponding to the target network device. The target network device is all network devices except the communication device among the network devices corresponding to the first task.
[0113] In one possible design, the third message also includes first information, the first information including at least one quantity value, and the number of quantity values is consistent with the number of network devices corresponding to the first task, and has a one-to-one correspondence. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the network device corresponding to the first quantity value.
[0114] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message.
[0115] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0116] In one possible design, the receiving unit is further configured to receive a first message from a third terminal device, wherein the first message includes information about the first process. The processing unit is further configured to determine the second message based on the first message.
[0117] In one possible design, the processing unit is specifically configured to: determine the second message based on the first message when a preset condition is satisfied. The preset condition includes: the type of the first message is a target type, and the first message includes fifth information. The fifth information indicates that the first message does not carry information about the communication device.
[0118] In one possible design, the fifth information includes the second field in the first message, and the value of the second field in the first message is a fourth preset value.
[0119] In one possible design, the first message also includes sixth information, and the sixth information indicates that the type of the first message is a query message.
[0120] In one possible design, the sixth information includes the first field in the first message, and the value of the first field in the first message is a third preset value.
[0121] In one possible design, the receiving unit is further used to receive a second message from a third terminal device.
[0122] In one possible design, the second message further includes third information, wherein the third information indicates that the second message includes information about the communication device.
[0123] In one possible design, the third information includes the second field in the second message, and the value of the second field in the second message is a second preset value.
[0124] In one possible design, the second message also includes fourth information, and the fourth information indicates that the type of the second message is a query message.
[0125] In one possible design, the fourth information includes the first field in the second message, and the value of the first field in the second message is a third preset value.
[0126] In a possible design, the third message meets the protocol format of Remote Direct Memory Access (RoCE) of Converged Ethernet.
[0127] In one possible design, the second message complies with the RoCE protocol format.
[0128] In an eighth aspect, an embodiment of the present application provides a communication device, which may be the fourth terminal device in the fourth aspect or any possible design of the fourth aspect, or a device provided in the fourth terminal device, or a chip that implements the functions of the fourth terminal device; the communication device includes a module, unit, or means corresponding to the above method, which may be implemented by hardware, software, or hardware executing the corresponding software implementation. The hardware or software includes one or more modules or units corresponding to the above functions.
[0129] The communication device includes a sending unit, a receiving unit, and a processing unit. The sending unit is configured to send a first message to a fourth network device. The first message includes at least information about a first process deployed on the communication device and configured to execute a first task. The receiving unit is configured to receive a third message from the fourth network device. The third message includes at least information about the fourth network device and information about all first processes executing the first task corresponding to the fourth network device. The processing unit is configured to determine the first message.
[0130] In one possible design, the third message also includes information about a fifth network device and information about all first processes executing the first task corresponding to the fifth network device. The fifth network device is all network devices corresponding to the first task except the fourth network device.
[0131] In one possible design, the third message also includes first information, the first information including at least one quantity value, and the number of quantity values is consistent with the number of network devices corresponding to the first task, and has a one-to-one correspondence. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the network device corresponding to the first quantity value.
[0132] In one possible design, the third message also includes second information, and the second information indicates that the type of the third message is a notification message.
[0133] In one possible design, the second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
[0134] In one possible design, the first message includes fifth information, and the fifth information indicates that the first message does not carry information of the fourth network device.
[0135] In one possible design, the fifth information includes the second field in the first message, and the value of the second field in the first message is a fourth preset value.
[0136] In one possible design, the first message also includes information about the fourth network device.
[0137] In one possible design, the first message also includes sixth information, and the sixth information indicates that the type of the first message is a query message.
[0138] In one possible design, the sixth information includes the first field in the first message, and the value of the first field in the first message is a third preset value.
[0139] In a possible design, the third message meets the protocol format of Remote Direct Memory Access (RoCE) of Converged Ethernet.
[0140] In one possible design, the first message complies with the RoCE protocol format.
[0141] In a ninth aspect, embodiments of the present application provide a communication device, comprising: a processor and a memory; the memory being configured to store computer instructions, such that when the processor executes the instructions, the communication device executes the method executed by the first terminal device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communication device may be the first terminal device in the aforementioned first aspect or any possible design of the first aspect, or a chip implementing the functions of the aforementioned first terminal device.
[0142] In a tenth aspect, embodiments of the present application provide a communications device, comprising: a processor; the processor being coupled to a memory and configured to read and execute instructions in the memory, so that the communications device performs a method as performed by a first terminal device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communications device may be the first terminal device in the aforementioned first aspect or any possible design of the first aspect, or a chip that implements the functions of the aforementioned first terminal device.
[0143] In an eleventh aspect, an embodiment of the present application provides a chip comprising a logic circuit and an input / output interface. The input / output interface is used to communicate with a module outside the chip. For example, the chip may be a chip that implements the first terminal device function described in the first aspect or any possible design of the first aspect. The input / output interface outputs a third message. The input / output interface inputs a second message. The logic circuit is used to execute a computer program or instructions to implement the method described in the first aspect or any possible design of the first aspect.
[0144] In a twelfth aspect, embodiments of the present application provide a communication device, comprising: a processor and a memory; the memory being configured to store computer instructions, such that when the processor executes the instructions, the communication device executes the method performed by the first network device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communication device may be the first network device in any of the aforementioned second aspects or any possible designs of the second aspect, or a chip implementing the functions of the aforementioned first network device.
[0145] In a thirteenth aspect, embodiments of the present application provide a communication device, comprising: a processor; the processor being coupled to a memory and configured to read and execute instructions in the memory, so that the communication device performs a method as performed by a first network device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communication device may be the first network device in any of the aforementioned second aspects or any possible designs of the second aspect, or a chip that implements the functions of the first network device.
[0146] In a fourteenth aspect, an embodiment of the present application provides a chip comprising a logic circuit and an input / output interface. The input / output interface is used to communicate with a module outside the chip. For example, the chip may be a chip implementing the first network device function described in the second aspect or any possible design of the second aspect. The input / output interface outputs a second message and a third message. The input / output interface inputs a third message. The logic circuit is used to execute a computer program or instruction to implement the method described in the second aspect or any possible design of the second aspect.
[0147] In a fifteenth aspect, embodiments of the present application provide a communication device, comprising: a processor and a memory; the memory being configured to store computer instructions, such that when the processor executes the instructions, the communication device executes the method performed by the third network device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communication device may be the third network device in any of the aforementioned third aspects or any possible designs of the third aspects, or a chip implementing the functions of the aforementioned third network device.
[0148] In a sixteenth aspect, embodiments of the present application provide a communication device, comprising: a processor; the processor being coupled to a memory and configured to read and execute instructions in the memory, so that the communication device performs a method as performed by a third network device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communication device may be the third network device in any of the aforementioned third aspects or any possible designs of the third aspect, or a chip that implements the functionality of the third network device.
[0149] In a seventeenth aspect, an embodiment of the present application provides a chip comprising a logic circuit and an input / output interface. The input / output interface is used to communicate with a module outside the chip. For example, the chip may be a chip implementing the third network device function described in the third aspect or any possible design of the third aspect. The input / output interface outputs a second message and a third message. The input / output interface inputs the third message. The logic circuit is used to execute a computer program or instructions to implement the method described in the third aspect or any possible design of the third aspect.
[0150] In an eighteenth aspect, embodiments of the present application provide a communication device, comprising: a processor and a memory; the memory being configured to store computer instructions, such that when the processor executes the instructions, the communication device executes the method executed by the fourth terminal device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communication device may be the fourth terminal device in the aforementioned fourth aspect or any possible design of the fourth aspect, or a chip implementing the functions of the aforementioned fourth terminal device.
[0151] In a nineteenth aspect, embodiments of the present application provide a communication device, comprising: a processor; the processor being coupled to a memory and configured to read and execute instructions in the memory, so that the communication device performs a method as performed by a fourth terminal device in any of the aforementioned aspects or any possible designs of any of the aforementioned aspects. The communication device may be the fourth terminal device in any of the aforementioned fourth aspects or any possible designs of the fourth aspect, or a chip implementing the functions of the fourth terminal device.
[0152] In a twentieth aspect, an embodiment of the present application provides a chip comprising a logic circuit and an input / output interface. The input / output interface is used to communicate with a module outside the chip. For example, the chip may be a chip that implements the fourth terminal device function described in the fourth aspect or any possible design of the fourth aspect. The input / output interface outputs a second message and a third message. The input / output interface inputs a third message. The logic circuit is used to execute a computer program or instruction to implement the method described in the fourth aspect or any possible design of the fourth aspect.
[0153] In the twenty-first aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the collective communication method of any one of the above aspects.
[0154] In aspect 22, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the collective communication method of any one of the above aspects.
[0155] In aspect 23, an embodiment of the present application provides a circuit system, the circuit system including a processing circuit, and the processing circuit is configured to execute a collective communication method as described in any one of the above aspects.
[0156] In aspect 24, an embodiment of the present application provides a communication system, which includes a terminal device and a network device in any one of the above aspects.
[0157] Among them, the technical effects brought about by any design in the fifth to twenty-fourth aspects can refer to the beneficial effects of the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0158] Figure 1a A schematic diagram of the communication path distribution under the network architecture provided in the embodiment of the present application;
[0159] Figure 1b A schematic diagram of another communication path distribution under the network architecture provided in an embodiment of the present application;
[0160] Figure 2a A flowchart of a collective communication method provided in an embodiment of the present application;
[0161] Figure 2b A schematic diagram of the structure of a message provided in an embodiment of the present application;
[0162] Figure 2c A schematic diagram of the structure of another message provided in an embodiment of the present application;
[0163] Figure 3a A flowchart of another collective communication method provided in an embodiment of the present application;
[0164] Figure 3b A schematic diagram of the structure of another message provided in an embodiment of the present application;
[0165] Figure 4a A flowchart of another collective communication method provided in an embodiment of the present application;
[0166] Figure 4b A schematic diagram of the structure of another message provided in an embodiment of the present application;
[0167] Figure 4c A schematic diagram of the structure of another message provided in an embodiment of the present application;
[0168] Figure 5 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;
[0169] Figure 6 A structural diagram of another communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0170] The terms "first" and "second" in the description and drawings of this application are used to distinguish different objects, or to distinguish different treatments of the same object, rather than to describe a specific order of objects. In addition, the terms "including" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete way. The term "multiple" mentioned in the description of this application refers to two or more.
[0171] First, the technical terms involved in the embodiments of this application are introduced:
[0172] 1. Message passing interface (MPI)
[0173] MPI is a communication library for message passing between multiple processes. Applications implement data transmission by calling the communication interfaces defined in MPI.
[0174] 2. Collective communication, tasks, and processes
[0175] Collective communication is a communication mode in MPI that involves all processes in a specific group. A specific group can be a collection of processes that complete a task.
[0176] A task is a set of processes required to complete a specific computing task. A task is run by a set of processes on a node. The number of nodes can be one or more. Each process set can consist of one or more processes. A node can deploy one or more processes from a set.
[0177] A process is used to complete a certain part of the computational processing of a task. In an embodiment of the present application, there are at least two processes for executing a task. Different processes are identified by different numbers. For processes in the same communication domain, each process is assigned a unique number during the initialization of the communication domain. A communication domain must be created when running a task, and the communication domain includes a context, a process group, and the like. A task can have one or more communication domains, and one communication domain corresponds to one process group. A process group represents a collection of all processes in the communication domain corresponding to itself.
[0178] To distinguish them, for processes in the same communication domain, the node where the process numbered 0 is located is called the master node, and the remaining nodes are called compute nodes. The master node and compute nodes run the same task simultaneously, achieving parallel computing. It should be noted that in the embodiments of the present application, the node can also be replaced by a terminal device.
[0179] For example, Figure 1a A schematic diagram of a network architecture used in the embodiment of the present application is shown. This network architecture is only an example and should not be understood as limiting the application scenarios of the embodiment of the present application. Figure 1a In the network architecture diagram of a communication domain shown in FIG, the sub-nodes of the second network device include the first network device and the third network device. Among them, the second network device can be a core (spine) switch, and the first network device and the third network device can both be access (leaf) switches. There are four terminal devices belonging to the first network device, and there are also four terminal devices belonging to the third network device. One process is deployed on one terminal device, and different processes are deployed on different terminal devices. The numbers corresponding to different processes are also different. For the terminal device belonging to the first network device, the numbers of the processes deployed on the terminal device include: number 0, number 1, number 2, and number 3. For the terminal device belonging to the third network device, the numbers of the processes deployed on the terminal device include: number 4, number 5, number 6, and number 7.
[0180] It should be noted that the network devices (such as the first network device, the second network device, and the third network device) in the embodiments of the present application are not limited to the switches mentioned above, but can also be other devices, such as routers. The terminal devices in the embodiments of the present application can also be described as nodes. The terminal devices mentioned in the embodiments of the present application can also be servers, etc.
[0181] In addition, in the embodiment of the present application, "A belongs to B" means that A is the child node of B and B is the parent node of A. For example, Figure 1aIn the example, there are four terminal devices belonging to the first network device, which can also be described as: there are four child nodes of the first network device. "B to which A belongs" also means that A is the child node of B and B is the parent node of A. Figure 1a For example, the terminal device where the process numbered 0 is located is a child node of the first network device. In other words, the network device to which the terminal device (the terminal device where the process numbered 0 is deployed) belongs is the first network device.
[0182] In order to complete a global reduction (allreduce), some collective communication algorithms (such as the recursive doubling algorithm) require each terminal device to perform three communications with other terminal devices, and the source terminal device and destination terminal device involved in each communication are determined based on the process number. Figure 1a The curved arrows in show the source terminal device and the destination terminal device of each communication.
[0183] It should be noted that in Figure 1a In the network architecture shown, only one communication domain of a certain task is used as an example for introduction. The number of the second network device can be one or more. Figure 1a Only one second network device is shown in FIG. The number of sub-nodes of the second network device can be one or more. Figure 1a The second network device includes two sub-nodes as an example. The number of sub-nodes of the first network device can be one or more. Figure 1a In the example, only the first network device including four sub-nodes is used for the description. Similarly, the number of sub-nodes of the third network device can be one or more. Figure 1a In the example, the third network device includes four sub-nodes. The number of sub-nodes of the first network device and the number of sub-nodes of the third network device may be the same or different, and this embodiment of the application does not limit this.
[0184] Since the source terminal device cannot perceive the location of the destination terminal device in the network topology, there may be multiple communications across the second network device. Figure 1b As shown, the number of communications across the second network device in the three parallel communications is three, while Figure 1a In the three parallel communications, the number of communications across the second network device is 1. That is, the longer the communication path across the second network device is, the greater the communication overhead is.
[0185] Although, in an Ethernet networking environment, if the first network device, the third network device, and the terminal device all support the Open Flow protocol and a portable network locality (Netloc) library is deployed on the terminal device, the terminal device can obtain the global network topology. Then, for a certain task, the terminal device uses the MPI communication library to query the application programming interface (API) to obtain the location of the process executing the task in the network topology, and then combines the corresponding number of each process to determine the communication path that matches the network topology. The process of obtaining the global network topology is as follows:
[0186] The terminal device that deploys the process identified by deployment number 0 is denoted as terminal device 1. For terminal device 1, terminal device 1 obtains first topology information from the first network device. The first topology information includes the connection status between the first network device and the second network device, and the connection status between the first network device and its own child nodes. In addition, terminal device 1 obtains third topology information from the third network device. The third topology information includes the connection status between the third network device and the second network device, and the connection status between the third network device and its own child nodes. Based on the first topology information and the third topology information, terminal device 1 can determine the global network topology. For terminal devices that deploy processes identified by other numbers, the above process can be repeated to determine the global network topology.
[0187] As can be seen from this, to obtain topology information, terminal devices must support the OpenFlow protocol and have the Netloc library deployed. Network devices must also support the OpenFlow protocol. Furthermore, the topology information provided by each network device indicates the connection status between itself and other devices. Even if a process is not deployed on a terminal device belonging to that network device, the network device still provides the connection status between itself and that terminal device, wasting transmission resources.
[0188] In summary, in the process of collective communication, how to obtain the location of the process executing a certain task in the network topology, reduce long communication paths (across multiple network devices), and save resource overhead is a technical problem that needs to be solved urgently.
[0189] In view of this, the embodiment of the present application provides a method for collective communication, which can accurately determine the position of a task process in the network topology, which is conducive to planning a communication path that matches the network topology, reducing long communication paths, and reducing resource overhead. The network architecture applicable to the method for collective communication in the embodiment of the present application is detailed in Figure 1a and Figure 1bThe network architecture and service scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application.
[0190] In this embodiment of the present application, taking a communication domain as an example, the terminal device deployed with the process identified by number 0 is described as terminal device 1, the network device to which terminal device 1 belongs is described as the first network device, and the task completed by the process identified by number 0 is described as the first task. Terminal device 1 can also be described as the master node. The following describes the steps of the collective communication method 200 of the embodiment of the present application:
[0191] The first stage is to report the process information and network device information. In the first stage, the process information refers to the information of the first process deployed on a terminal device, and the network device information refers to the information of the network device corresponding to the first process. The network device corresponding to the first process refers to the network device to which the terminal device with the first process deployed belongs in a communication domain. Figure 2a , this stage is introduced in two situations:
[0192] As the first scenario of the first phase, in a communication domain, the process of executing the first task is distributed not only on terminal device 1, but also on other terminal devices belonging to the first network device. Below, this scenario is described using a terminal device as an example:
[0193] S201: Terminal device 2 sends message 1 to a first network device. Correspondingly, the first network device receives message 1 from terminal device 2.
[0194] The description of the terminal device 2 is as follows: the terminal device 2 belongs to the first network device, and the first process is deployed on the terminal device 2. For example, see Figure 1a , the number of the deployed process on terminal device 2 can be one of the following: number 1, number 2, or number 3. Terminal device 2 can also be called a computing node.
[0195] The description of message 1 is as follows: Message 1 at least includes information of the first process, such as the number of the first process, the identifier of the first process, etc. Figure 1a For example, when the number of the process deployed on terminal device 2 is 1, the information of the first process includes the information of "number 1". When the number of the process deployed on terminal device 2 is 2, the information of the first process includes the information of "number 2". When the number of the process deployed on terminal device 2 is 3, the information of the first process includes the information of "number 3". Figure 2bFor example, message 1 uses 4 bytes (byte, B) to carry the information of the first process, and these 4 bytes are recorded as node_info.
[0196] The following two examples illustrate other information in message 1:
[0197] Example 1: Message 1 does not carry the network device corresponding to the first process (i.e. Figure 1a In this example, the first network device in the embodiment of the present application executes S202. For details, see the relevant description of S202, which will not be repeated here.
[0198] Message 1 may also include at least one of the following information:
[0199] The first item is information 1. Information 1 indicates that message 1 does not carry the network device corresponding to the first process (i.e. Figure 1a Exemplarily, information 1 includes field 1 in message 1, and the value of field 1 in message 1 is a preset value 1. Field 1 can be a switch device (switch_modified) field in message 1, such as Figure 2b As shown, it can also be a field with other names, which is not limited in this embodiment of the present application. The value of the preset value 1 can be 0 or other values, which is not limited in this embodiment of the present application. Figure 2b In the example, the switching device field occupies bits 4-7 in the infinite bandwidth (IB) payload. When the switching device field is 0, the message 1 where the field is located does not carry the information of the network device corresponding to the first process.
[0200] The second item is information 2. Information 2 indicates that the type of message 1 is a query message. For example, information 2 includes field 2 in message 1, and the value of field 2 in message 1 is a preset value 2. Field 2 can be a message type indication field in message 1, such as Figure 2b The field named query_notify in the example may also be a field with other names, which is not limited in the present embodiment. The value of the preset value 2 may be 0 or other values, which is not limited in the present embodiment. Figure 2b In the Message Type Indication field, the message type indication field occupies bits 0-3 in the Infiniband payload. When the value of the message type indication field is 0, the message 1 where this field is located is a query message.
[0201] Example 2: Message 1 carries the network device corresponding to the first process (i.e. Figure 1aIn this example, in this example, the first network device of the embodiment of the present application does not need to execute S202, but only executes S203, and the message 2 in S203 is the message 1 in this example. Please refer to the relevant description of S203 for details, which will not be repeated here. The following is an introduction to the information of the first network device carried by the message 1: The information of the first network device is used to uniquely identify the first network device, and may include but is not limited to: the IP address of the first network device, the identification information of the first network device, etc. Figure 2c For example, message 1 uses 4 bytes to carry the information of the first network device, and these 4 bytes are recorded as TOR_info. For example, in message 1, the field corresponding to TOR_info carries the IP address of the first network device (such as 192.168.2.1). In this example, message 1 does not include information 1 (such as the field recorded as switch_modified), but may include information 2 (such as the field recorded as query_notify). Figure 2c In addition, in this example, there are multiple ways for terminal device 2 to obtain information about the first network device. For example, during the process of establishing a communication connection between terminal device 2 and the first network device, terminal device 2 obtains information about the first network device. Of course, terminal device 2 can also obtain information about the first network device in other ways, which is not limited in this embodiment of the present application.
[0202] It should be noted that in the above two examples, message 1 also includes other fields. For example, see Figure 2b Taking the Remote Direct Memory Access over Converged Ethernet (RoCE) version 2 network protocol as an example, Message 1 also includes the following fields: Ethernet linker header (ETH), Internet Protocol (IP) header, User Datagram Protocol (UDP) header, Infiniband base transport header (IBBTH), and invariant cyclic redundancy check (ICRC). The ICRC is used to protect the integrity of the message. This is a mechanism that provides message integrity protection through a cyclic redundancy check (CRC).
[0203] S202: The first network device generates message 2 according to message 1.
[0204] Among them, the message 2 includes at least the information of the first process and the information of the first network device. The information of the first process can refer to the introduction of S201, which will not be repeated here. The information of the first network device can refer to the relevant description of Example 2 of S201, which will not be repeated here. Figure 2b For example, Message 2 uses 4 bytes to carry information about the first network device, which is denoted as TOR_info. For example, in Message 1 of Example 1 in S201, the field corresponding to TOR_info is 0, meaning that Message 1 does not carry information about the first network device. The first network device encapsulates the first network device's IP address (e.g., 192.168.2.1) into the TOR_info field of Message 1 to generate Message 2.
[0205] Optionally, when a preset condition is met, the first network device generates message 2 according to message 1. The preset condition includes the following two items:
[0206] First, the type of message 1 is a target type. The target type may include, but is not limited to, a query message. For example, if message 1 includes information 2, message 1 is a query message.
[0207] The second item, message 1, includes information 1. The introduction of information 1 can be found in the description of S201 and will not be repeated here.
[0208] On the contrary, when the preset condition is not met, the first network device performs forwarding processing and does not update the message.
[0209] In this way, even if the first network device receives other messages, it can determine which messages to process according to the preset conditions to obtain the second message.
[0210] It should be noted that, in the case where message 1 is example 1 of S201, the first network device executes S202, and in the case where message 1 is example 2 of S201, the first network device does not need to execute S202. When the first network device executes S202, if message 1 includes information 1, the first network device also updates information 1 to information 3. In other words, message 2 includes information 3. Information 3 indicates that message 2 carries the network device corresponding to the first process (i.e. Figure 1a For example, information 3 includes field 1 in message 2, and the value of field 1 in message 2 is preset value 3. The value of preset value 3 can be 1, which is different from the value of preset value 1. In the case that message 1 meets the network protocol of RoCE V2, the first network device not only updates two fields (such as Figure 2bIn addition to the fields corresponding to switch_notified and TOR_info, the first network device also updates the value of the ICRC field to verify the integrity of the data from the IP message header to the ICRC field.
[0211] S203: The first network device sends message 2 to terminal device 1. Correspondingly, terminal device 1 receives message 2 from the first network device.
[0212] The number of the deployment process on terminal device 1 is 0. Terminal device 1 can also be called a master node.
[0213] Wherein, when the first network device executes S202, the message 2 in S203 is the message 2 in S202. When the first network device does not execute S202, the message 2 in S203 is the message 1 in Example 2 in S201.
[0214] Through the description of S201 to S203 above, terminal device 1 can obtain the process information deployed on terminal device 2, as well as the information of the first network device to which terminal device 2 belongs. It should be noted that in the above-mentioned communication domain, in addition to terminal device 1 and terminal device 2, if there are other terminal devices belonging to the first network device, and a process for executing the first task is deployed on the terminal device, terminal device 1 will still obtain the process information deployed on the terminal device, as well as the information of the first network device. The specific implementation process can be found in the introduction of S201 to S203, and will not be repeated here.
[0215] As the second scenario of the first phase, in the aforementioned communication domain, the process executing the first task is distributed not only on the terminal devices belonging to the first network device, but also on the terminal devices belonging to the third network device. The third network device belongs to the aforementioned second network device. Below, we will use a terminal device as an example to describe this scenario:
[0216] S204: Terminal device 3 sends message 3 to the third network device. Correspondingly, the third network device receives message 3 from terminal device 3.
[0217] The description of the terminal device 3 is as follows: the terminal device 3 belongs to the third network device, and a first process is deployed on the terminal device 3, and the first process is used to execute the first task. Figure 1a , the number of the deployed process on the terminal device 3 can be one of the following: number 4, number 5, number 6 or number 7. The terminal device 3 can also be called a computing node.
[0218] For the description of message 3, please refer to the relevant description of "message 1" in S201, which will not be repeated here.
[0219] S205 . The third network device generates message 4 according to message 3 .
[0220] Message 4 includes at least information about the first process and information about the third network device. The information about the first process can be found in the description of S201 and will not be repeated here. The information about the third network device is used to uniquely identify the third network device. For example, the IP address of the third network device can be recorded as 192.168.1.1. The implementation process of S205 can be found in the description of S202 and will not be repeated here.
[0221] S206: The third network device sends message 4 to the second network device. Correspondingly, the second network device receives message 4 from the third network device.
[0222] The third network device belongs to the second network device.
[0223] Wherein, when the third network device executes S205, the message 4 in S206 is the message 4 in S205. When the third network device does not execute S205, the message 4 in S206 is the message 3 in Example 2 in S204.
[0224] S207: The second network device sends message 4 to the first network device. Correspondingly, the first network device receives message 4 from the second network device.
[0225] Among them, the message 4 in S207 is the message 4 in S206.
[0226] S208: The first network device sends message 4 to terminal device 1. Correspondingly, terminal device 1 receives message 4 from the first network device.
[0227] Among them, the introduction of terminal device 1 can be found in the relevant description of S203, which will not be repeated here.
[0228] Through the description of S204 to S208 above, terminal device 1 can obtain the process information deployed on terminal device 3, as well as the information of the third network device to which terminal device 3 belongs. It should be noted that in the above-mentioned communication domain, in addition to terminal device 3, if there are other terminal devices belonging to the third network device, and the process executing the first task is deployed on the terminal device, then the terminal device will still report the process information deployed by itself and the information of the third network device to terminal device 1. The specific implementation process can be found in the introduction of S204 to S208, which will not be repeated here.
[0229] The second stage is to distribute process information and network device information. In the second stage, process information refers to the information of all first processes executing the first task corresponding to the target network device, and network device information refers to the information of the target network device. The target network device is at least one of the network devices corresponding to the first task. The network device corresponding to the first task refers to the network device to which the terminal device with the first process deployed belongs in a communication domain of the first task. The first process is used to execute the first task. Figure 1a For example, the network devices corresponding to the first task include the first network device and the third network device. The following describes this stage in two possible designs:
[0230] In the first possible design, in the communication domain, the first terminal device distributes information about all target network devices corresponding to the first task in the communication domain, and information about all processes executing the first task corresponding to each target network device, at the task granularity. Figure 3a , the steps of the embodiment of the present application are as follows:
[0231] S301. Terminal device 1 generates message 5 according to the message obtained in the first stage.
[0232] Among them, the messages obtained in the first stage include the above-mentioned message 2 and message 4.
[0233] The message 5 at least includes information about all target network devices corresponding to the first task in the communication domain, and information about all first processes executing the first task corresponding to each target network device.
[0234] For example, Figure 3b Figure 5 shows some fields of message 5, where the field carrying the target network device information is denoted as TOR_info. Figure 1b Taking the network architecture shown in FIG. 1 as an example, all target network devices corresponding to the first task in the communication domain include the first network device and the third network device. The TOR_info field includes the information of the first network device (i.e., 192.168.2.1) and the information of the third network device (i.e., 192.168.1.1). The field that carries the information of the process is recorded as attached_node_info. Figure 1b Taking the network architecture shown in FIG. 1 as an example, in the communication domain, information about all first processes executing the first task corresponding to the first network device includes: number 0, number 1, number 2, and number 3. Information about all first processes executing the first task corresponding to the third network device includes: number 4, number 5, number 6, and number 7.
[0235] Optionally, message 5 further includes at least one of the following information:
[0236] Item 1, information 4. Information 4 includes at least one quantity value, and the number of quantity values is consistent with the number of target network devices corresponding to the first network, and corresponds one to one. Taking the first quantity value as an example, a detailed explanation is given: the first quantity value belongs to one of at least one quantity value. The first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process that executes the first task. The terminal devices in the terminal device set belong to the target network device corresponding to the first quantity value. In a single-core scenario, the first quantity value is consistent with the number of the first process in the terminal device set. In the case where at least one quantity value also includes other quantity values, the introduction of the other quantity values can be found in the description of the first quantity value, and will not be repeated here.
[0237] For example, see Figure 3b Information 4 is the number of terminal devices in message 5, recorded as attached_node_number. The value 4 after 192.168.1.1 corresponds to the third network device identified by 192.168.1.1. This value 4 indicates that among the terminal devices belonging to the third network device, four terminal devices are deployed with the first process executing the first task. The value 4 after 192.168.2.1 corresponds to the first network device identified by 192.168.2.1. This value 4 indicates that among the terminal devices belonging to the first network device, four terminal devices are deployed with the first process executing the first task.
[0238] Item 2, information 5. Information 5 indicates that the type of message 5 is a notification message. Exemplarily, information 5 includes field 2 in message 5, and the value of field 2 in message 5 is a preset value 4. Field 2 can be a message type indication field in message 5, or a field with another name. For an introduction to field 2, please refer to the relevant description of S201, which will not be repeated here. The value of the preset value 4 can be 1, or other values, as long as it is different from the value of the preset value 2. Exemplarily, see Figure 3b Information 5 is a message type indication field in message 5, which is recorded as query_notify. The value of the query_notify field is 1, indicating that the message 5 in which the field is located is a notification message.
[0239] Item 3, information 6. Information 6 indicates that message 5 carries information about the target network device corresponding to the first task in the communication domain. For example, information 6 includes field 1 in message 5, and the value of field 1 in message 5 is a preset value 3. For an introduction to field 1 and preset value 3, please refer to the relevant description of S202, which will not be repeated here. For example, see Figure 3bInformation 6 is a message type indication field in message 5, which is recorded as query_notify. The value of the query_notify field is 1, indicating that the message 5 in which the field is located is a notification message.
[0240] Item 4, information 7. Information 7 indicates the number of target network devices corresponding to the first task in the above communication domain. For example, see Figure 3b , Information 7 is the "number of network devices" field in message 5, recorded as TOR_number. Figure 1b Taking the network architecture shown as an example, the value of the TOR_number field is 2, indicating that the number of target network devices corresponding to the first task in the above communication domain is 2.
[0241] In some embodiments, when the number of messages obtained in the first phase reaches a target value, terminal device 1 generates message 5 based on the messages obtained in the first phase. The target value indicates the number of all terminal devices in the communication domain where processes executing the first task reside. Because the process identified by number 0 is deployed on terminal device 1, the number of all terminal devices executing the first task in the communication domain can be determined, i.e., terminal device 1 is aware of the target value.
[0242] For example, Figure 1a Taking the network architecture shown as an example, when the first process is deployed on eight terminal devices, the target value is 8. After terminal device 1 determines that it has obtained eight messages (i.e., eight messages are obtained in the first stage), terminal device 1 generates message 5 based on the eight messages obtained. Message 5 carries information about the first process in the eight messages, as well as information about the network device corresponding to the first task in the eight messages in the communication domain, to avoid missing process information and network device information.
[0243] It should be noted that in Figure 1a In the illustrated network architecture, even if the communication quality between devices (e.g., between the first network device and terminal device 1) deteriorates and retransmissions occur, such as the retransmission of message 2 in S203 or the retransmission of message 4 in S208, terminal device 1 can identify the retransmitted message and determine which message is being retransmitted. In this case, if a message is retransmitted, terminal device 1 determines that the retransmitted message is invalid, and this does not affect the above-mentioned message count.
[0244] S302: Terminal device 1 sends message 5 to the first network device. Correspondingly, the first network device receives message 5 from terminal device 2.
[0245] For the introduction of message 5, please refer to the relevant description of S301, which will not be repeated here.
[0246] As the first possible design scenario, in the above communication domain, the process of executing the first task is distributed not only on terminal device 1, but also on other terminal devices belonging to the first network device. Below, this scenario is described using a terminal device as an example:
[0247] S303: The first network device sends message 5 to terminal device 2. Correspondingly, terminal device 2 receives message 5 from the first network device.
[0248] Exemplarily, the first network device determines that the message 5 does not meet the preset condition, and the first network device performs forwarding processing, that is, sends the message 5 to the terminal device 2. The introduction of the preset condition can be found in the introduction of S202, which will not be repeated here.
[0249] Through the description of S301 to S303 above, terminal device 2 can obtain information about all target network devices corresponding to the first task in the above communication domain, as well as information about all first processes executing the first task corresponding to each target network device. It should be noted that in the above communication domain, in addition to terminal device 1 and terminal device 2, if there are other terminal devices belonging to the first network device and a process executing the first task is deployed on the terminal device, the first network device will still send message 5 to the terminal device, which will not be repeated here.
[0250] As a second scenario of the first possible design, in the aforementioned communication domain, the process executing the first task is distributed not only on the terminal device belonging to the first network device, but also on the terminal device belonging to the third network device. The third network device belongs to the second network device. Below, taking a terminal device as an example, this scenario is described:
[0251] S304: The first network device sends message 5 to the second network device. Correspondingly, the second network device receives message 5 from the first network device.
[0252] The sub-node of the second network device includes a third network device.
[0253] Exemplarily, the first network device determines that the message 5 does not meet the preset condition, and the first network device performs forwarding processing, that is, sends the message 5 to the second network device. The introduction of the preset condition can be found in the introduction of S202, which will not be repeated here.
[0254] S305: The second network device sends message 5 to the third network device. Correspondingly, the third network device receives message 5 from the second network device.
[0255] Exemplarily, the second network device determines that the message 5 does not meet the preset condition, and the second network device performs forwarding processing, that is, sends the message 5 to the third network device. The introduction of the preset condition can be found in the introduction of S202, which will not be repeated here.
[0256] S306: The third network device sends message 5 to the terminal device 3. Correspondingly, the terminal device 3 receives the message 5 from the third network device.
[0257] Among them, the introduction of terminal device 3 can be found in the relevant description of S204, which will not be repeated here.
[0258] Exemplarily, the third network device determines that the message 5 does not meet the preset condition, and the third network device performs forwarding processing, that is, sends the message 5 to the terminal device 3. The introduction of the preset condition can be found in the introduction of S202, which will not be repeated here.
[0259] In the above-mentioned communication domain, through the description of S301, S302, S304, S305 and S306 above, the terminal device 3 can obtain the information of all target network devices corresponding to the first task in the above-mentioned communication domain, as well as the information of all first processes executing the first task corresponding to each target network device. It should be noted that, in addition to the terminal device 3, if there are other terminal devices belonging to the third network device, and the process executing the first task is deployed on the terminal device, the third network device still sends message 5 to the terminal device, which will not be repeated here. Similarly, in addition to the third network device, if there are terminal devices belonging to other network devices, and the process executing the first task is deployed on the terminal device, the second network device still sends message 5 to the network device, and the terminal device sends message 5, which will not be repeated here.
[0260] In the second possible design, in the above communication domain, with network devices as the granularity, the first terminal device distributes information about a target network device corresponding to the first task, as well as information about all processes executing the first task corresponding to the target network device. Figure 4a , the steps of the embodiment of the present application are as follows:
[0261] S401. The terminal device 1 generates at least one message 6 according to the message obtained in the first stage.
[0262] Among them, the messages obtained in the first stage include the above-mentioned message 2 and message 4.
[0263] The number of messages 6 is consistent with the number of all target network devices corresponding to the first task in the communication domain. One message 6 includes information about one target network device and information about all first processes executing the first task corresponding to the target network device. Different messages 6 contain different target network devices.
[0264] Optionally, each message 6 includes at least one of the following information: information 4, information 5, information 6, and information 7. The introduction of information 4 to information 7 can be found in the relevant description of S301 and will not be repeated here.
[0265] In some embodiments, when the number of messages obtained in the first phase reaches a target value, terminal device 1 generates at least one message 6 based on a target message among the messages obtained in the first phase. The target value can be found in the description of S301 and will not be repeated here. The target message is one of the messages obtained in the first phase and carries information about the same target network device.
[0266] For example, Figure 1a Taking the network architecture shown as an example, when the first process is deployed on 8 terminal devices, the target value is 8. After the terminal device 1 determines that it has obtained 8 messages (i.e., 8 messages are obtained in the first stage), the terminal device 1 determines that there are 4 messages carrying the information of the first network device. The terminal device 1 generates a message 6 based on these 4 messages, which can be recorded as message 6a. Among them, message 6a carries the information of the first network device and the information of the 4 first processes corresponding to the first network device, as shown in FIG. Figure 4b As shown. The terminal device 1 determines that there are 4 messages carrying the information of the third network device. The terminal device 1 generates another message 6 based on these 4 messages, which can be recorded as message 6b. Among them, the message 6b carries the information of the third network device and the information of the 4 first processes corresponding to the third network device, as shown in FIG. Figure 4c shown.
[0267] S402: Terminal device 1 sends at least one message 6 to the first network device. Correspondingly, the first network device receives at least one message 6 from terminal device 2.
[0268] The number of messages 6 is consistent with the number of all target network devices corresponding to the first task in the communication domain. One message 6 includes information about one target network device and information about all first processes executing the first task corresponding to the target network device. Different messages 6 contain different target network devices.
[0269] For example, Figure 1a Taking the network architecture shown in FIG. 1 as an example, in S402, the message 6 sent by the terminal device 1 to the first network device includes a message 6a (such as Figure 4b As shown) and message 6b (as shown Figure 4c shown).
[0270] As the first scenario of the second possible design, in the above communication domain, the process of executing the first task is distributed not only on terminal device 1, but also on other terminal devices belonging to the first network device. Below, this scenario is described using a terminal device as an example:
[0271] S403: The first network device sends message 6 to terminal device 2. Correspondingly, terminal device 2 receives message 6 from the first network device.
[0272] The message 6 sent by the first network device to the terminal device 2 includes information about the first network device and information about all first processes that execute the first task corresponding to the first network device, that is, message 6a. Figure 4b shown.
[0273] Exemplarily, the first network device determines that the message 6a does not meet the preset condition, and the first network device performs forwarding processing, that is, sends the message 6a to the terminal device 2. The introduction of the preset condition can be found in the introduction of S202, which will not be repeated here.
[0274] Through the description of S401 to S403 above, terminal device 2 can obtain the information of the first network device and the information of all first processes executing the first task corresponding to the first network device. It should be noted that in the above communication domain, in addition to terminal device 1 and terminal device 2, if there are other terminal devices belonging to the first network device and the process executing the first task is deployed on the terminal device, the first network device will still send message 6 to the terminal device, which will not be repeated here.
[0275] As the second possible design scenario, in the above communication domain, the process of executing the first task is distributed not only on the terminal device belonging to the first network device, but also on the terminal device belonging to the third network device. Below, this scenario is described using a terminal device as an example:
[0276] S404: The first network device sends at least one message 6 to the second network device. Correspondingly, the second network device receives at least one message 6 from the first network device.
[0277] Among them, in the child nodes of the second network device, if only the terminal device belonging to the third network device is deployed with the first process for executing the first task, such as Figure 1a The network architecture shown, the number of messages 6 in S404 can be one. The sub-node of the second network device also includes a fourth network device ( Figure 1a(not shown), if there is still a terminal device belonging to the fourth network device, and the first process executing the first task is deployed on the terminal device, then the number of messages 6 in S404 is at least two. In other words, the number of messages 6 in S404 is related to the number of target network devices belonging to the second network device.
[0278] For example, Figure 1b Taking the network architecture shown in FIG. 1 as an example, the message 6 sent by the first network device to the second network device includes information about the third network device and process information corresponding to the third network device, that is, message 6b. Figure 4c shown.
[0279] S405: The second network device sends message 6 to the third network device. Correspondingly, the third network device receives message 6 from the second network device.
[0280] For example, Figure 1b Taking the network architecture shown in FIG. 1 as an example, the message 6 sent by the second network device to the third network device includes information about the third network device and process information corresponding to the third network device, that is, message 6b. Figure 4c shown.
[0281] S406: The third network device sends message 6 to the terminal device 3. Correspondingly, the terminal device 3 receives message 6 from the third network device.
[0282] For example, Figure 1b Taking the network architecture shown in FIG. 1 as an example, the message 6 sent by the third network device to the terminal device 3 includes information about the third network device and process information corresponding to the third network device, that is, message 6b. Figure 4c shown.
[0283] Through the description of S401, S402, S404, S405 and S406 above, the terminal device 3 can obtain the information of all the first processes that execute the first task corresponding to the third network device. It should be noted that in the above-mentioned communication domain, in addition to the terminal device 3, if there are other terminal devices belonging to the third network device, and the process for executing the first task is deployed on the terminal device, the third network device still sends message 6 to the terminal device, which will not be repeated here. Similarly, in the above-mentioned communication domain, in addition to the third network device, if there are terminal devices belonging to other network devices, and the process for executing the first task is deployed on the terminal device, the second network device still sends message 6 to the network device to transmit message 6 to the corresponding terminal device through the network device, which will not be repeated here.
[0284] It should be noted that the above description uses the example of assigning a single process to a terminal device. When multiple processes are assigned to a terminal device, the terminal device, following certain rules, selects one process from its assigned processes as the target process corresponding to the terminal device and sends message 1 containing information about the target process. The transmission process of message 1 between network devices can be found in the above description and will not be further described here. After the network interface card of the terminal device receives the message from the network device, it distributes the message to the processor executing each process, so that each processor knows the location of the process executing the first task in the network topology.
[0285] In addition, the above descriptions are all based on one communication domain. When the first task corresponds to two or more communication domains, the execution process of each communication domain can refer to the introduction of the above two stages and will not be repeated here.
[0286] In the method of collective communication in the embodiment of the present application, the message received by the terminal device 1 carries both the information of the first process and the information of the network device corresponding to the first process. Then, the terminal device 1 generates the above-mentioned message 5 or message 6 based on the received message (such as the above-mentioned message 2 and message 4), and both message 5 and message 6 include at least the information of a target network device and the information of all the first processes that perform the first task corresponding to the target network device, and sends the generated message to the corresponding target network device so that the terminal device belonging to the target network device can obtain the message generated by the terminal device 1. In this way, for terminal devices belonging to the same network device, each terminal device can obtain the information of the network device to which it belongs, as well as the information of all the first processes that perform the first task corresponding to the network device to which it belongs, thereby planning the communication path, realizing close-range communication, minimizing the communication path across three network devices, and saving resource overhead. Moreover, in the above process, if a terminal device does not deploy the first process, the terminal device does not execute the above steps to avoid wasting transmission resources. In addition, the above-mentioned network devices and terminal devices do not need to support other protocols, and the terminal devices do not need to deploy the Netloc library, and no additional Netloc library deployment work is introduced.
[0287] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of interaction between various network elements. Accordingly, the embodiment of the present application also provides a communication device, which can be the network element in the above method embodiment, or a device including the above network element, or a component that can be used for a network element. It can be understood that in order to implement the above functions, the communication device includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a computer software-driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0288] The present invention provides a chip including a logic circuit and an input / output interface, wherein the input / output interface is used to communicate with modules outside the chip, and the logic circuit is used to perform other operations on the device where the chip is located in the above method embodiment, in addition to the sending and receiving operations.
[0289] In the case where the first terminal device is implemented as the terminal device 1, for example, the above method embodiment is implemented as a chip Figure 2a Taking the functions of the terminal device 1 as an example, the input and output interface can be used to execute S203 and S208 on the terminal device 1 side in the embodiment of the present application, and / or the input and output interface is also used to execute other sending and receiving steps on the terminal device 1 side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the terminal device 1 side in the embodiment of the present application.
[0290] For example, the chip is implemented as the above method embodiment Figure 3a Taking the functions of the terminal device 1 as an example, the input and output interface can be used to execute S302 on the terminal device 1 side, and / or the input and output interface is also used to execute other sending and receiving steps on the terminal device 1 side in the embodiment of the present application. The logic circuit can be used to execute S301 on the terminal device 1 side, and / or the logic circuit is also used to execute other processing steps on the terminal device 1 side in the embodiment of the present application.
[0291] For example, the above method embodiment is implemented as a chip Figure 4a Taking the functions of the terminal device 1 as an example, the input and output interface can be used to execute S402 on the terminal device 1 side, and / or the input and output interface is also used to execute other sending and receiving steps on the terminal device 1 side in the embodiment of the present application. The logic circuit can be used to execute S401 on the terminal device 1 side, and / or the logic circuit is also used to execute other processing steps on the terminal device 1 side in the embodiment of the present application.
[0292] For the first network device, for example, the above method embodiment is implemented in a chip. Figure 2a Taking the functions of the first network device as an example, the input and output interface can be used to execute S201, S203, S207, and S208 on the first network device side in the embodiment of the present application, and / or the input and output interface can also be used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The logic circuit can be used to execute S202 on the first network device side in the embodiment of the present application, and / or the logic circuit can also be used to execute other processing steps on the first network device side in the embodiment of the present application.
[0293] For example, the chip is implemented as the above method embodiment Figure 3a Taking the function of the first network device as an example, the input / output interface can be used to execute S302, S303, and S304 on the first network device side, and / or the input / output interface can also be used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the first network device side.
[0294] For example, the above method embodiment is implemented as a chip Figure 4a Taking the function of the first network device as an example, the input / output interface can be used to execute S402, S403, and S404 on the first network device side, and / or the input / output interface can also be used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the first network device side.
[0295] For the third network device, for example, the above method embodiment is implemented in a chip. Figure 2a Taking the functions of the third network device as an example, the input and output interface can be used to execute S204 and S206 on the third network device side in the embodiment of the present application, and / or the input and output interface is also used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The logic circuit can be used to execute S205 on the third network device side in the embodiment of the present application, and / or the logic circuit is also used to execute other processing steps on the third network device side in the embodiment of the present application.
[0296] For example, the chip is implemented as the above method embodiment Figure 3a Taking the function of the third network device as an example, the input / output interface can be used to execute S305 and S306 on the third network device side, and / or the input / output interface can also be used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the third network device side.
[0297] For example, the above method embodiment is implemented as a chip Figure 4aTaking the function of the third network device as an example, the input / output interface can be used to execute S405 and S406 on the third network device side, and / or the input / output interface can also be used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the third network device side.
[0298] In the case where the fourth terminal device is implemented as the terminal device 2 or the terminal device 3, for example, the above method embodiment is implemented as a chip Figure 2a Taking the functions of the terminal device 2 as an example, the input / output interface can be used to execute S201 on the terminal device 2 side in the embodiment of the present application, and / or the input / output interface can also be used to execute other sending and receiving steps on the terminal device 2 side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the terminal device 2 side in the embodiment of the present application.
[0299] For example, the chip is implemented as the above method embodiment Figure 3a Taking the functions of the terminal device 2 as an example, the input and output interface can be used to execute S303 on the terminal device 2 side, and / or the input and output interface can also be used to execute other sending and receiving steps on the terminal device 2 side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the terminal device 2 side.
[0300] For example, the above method embodiment is implemented as a chip Figure 4a Taking the functions of the terminal device 2 as an example, the input and output interface can be used to execute S403 on the terminal device 2 side, and / or the input and output interface can also be used to execute other sending and receiving steps on the terminal device 2 side in the embodiment of the present application. The logic circuit can be used to execute other processing steps on the terminal device 2 side.
[0301] As another possible embodiment, Figure 5 1 shows a schematic structural diagram of a communication device 500. The communication device 500 includes a receiving unit 504, a sending unit 503 and a processing unit 502.
[0302] In the case where the first terminal device is implemented as the terminal device 1, for example, the communication device 500 is used as the embodiment of the above method. Figure 2a Taking the terminal device 1 as an example, the sending unit 503 performs other sending and receiving steps on the terminal device 1 side. The receiving unit 504 performs S203 and S208 on the terminal device 1 side, and / or the receiving unit 504 is also used to perform other sending and receiving steps on the terminal device 1 side in the embodiment of the present application. The processing unit 502 is used to perform other processing steps on the terminal device 1 side in the embodiment of the present application.
[0303] For example, the communication device 500 is used as the embodiment of the above method. Figure 3aTaking the terminal device 1 as an example, the sending unit 503 executes S302 on the terminal device 1 side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the terminal device 1 side in the embodiment of the present application. The receiving unit 504 executes other sending and receiving steps on the terminal device 1 side. The processing unit 502 is used to execute S301 on the terminal device 1 side in the embodiment of the present application, and / or the sending unit 503 is also used to execute other sending and receiving steps on the terminal device 1 side in the embodiment of the present application.
[0304] For example, the communication device 500 is used as the embodiment of the above method. Figure 4a Taking the terminal device 1 as an example, the sending unit 503 executes S402 on the terminal device 1 side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the terminal device 1 side in the embodiment of the present application. The receiving unit 504 executes other sending and receiving steps on the terminal device 1 side. The processing unit 502 is used to execute S401 on the terminal device 1 side in the embodiment of the present application, and / or the sending unit 503 is also used to execute other sending and receiving steps on the terminal device 1 side in the embodiment of the present application.
[0305] For the first network device, for example, the communication device 500 is used as the embodiment of the above method. Figure 2a Taking the first network device as an example, the sending unit 503 executes S203 and S208 on the first network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The receiving unit 504 executes S201 and S207 on the first network device side, and / or the receiving unit 504 is also used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The processing unit 502 is used to execute S202 on the first network device side in the embodiment of the present application, and / or the processing unit 502 is also used to execute other processing steps on the first network device side in the embodiment of the present application.
[0306] For example, the communication device 500 is used as the embodiment of the above method. Figure 3a Taking the first network device as an example, the sending unit 503 executes S303 and S304 on the first network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The receiving unit 504 executes S302 on the first network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The processing unit 502 is used to execute other sending and receiving steps on the first network device side in the embodiment of the present application.
[0307] For example, the communication device 500 is used as the embodiment of the above method. Figure 4aTaking the first network device as an example, the sending unit 503 executes S403 and S404 on the first network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The receiving unit 504 executes S402 on the first network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the first network device side in the embodiment of the present application. The processing unit 502 is used to execute other sending and receiving steps on the first network device side in the embodiment of the present application.
[0308] For the third network device, for example, the communication device 500 is used as the embodiment of the above method. Figure 2a Taking the third network device as an example, the sending unit 503 executes S206 on the third network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The receiving unit 504 executes S204 on the third network device side, and / or the receiving unit 504 is also used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The processing unit 502 is used to execute S205 on the third network device side in the embodiment of the present application, and / or the processing unit 502 is also used to execute other processing steps on the third network device side in the embodiment of the present application.
[0309] For example, the communication device 500 is used as the embodiment of the above method. Figure 3a Taking the third network device as an example, the sending unit 503 executes S306 on the third network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The receiving unit 504 executes S305 on the third network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The processing unit 502 is used to execute other sending and receiving steps on the third network device side in the embodiment of the present application.
[0310] For example, the communication device 500 is used as the embodiment of the above method. Figure 4a Taking the third network device as an example, the sending unit 503 executes S406 on the third network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The receiving unit 504 executes S405 on the third network device side, and / or the sending unit 503 is also used to execute other sending and receiving steps on the third network device side in the embodiment of the present application. The processing unit 502 is used to execute other sending and receiving steps on the third network device side in the embodiment of the present application.
[0311] In the case where the fourth terminal device is implemented as the terminal device 2 or the terminal device 3, for example, the communication device 500 is used as the embodiment of the above method. Figure 2aTaking terminal device 2 as an example, the sending unit 503 performs other sending and receiving steps on the terminal device 2 side. The receiving unit 504 performs S201 on the terminal device 2 side, and / or the receiving unit 504 is also used to perform other sending and receiving steps on the terminal device 2 side in the embodiment of the present application. The processing unit 502 is used to perform other processing steps on the terminal device 2 side in the embodiment of the present application.
[0312] For example, the communication device 500 is used as the embodiment of the above method. Figure 3a Taking terminal device 2 as an example, the sending unit 503 performs other sending and receiving steps on the terminal device 2 side. The receiving unit 504 performs S303 on the terminal device 2 side, and / or the receiving unit 504 is also used to perform other sending and receiving steps on the terminal device 2 side in the embodiment of the present application. The processing unit 502 is used to perform other sending and receiving steps on the terminal device 2 side in the embodiment of the present application.
[0313] For example, the communication device 500 is used as the embodiment of the above method. Figure 4a Taking terminal device 2 as an example, the sending unit 503 performs other sending and receiving steps on the terminal device 2 side. The receiving unit 504 performs S403 on the terminal device 2 side, and / or the sending unit 503 is also used to perform other sending and receiving steps on the terminal device 2 side in the embodiment of the present application. The processing unit 502 is used to perform other sending and receiving steps on the terminal device 2 side in the embodiment of the present application.
[0314] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0315] It should be understood that the processing unit 502 in the embodiment of the present application can be implemented by a processor or a processor-related circuit component, the sending unit 503 can be implemented by a transmitter or a transmitter-related circuit component, and the receiving unit 504 can be implemented by a receiver or a receiver-related circuit component.
[0316] Optionally, the communication device 500 may further include a storage unit 501 for storing program codes and data of the communication device 500 . The data may include but is not limited to original data or intermediate data.
[0317] The processing unit 502 may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0318] The sending unit 503 may be a communication interface, a transmitter, a sending circuit, etc. The receiving unit 504 may be a communication interface, a receiver, a receiving circuit, etc. The communication interface is a general term, and in a specific implementation, the communication interface may include multiple interfaces.
[0319] The storage unit 501 may be a memory.
[0320] When the processing unit 502 is a processor, the sending unit 503 is a transceiver, the receiving unit 504 is a transceiver, and the storage unit 501 is a memory, the communication device 600 involved in the embodiment of the present application can be Figure 6 shown.
[0321] See Figure 6 As shown, the communication device 600 includes: a processor 602 , a transceiver 603 , and a memory 601 .
[0322] The transceiver 603 may be a standalone transmitter that can be used to send information to other devices, or a standalone receiver that can be used to receive information from other devices. The transceiver may also be a component that integrates the functions of sending and receiving information. The embodiments of the present application do not limit the specific implementation of the transceiver.
[0323] Optionally, the communication device 600 may further include a bus 604. The transceiver 603, the processor 602, and the memory 601 may be interconnected via the bus 604; the bus 604 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 604 may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0324] Those skilled in the art will appreciate that the above embodiments can be implemented in whole or in part through software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0325] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical or other forms.
[0326] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network devices. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0327] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each functional unit may exist independently, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0328] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general-purpose hardware, or of course by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, hard disk or optical disk, and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0329] The above is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection of the claims.
Claims
1. A method of collective communication, characterized in that: include: The first terminal device receives at least one second message from the first network device, wherein the second message includes information about a first process and information about a network device corresponding to the first process, the first process being used to execute a first task, and the information about the network device corresponding to the first process being information about the network device to which the terminal device where the first process is located belongs; The first terminal device determines a third message based on the at least one second message, wherein the third message includes information of a target network device and information of all first processes executing the first task corresponding to the target network device, and the target network device is at least one of the network devices corresponding to the first task; The first terminal device sends the third message to the first network device.
2. The method according to claim 1, characterized in that The target network devices are all network devices corresponding to the first task; The first terminal device determines a third message according to the at least one second message, including: When the number of the at least one second message is a target value, the first terminal device determines the third message based on the at least one second message, wherein the target value indicates the number of all terminal devices where the first process executing the first task is located.
3. The method according to claim 1, characterized in that The target network device is one of the network devices corresponding to the first task; The first terminal device determines a third message according to the at least one second message, including: When the number of the at least one second message is a target value, the first terminal device determines the third message based on the target message in the at least one second message, wherein the target value indicates the number of all terminal devices where the first process executing the first task is located, and the target message belongs to the at least one second message and carries information of the same target network device.
4. The method according to any one of claims 1 to 3, characterized in that The third message further includes first information, wherein the first information includes at least one quantity value, and the number of the quantity values is consistent with the number of the target network devices and has a one-to-one correspondence; Among them, the first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process for executing the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the target network device corresponding to the first quantity value.
5. The method according to any one of claims 1 to 4, characterized in that The third message also includes second information, where the second information indicates that the type of the third message is a notification message.
6. The method according to claim 5, characterized in that The second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
7. The method according to any one of claims 1 to 6, characterized in that The second message also includes third information, where the third information indicates that the second message includes information about the network device corresponding to the first process.
8. The method according to claim 7, characterized in that The third information includes the second field in the second message, and the value of the second field in the second message is a second preset value.
9. The method according to any one of claims 1 to 8, characterized in that The second message further includes fourth information, where the fourth information indicates that the type of the second message is a query message.
10. The method according to claim 9, characterized in that The fourth information includes the first field in the second message, and the value of the first field in the second message is a third preset value.
11. The method according to any one of claims 1 to 10, characterized in that The third message meets the protocol format of Remote Direct Memory Access RoCE of Converged Ethernet; And / or, the second message meets the protocol format of the RoCE.
12. A method of collective communication, characterized in that: include: The fourth terminal device sends a first message to the fourth network device, wherein the first message includes at least information about a first process, the first process is deployed on the fourth terminal device, and the first process is used to execute a first task; The fourth terminal device receives a third message from the fourth network device, where the third message includes at least information about the fourth network device and information about all first processes executing the first task corresponding to the fourth network device.
13. The method according to claim 12, characterized in that The third message also includes information about the fifth network device and information about all first processes executing the first task corresponding to the fifth network device; The fifth network device is all network devices corresponding to the first task except the fourth network device.
14. The method according to claim 12 or 13, characterized in that The third message further includes first information, wherein the first information includes at least one quantity value, and the number of the quantity values is consistent with the number of network devices corresponding to the first task, and has a one-to-one correspondence; Among them, the first quantity value indicates the number of terminal devices in the terminal device set that are deployed with the first process for executing the first task, the first quantity value is one of the at least one quantity value, and the terminal devices in the terminal device set belong to the network device corresponding to the first quantity value.
15. The method according to any one of claims 12 to 14, characterized in that The third message also includes second information, where the second information indicates that the type of the third message is a notification message.
16. The method according to claim 15, characterized in that The second information includes the first field in the third message, and the value of the first field in the third message is a first preset value.
17. The method according to any one of claims 12 to 16, characterized in that The first message includes fifth information, and the fifth information indicates that the first message does not carry information of the fourth network device.
18. The method according to claim 17, characterized in that The fifth information includes the second field in the first message, and the value of the second field in the first message is a fourth preset value.
19. The method according to any one of claims 12 to 16, characterized in that The first message also includes information about the fourth network device.
20. The method according to any one of claims 12 to 19, characterized in that The first message further includes sixth information, and the sixth information indicates that the type of the first message is a query message.
21. The method according to claim 20, characterized in that The sixth information includes the first field in the first message, and the value of the first field in the first message is a third preset value.
22. The method according to any one of claims 12 to 21, characterized in that The third message meets the protocol format of Remote Direct Memory Access RoCE of Converged Ethernet; And / or, the first message meets the protocol format of the RoCE.
23. A communication device, characterized in that: It includes a sending unit, a receiving unit and a processing unit; wherein, The receiving unit is configured to receive at least one second message from a first network device, wherein the second message includes information about a first process and information about a network device corresponding to the first process, the first process being configured to execute a first task, and the information about the network device corresponding to the first process being information about a network device to which a terminal device where the first process is located belongs; The processing unit is configured to determine a third message based on the at least one second message, wherein the third message includes information of a target network device and information of all first processes executing the first task corresponding to the target network device, and the target network device is at least one of the network devices corresponding to the first task; The sending unit is configured to send the third message to the first network device.
24. A communication device, characterized in that: It includes a sending unit and a receiving unit; wherein, The sending unit is configured to send a first message to the fourth network device, wherein the first message includes at least information about a first process, the first process is deployed in the communication device, and the first process is used to execute a first task; The receiving unit is configured to receive a third message from the fourth network device, where the third message includes at least information about the fourth network device and information about all first processes executing the first task corresponding to the fourth network device.
25. A communication device, characterized in that: include: A processor and a memory, wherein the processor and the memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the collective communication method according to any one of claims 1 to 11 is executed.
26. A chip, characterized in that: The chip includes a logic circuit and an input / output interface, the input / output interface is used to communicate with a module outside the chip, and the logic circuit is used to run a computer program or instruction to control the first terminal device to execute the collective communication method as described in any one of claims 1 to 11.
27. A communication device, characterized in that: include: A processor and a memory, the processor and the memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the collective communication method according to any one of claims 12 to 22 is executed.
28. A chip, characterized in that: The chip includes a logic circuit and an input / output interface, the input / output interface is used to communicate with a module outside the chip, and the logic circuit is used to run a computer program or instruction to control the fourth terminal device to execute the collective communication method as described in any one of claims 12 to 22.
29. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program, and when the program is called by the processor, the collective communication method described in any one of claims 1 to 11 is executed, or the collective communication method described in any one of claims 12 to 22 is executed.
Citation Information
Patent Citations
Collective communication method based on physical location awareness
CN105391658A
A recursion-based parallel fast Fourier transform communication optimization method and system
CN109840306A