Method, device, chip, switching node and system for realizing set communication

By extending the communication protocol, a request message containing data to be computed and communication node information is generated, which solves the problem of inefficient collective communication in large-scale distributed technology and realizes the acceleration of collective communication.

CN119603365APending Publication Date: 2025-03-11BEIJING SILICARISETECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411749748.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the distributed technology of large models, the efficiency of set communication is limited by the communication overhead between distributed nodes, especially the inefficiency of set communication of the specification type and the full specification type.

Method used

By extending the communication protocol, a request message including a first extension field is generated. The first extension field carries the data amount of data to be calculated and the information of the communication node. The exchange node performs data processing and response message generation based on these information.

Benefits of technology

The amount of data transmission during the collective communication process is reduced, the efficiency of collective communication is improved, and the acceleration of collective communication is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603365A_ABST
    Figure CN119603365A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method, a device, a chip, a switching node and a system for realizing set communication. The method can be applied to a chip, and comprises the following steps: acquiring to-be-operated data corresponding to a communication node and a preset set communication parameter; a request message is generated based on the to-be-operated data and a preset set communication parameter, the request message comprises a first extension field, and the first extension field at least carries the data volume of the to-be-operated data and the information of the communication node; and sending the request message to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result. According to the embodiment of the invention, the efficiency of set communication can be improved, and the acceleration of set communication is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to artificial intelligence technology and communication technology, and in particular to a method, device, chip, switching node and system for implementing collective communication. Background Art

[0002] A large model refers to a model with a very large number of parameters. Large models are widely used in tasks such as speech recognition, image processing, and natural language processing.

[0003] At present, the parameter scale of large models is getting larger and larger, and the reasoning and training of large models are increasingly dependent on distributed technology to improve computing power. The overhead of distributed technology has become one of the bottlenecks limiting the improvement of reasoning and training efficiency of large models. The overhead of distributed technology is mainly reflected in the collective communication between distributed nodes. Summary of the invention

[0004] The present disclosure provides a method, device, chip, switching node and system for implementing collective communication, so as to improve the efficiency of collective communication and achieve acceleration of collective communication.

[0005] According to one aspect of an embodiment of the present disclosure, a method for implementing collective communication is provided, which is applied to a chip and includes:

[0006] Obtaining the data to be calculated and the preset set communication parameters corresponding to the communication node;

[0007] Generate a request message based on the data to be calculated and the preset set communication parameter, wherein the request message includes a first extension field, and the first extension field carries at least the amount of the data to be calculated and the information of the communication node;

[0008] The request message is sent to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result.

[0009] According to another aspect of an embodiment of the present disclosure, a method for implementing collective communication is provided, which is applied to a switching node and includes:

[0010] Obtaining request messages of at least two communication nodes, where at least two of the communication nodes are located in at least two chips, the request message comprising a first extension field, the first extension field carrying a collective communication parameter, and the request message carrying data to be calculated;

[0011] Performing data processing based on the request message to obtain a data processing result;

[0012] Based on the data processing result, a response message is sent to the communication node.

[0013] According to another aspect of an embodiment of the present disclosure, there is provided a device for implementing collective communication, which is applied to a chip and includes:

[0014] A first acquisition module, used to acquire data to be calculated and preset set communication parameters corresponding to a communication node, the number of the communication nodes is at least two, and at least two of the communication nodes are located in at least two of the chips;

[0015] A generating module, configured to generate a request message based on the data to be calculated and the preset set communication parameter, wherein the request message includes a first extension field, and the first extension field carries at least the amount of the data to be calculated and the information of the communication node;

[0016] The first sending module is used to send the request message to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result.

[0017] According to another aspect of an embodiment of the present disclosure, there is provided an apparatus for implementing collective communication, which is applied to a switching node and includes:

[0018] A second acquisition module, configured to acquire request messages of at least two communication nodes, where at least two of the communication nodes are located in at least two chips, the request message comprises a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated;

[0019] A processing module, used to perform data processing based on the request message to obtain a data processing result;

[0020] The second sending module is used to send a response message to the communication node based on the data processing result.

[0021] According to another aspect of the embodiments of the present disclosure, a chip is provided, including a communication node, a memory, and a collective communication control unit; wherein,

[0022] The collective communication control unit is used to obtain the to-be-calculated data and the preset collective communication parameters corresponding to the communication nodes from the memory, the number of the communication nodes is at least two, and at least two of the communication nodes are located in at least two of the chips;

[0023] One of the collective communication control unit and the communication node is used to generate a request message based on the data to be calculated and the preset collective communication parameter, wherein the request message includes a first extension field, and the first extension field carries at least the data amount of the data to be calculated and the information of the communication node;

[0024] The communication node is used to send the request message to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result.

[0025] According to another aspect of the embodiment of the present disclosure, a switching node is provided, including a transceiver unit, a data processing unit and a message generating unit; wherein:

[0026] The transceiver unit is used to receive request messages from at least two communication nodes, where the at least two communication nodes are located in at least two chips, the request message includes a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated;

[0027] The data processing unit is used to perform data processing based on the request message to obtain a data processing result;

[0028] The message generating unit is used to generate a response message based on the data processing result;

[0029] The transceiver unit is used to send the response message generated by the message generation unit to the communication node.

[0030] According to another aspect of the embodiments of the present disclosure, a system for implementing collective communication is provided, including a switching node and a chip; wherein:

[0031] The chip is used to generate a request message corresponding to a communication node, and send the request message to the switching node, the number of the communication nodes is at least two, at least two of the communication nodes are located in at least two of the chips, the request message includes a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated;

[0032] The switching node is used to obtain the request message, perform data processing based on the request message to obtain a data processing result, and send a response message to the communication node based on the data processing result.

[0033] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute any of the above methods for implementing collective communication.

[0034] According to another aspect of the embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:

[0035] processor;

[0036] a memory for storing instructions executable by the processor;

[0037] The processor is used to read the executable instructions from the memory and execute the instructions to implement any of the above methods for implementing collective communication.

[0038] According to another aspect of an embodiment of the present disclosure, a computer program product is provided. When instructions in the computer program product are executed by a processor, any of the above methods for implementing collective communication is performed.

[0039] Based on the methods, devices, chips, switching nodes, systems, storage media, electronic devices and program products for implementing collective communication provided by the above embodiments of the present disclosure, the chip can generate a request message based on the data to be calculated corresponding to the communication node and the preset collective communication parameters, and send the request message to the switching node. It should be noted that by extending the communication protocol, the request message may include a first extension field to carry collective communication parameters such as the amount of data to be calculated, information of the communication node, etc., and through these collective communication parameters, the collective communication related information can be prompted to the switching node. Since the basis for generating the request message includes the data to be calculated, the data to be calculated can be provided to the switching node through the request message. It should be noted that each communication node participating in the collective communication can prompt the switching node with the relevant information of the collective communication and provide the data to be calculated to the switching node. On this basis, the switching node can run the collective communication acceleration logic to achieve a predetermined type of collective communication.

[0040] It can be seen that in the embodiments of the present disclosure, by extending the communication protocol and allowing each communication node to send a request message that complies with the extended communication protocol to the switching node respectively, and then combining the operation of the collective communication acceleration logic at the switching node, a predetermined type of collective communication can be achieved. In this process, the switching node does not need to forward data from certain communication nodes to other communication nodes. In the related technology, such data forwarding operations exist in large quantities. Therefore, the use of the embodiments of the present disclosure can reduce the amount of data transmission in the collective communication process, improve the efficiency of collective communication, and achieve acceleration of collective communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A system for implementing collective communication is provided by some exemplary embodiments of the present disclosure.

[0042] Figure 2 It is a flowchart of a method for implementing collective communication provided from the perspective of a chip according to some exemplary embodiments of the present disclosure.

[0043] Figure 3 It is a flowchart of a request message generation method provided by some exemplary embodiments of the present disclosure.

[0044] Figure 4It is a flowchart of a request message generation method provided by other exemplary embodiments of the present disclosure.

[0045] Figure 5-1 It is a flowchart of a message header generation method provided by some exemplary embodiments of the present disclosure.

[0046] Figure 5-2 is a schematic diagram of a first extension field in some exemplary embodiments of the present disclosure.

[0047] Figure 6 It is a flowchart of a message header generation method provided by other exemplary embodiments of the present disclosure.

[0048] Figure 7 Some exemplary embodiments of the present disclosure provide a flowchart of a method for implementing collective communication from the perspective of a switching node.

[0049] Figure 8 It is a flowchart of a method for obtaining data processing results provided by some exemplary embodiments of the present disclosure.

[0050] Fig. 9 It is a flowchart of a method for obtaining data processing results provided by other exemplary embodiments of the present disclosure.

[0051] Fig.10 It is a flowchart of a response message sending method provided by some exemplary embodiments of the present disclosure.

[0052] Fig.11 is a schematic diagram of the second extension field in some exemplary embodiments of the present disclosure.

[0053] Fig.12 It is a flowchart of a response message sending method provided by other exemplary embodiments of the present disclosure.

[0054] Figure 13-1 It is a flowchart of a response message sending method provided by some further exemplary embodiments of the present disclosure.

[0055] Figure 13-2 It is a flowchart of a response message sending method provided by some further exemplary embodiments of the present disclosure.

[0056] Fig.14 It is a flowchart of a method for obtaining data processing results provided by some further exemplary embodiments of the present disclosure.

[0057] Fig.15 It is a schematic diagram of the structure of a chip provided by some exemplary embodiments of the present disclosure.

[0058] Fig.16 is a schematic diagram of the structure of a switching node provided by some exemplary embodiments of the present disclosure.

[0059] Fig.17 It is a schematic diagram of the structure of an apparatus for implementing collective communication provided from the perspective of a chip according to some exemplary embodiments of the present disclosure.

[0060] Fig.18 It is a schematic diagram of the structure of the generation module in some exemplary embodiments of the present disclosure.

[0061] Fig.19 It is a schematic diagram of the structure of the generation module in some exemplary embodiments of the present disclosure.

[0062] Fig. 20 It is a structural diagram of an apparatus for implementing collective communication provided from the perspective of a switching node according to some exemplary embodiments of the present disclosure.

[0063] Fig.21 It is a schematic diagram of the structure of the processing module in some exemplary embodiments of the present disclosure.

[0064] Fig. 22 It is a schematic diagram of the structure of the processing module in some other exemplary embodiments of the present disclosure.

[0065] Fig.23 is a schematic diagram of the structure of the second sending module in some exemplary embodiments of the present disclosure.

[0066] Fig.24 It is a structural schematic diagram of the second sending module in some other exemplary embodiments of the present disclosure.

[0067] Fig.25 is a structural diagram of a second sending module in some further exemplary embodiments of the present disclosure.

[0068] Fig.26 It is a structural schematic diagram of a processing module in some further exemplary embodiments of the present disclosure.

[0069] Fig. 27 It is a schematic diagram of the structure of an electronic device provided by some exemplary embodiments of the present disclosure. DETAILED DESCRIPTION

[0070] To explain the present disclosure, example embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. It should be understood that the present disclosure is not limited to the example embodiments.

[0071] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.

[0072] Application Overview

[0073] A large model refers to a model with a very large number of parameters, such as a deep learning model with a very large number of parameters. A large model can be used to process large-scale data sets.

[0074] At present, the parameter scale of large models is getting larger and larger. The reasoning and training of large models are increasingly dependent on distributed technology to improve computing power. The overhead of distributed technology is mainly reflected in collective communication. Collective communication can be understood as a communication method in which all nodes in a specific group participate in the communication. There are many types of collective communication, such as:

[0075] a. Broadcast, that is, copying the data of a certain node to other nodes;

[0076] b. Gather, that is, merge and collect data from different nodes to a certain node so that the node can obtain data from all nodes;

[0077] c. Reduce, that is, perform operations such as summing, averaging, and extreme value calculations on the data at different nodes, and after obtaining the calculation results, summarize the calculation results to a certain node;

[0078] d. AllReduce, that is, perform operations such as summing, averaging, and extreme value calculations on the data at different nodes, and after obtaining the calculation results, send the calculation results to all nodes.

[0079] The inventors have found through research that in the related art, for the collective communication of the protocol type and the full protocol type (hereinafter referred to as the collective communication of the predetermined type for the sake of description), the overall data transmission volume is large, resulting in low efficiency of the collective communication and difficulty in meeting actual needs. How to improve the efficiency of collective communication is a problem worthy of attention for those skilled in the art.

[0080] Exemplary Systems

[0081] like Figure 1 As shown, the system architecture applicable to the embodiments of the present disclosure may include a switching node 12 and a chip 14; wherein the chip 14 may include a communication node 142, the number of the communication nodes 142 may be at least two, at least two communication nodes 142 may be located in at least two chips 14, and the interaction message between each communication node 142 participating in the collective communication and the switching node 12 may include an extension field, and the extension field may carry collective communication parameters.

[0082] Optionally, the at least two chips 14 may be, for example, two chips 14, three chips 14, four chips 14, etc. At least two chips 14 may be arranged on at least two boards, and there may be a one-to-one correspondence between the at least two chips 14 and the at least two boards, and any chip 14 and the board corresponding to the chip 14 may constitute an acceleration card. Each chip 14 may be, for example, an artificial intelligence (AI) chip. Each chip 14 may include, for example, four communication nodes 142, six communication nodes 142, eight communication nodes 142, etc. Each communication node 142 may be, for example, a peripheral component interconnect express (PCIE) node.

[0083] Optionally, the switching node 12 may be a node that supports collective communication acceleration logic and conventional switching logic; wherein the collective communication acceleration logic may be used for a predetermined type of collective communication, such as for a protocol type and a full protocol type of collective communication; and the conventional switching logic may be used for the remaining types of collective communication, such as for a broadcast type and an aggregation type of collective communication. The switching node 12 may be, for example, a switch. The switching node 12 may have computing capabilities, and data computing may be performed at the switching node 12. Each communication node 142 participating in the collective communication may perform message interaction with the switching node 12, wherein the interactive message sent by the communication node 142 to the switching node 12 may be referred to as a request message, and the interactive message sent by the switching node 12 to the communication node 142 may be referred to as a response message. Both the request message and the response message may include an extension field, and the extension field may carry collective communication parameters to assist in implementing the predetermined type of collective communication.

[0084] Exemplary Methods

[0085] The embodiments of the present disclosure provide a method for implementing collective communication from the perspective of a chip and a switch node. The following first introduces the method for implementing collective communication provided by the embodiments of the present disclosure from the perspective of a chip.

[0086] Figure 2 It is a flowchart of a method for implementing collective communication provided from the perspective of a chip according to some exemplary embodiments of the present disclosure. Figure 2 The illustrated method may include step 210 , step 220 , and step 230 .

[0087] Step 210, obtaining the data to be calculated and the preset set communication parameters corresponding to the communication nodes, the number of the communication nodes is at least two, and the at least two communication nodes are located in at least two chips.

[0088] It should be noted that the number of chips may be at least two, each of the at least two chips may include at least one communication node, and accordingly, the number of communication nodes may be at least two, and the at least two communication nodes may be located in the at least two chips. If there is no additional limitation, a communication node that appears separately below may be understood as any communication node of the at least two communication nodes.

[0089] Optionally, the data to be calculated corresponding to the communication node may refer to: data that needs to be transmitted to the switching node through the communication node for a predetermined type of collective communication so that the switching node can perform data calculation. The data type of the data to be calculated may include but is not limited to image type, feature map type, etc.

[0090] In one example, Figure 1 The at least two chips 14 shown in the figure may be two chips 14, and each of the two chips 14 may have four communication nodes 142. During the operation of the large model, feature graphs F1 and F2 of the same size are generated, and feature graphs F1 and F2 need to be summed. The summation operation may be, for example, an element-wise addition operation. Then, feature graph F1 may be split into four sub-feature graphs, namely, sub-feature graphs F1 and F2. 1 , sub-feature graph F1 2 , sub-feature graph F1 3 , sub-feature graph F1 4 ; Among them, the sub-feature map F1 1 It can be located in the upper left area of ​​feature map F1, sub-feature map F1 2 It can be located in the upper right area of ​​feature map F1, sub-feature map F1 3 It can be located in the lower left area of ​​feature map F1, sub-feature map F1 4 It can be located in the lower right area of ​​the feature map F1. Similarly, the feature map F2 can be split into four sub-feature maps, namely, sub-feature map F2 1 , sub-feature graph F2 2 , sub-feature graph F2 3 , sub-feature graph F2 4 ; Among them, sub-feature graph F2 1 It can be located in the upper left area of ​​feature map F2, sub-feature map F2 2 It can be located in the upper right area of ​​feature map F2, sub-feature map F2 3 It can be located in the lower left area of ​​feature map F2, sub-feature map F2 4 It can be located in the lower right area of ​​feature map F2. Sub-feature map F1 1The data to be calculated corresponding to the first communication node 142 in the chip 14 on the left of the two chips 14 can be allocated to the first communication node 142 in the chip 14 on the left as the data to be calculated corresponding to the first communication node 142 in the chip 14 on the left. The data to be calculated corresponding to the first communication node 142 in the chip 14 on the left can be stored in the memory included in the chip 14 on the left, and the data to be calculated corresponding to the first communication node 142 in the chip 14 on the left can be obtained from the memory later. Sub-feature graph F1 2 can be assigned to the second communication node 142 in the chip 14 on the left, as the to-be-operated data corresponding to the second communication node 142 in the chip 14 on the left. Similarly, the sub-feature graph F1 3 And sub-feature map F1 4 The third communication node 142 and the fourth communication node 142 in the chip 14 on the left can be assigned in sequence. The sub-feature graph F2 1 , sub-feature graph F2 2 , sub-feature graph F2 3 , sub-feature graph F2 4 The four communication nodes 142 in the chip 14 on the right may be sequentially allocated. As an example, the feature graph F1 and the feature graph F2 may be split equally.

[0091] Optionally, the preset collective communication parameters corresponding to the communication node may refer to: parameters preset for the communication node and applicable to the operation process of the collective communication acceleration logic. The preset collective communication parameters may include a plurality of preset parameters, each of which may be considered as a collective communication parameter.

[0092] Step 220: Generate a request message based on the data to be calculated and the preset set communication parameters, where the request message includes a first extension field, and the first extension field carries at least the amount of data to be calculated and information about the communication node.

[0093] In the related art, the interactive message between the chip and the switch node is generally a PCIE transport layer message. The PCIE transport layer message may also be referred to as a TLP. In the embodiments of the present disclosure, the PCIE protocol may be extended to form an extended PCIE protocol, and the extended PCIE protocol may support inserting an extended field for carrying collective communication parameters in a conventional PCIE transport layer message.

[0094] Optionally, based on the data to be calculated and the preset collective communication parameters, a request message including a first extension field can be generated according to the extended PCIE protocol, and the first extension field can carry at least the data volume of the data to be calculated and the information of the communication node. The data volume of the data to be calculated can be obtained by counting the data volume of the data to be calculated. The information of the communication node can be extracted from the preset collective communication parameters, and the information of the communication node can be used to indicate each communication node that needs to participate in the collective communication together.

[0095] Optionally, the number of request messages generated based on the data to be calculated and the preset set communication parameters can be at least two, wherein each request message can carry part of the data to be calculated, and at least two request messages can jointly carry all the data in the data to be calculated. As an example, if the amount of data to be calculated is 128KB, and a single request message can carry 4KB of data in the data to be calculated, then at least two request messages can be 128 / 4=32 request messages, and all the data in the data to be calculated can be carried through 32 request messages.

[0096] Step 230: Send a request message to the switch node, so that the switch node performs data processing based on the request message to obtain a data processing result.

[0097] Optionally, a request message corresponding to the communication node can be sent to the switching node through the communication node. For example, after at least two request messages are generated based on the data to be calculated and the preset set communication parameters, at least two request messages can be sequentially sent to the switching node through the communication node, and accordingly, the switching node can receive at least two request messages from the communication node. As described above, at least two request messages from the communication node can jointly carry all the data in the data to be calculated, so only when these data requests are obtained by the switching node can the switching node completely obtain the data to be calculated. Since the first extension field carries the amount of data to be calculated, the switching node can determine the total amount of data to be calculated obtained from the request message received from the communication node, and compare the total amount of data to be calculated with the amount of data to be calculated carried by the first extension field. If the comparison result indicates that the total amount of data to be calculated reaches the amount of data to be calculated carried by the first extension field, it can be determined that the switching node has completely obtained the data to be calculated corresponding to the communication node.

[0098] Since the first extension field also carries the information of the communication node, the switching node can determine other communication nodes that participate in the collective communication with the communication node. The switching node can use a method similar to that in the previous paragraph to determine whether the data to be calculated corresponding to the other communication nodes are completely obtained. If the data to be calculated corresponding to each communication node participating in the collective communication are completely obtained by the switching node, the switching node can obtain the calculation result data by performing data calculation on the data to be calculated, and the calculation result data can be used as the data processing result.

[0099] In an embodiment of the present disclosure, the chip can generate a request message based on the data to be calculated corresponding to the communication node and the preset collective communication parameters, and send the request message to the switching node. It should be noted that, by extending the communication protocol, the request message may include a first extension field to carry collective communication parameters such as the amount of data to be calculated, information of the communication node, etc., and through these collective communication parameters, the collective communication related information can be prompted to the switching node. Since the basis for generating the request message includes the data to be calculated, the data to be calculated can be provided to the switching node through the request message. It should be noted that each communication node participating in the collective communication can prompt the switching node with the collective communication related information and provide the data to be calculated to the switching node. On this basis, the switching node can run the collective communication acceleration logic to achieve a predetermined type of collective communication.

[0100] It can be seen that in the embodiments of the present disclosure, by extending the communication protocol and allowing each communication node to send a request message that complies with the extended communication protocol to the switching node respectively, and then combining the operation of the collective communication acceleration logic at the switching node, a predetermined type of collective communication can be achieved. In this process, the switching node does not need to forward data from certain communication nodes to other communication nodes. In the related technology, such data forwarding operations exist in large quantities. Therefore, the use of the embodiments of the present disclosure can reduce the amount of data transmission in the collective communication process, improve the efficiency of collective communication, and achieve acceleration of collective communication.

[0101] In some optional implementations of the present disclosure, the preset set communication parameters may include:

[0102] Communication node information;

[0103] Data precision format;

[0104] Data operation type;

[0105] First address information for storing operation result data;

[0106] The second address information is used to store the completion status of the collective communication.

[0107] Optionally, the information of the communication node can be used to indicate the various communication nodes that need to participate in the collective communication. Figure 1 For example, at least two chips 14 may have a rank_id respectively, and each communication node 142 in each chip 14 may have a ring_id respectively. The information of the communication node can be obtained through the combination of ring_id, rank_id, and nranks (the number of chips 14).

[0108] Optionally, the data precision format may include, but is not limited to, a fixed-point format, a floating-point format, etc. The fixed-point format may be, for example, int8, int16, int32, etc. The floating-point format may include, for example, float16, float32, etc. It is understood that int8 means that a fixed-point number is represented by 8 bits, int16 means that a fixed-point number is represented by 16 bits, int32 means that a fixed-point number is represented by 32 bits, float16 means that a floating-point number is represented by 16 bits, and float32 means that a floating-point number is represented by 32 bits. The data precision format may also be referred to as data_type.

[0109] Optionally, the data operation type may refer to: a specific type of data operation to be performed at the switch node, including but not limited to sum operation, mean operation, extreme value operation, multiplication operation, etc. The data operation type may also be referred to as op_type.

[0110] Optionally, the operation result data may refer to: a result obtained by the switch node through data operation. The first address information for storing the operation result data may also be called a recv buff address or recv buff addr. The chip may include a memory, and the space corresponding to the first address information may be a space in the memory included in the chip.

[0111] Optionally, the collective communication completion status may include but is not limited to a correct status (used to indicate that the collective communication is successfully completed), an error status (used to indicate that the collective communication is not successfully completed), etc. The second address information used to store the collective communication completion status may be referred to as a mailbox address or mailbox addr. The space corresponding to the second address information may be a space in a memory included in the chip, and the spaces corresponding to the first address information and the second address information may be different.

[0112] In the embodiments of the present disclosure, the information of the communication node, the data precision format, the data operation type, the first address information, and the second address information can respectively be used as a kind of collective communication parameter in the preset collective communication parameters. Obviously, the preset collective communication parameters include very rich collective communication parameters. Using the preset collective communication parameters as the basis for generating the request message is conducive to ensuring the richness and completeness of the collective communication parameters carried by the first extension field, thereby ensuring the normal operation of the collective communication acceleration logic.

[0113] Figure 3 It is a flowchart of a request message generation method provided by some exemplary embodiments of the present disclosure. Figure 3 The method shown may include step 310 and step 320. Optionally, the combination of step 310 and step 320 may be used as an optional implementation of step 220 of the present disclosure.

[0114] Step 310, determining the amount of data to be calculated.

[0115] Optionally, the amount of data to be calculated may also be referred to as the length of the data to be calculated or the len of the data to be calculated.

[0116] Step 320: Determine the target aggregate communication parameters based on the preset aggregate communication parameters and the amount of data to be calculated, and the first extended field carries at least a part of the target aggregate communication parameters.

[0117] Optionally, the target collective communication parameters may include preset collective communication parameters and the data volume of the data to be calculated. Then, the target collective communication parameters may include the information of the communication node, the data precision format, the data calculation type, the first address information for storing the calculation result data, the second address information for storing the collective communication completion status, and the data volume of the data to be calculated.

[0118] In some embodiments, the preset collective communication parameters may not include the data precision format, for example, only include the four collective communication parameters of the communication node information, the data operation type, the first address information, and the second address information. After obtaining the data to be operated, the data volume and the data precision format of the data to be operated can be determined in real time, and the target collective communication parameters including the determined data volume and data precision format and the four collective communication parameters in the preset collective communication parameters are obtained.

[0119] In the embodiments of the present disclosure, by integrating the data volume of the data to be calculated and the preset collective communication parameters, the target collective communication parameters can be obtained efficiently and quickly. Since the preset collective communication parameters include a very rich set of collective communication parameters, the richness and integrity of the target collective communication parameters can be better guaranteed. Since the first extended field carries at least part of the target collective communication parameters, the collective communication parameters carried by the first extended field are used in the operation process of the collective communication acceleration logic, which is conducive to ensuring the normal operation of the collective communication acceleration logic.

[0120] It should be noted that the composition of the preset collective communication parameters and the target collective communication parameters is not limited to the above examples. It is sufficient to ensure that the target collective communication parameters can effectively assist the operation of the collective communication acceleration logic, and they will not be listed one by one here.

[0121] Figure 4 It is a flowchart of a request message generation method provided by other exemplary embodiments of the present disclosure. Figure 4 The method shown may include step 410, step 420 and step 430. Optionally, the combination of step 410 to step 430 may be used as an optional implementation of step 220 of the present disclosure.

[0122] Step 410: Generate a first message header, where the first message header includes a first extension field.

[0123] In the related art, the message header of the interactive message between the chip and the switching node (which can be called a conventional message header) usually does not include an extension field, and the fields in the conventional message header are all non-extension fields. In the embodiment of the present disclosure, a first extension field for carrying at least part of the communication parameters of the target set can be inserted into the conventional message header, and the first extension field can be used as a prefix of the non-extension field, thereby obtaining a first message header. The first message header can be considered as a message header that complies with the extended PCIE protocol.

[0124] Step 420: Generate a first message body based on the data to be calculated.

[0125] Optionally, based on the data to be calculated, the first message body can be generated according to the extended PCIE protocol to obtain at least two first message bodies; wherein each first message body can carry part of the data to be calculated, and at least two first message bodies can jointly carry all of the data to be calculated. In order to adapt to the situation of generating at least two first message bodies, at least two first message headers can be generated in step 410 of the present disclosure; wherein the at least two first message headers can correspond one-to-one to the at least two first message bodies.

[0126] In some embodiments, an encryption strategy may be introduced during the generation of the first message body. For example, after determining the data to be carried by a first message body from the data to be calculated, the determined data may be encrypted to obtain encrypted data, and the first message body may be made to carry the encrypted data. In this way, it may be considered that the first message body carries part of the data to be calculated in the form of ciphertext.

[0127] Step 430: Generate a request message including a first message header and a first message body.

[0128] Optionally, by executing step 410 and step 420, at least two first message headers and at least two first message bodies can be generated, then the at least two first message headers and at least two first message bodies can be assembled to obtain at least two request messages; wherein each request message includes a first message header and a first message body corresponding to the first message header. The at least two request messages can be sent sequentially to the switching node through the communication node.

[0129] In the embodiment of the present disclosure, by extending the communication protocol, the first message header of the request message may include a first extension field for carrying at least part of the target collective communication parameters, so that the message header part of the request message can efficiently and reliably prompt the switching node with the collective communication related information. In addition, since the generation basis of the first message body is the data to be calculated, the data to be calculated can be efficiently and reliably provided to the switching node through the message body part of the request message.

[0130] Figure 5-1 It is a flowchart of a message header generation method provided by some exemplary embodiments of the present disclosure. Figure 5-1 The method shown may include step 510, step 520 and step 530. Optionally, the combination of step 510 to step 530 may be used as an optional implementation of step 410 of the present disclosure.

[0131] Figure 5-1 In the method shown, the number of request messages corresponding to each communication node is at least two. The at least two request messages can be divided into the first request message and the non-first request message. Assuming that the at least two request messages are R request messages, the number of the first request message is only one, and the number of the non-first request messages can be K-1. It should be noted that each request message can be regarded as a data packet, so the first request message can also be called the first packet, and the non-first request message can also be called the non-first packet.

[0132] Step 510 , determine whether the request message is the first request message; if so, execute step 520 ; if not, execute step 530 .

[0133] Step 520: Generate a first message header, where the first message header includes a first extension field, and the first extension field is used to carry all the collective communication parameters in the target collective communication parameters.

[0134] Step 530: Generate a first message header, where the first message header includes a first extension field, and the first extension field is used to carry part of the target collective communication parameters.

[0135] Optionally, if the request message is not the first request message, the set communication parameters to be omitted that meet the preset omission condition relative to the non-first request message can be determined from the target set communication parameters. The set communication parameters to be omitted may refer to: the set communication parameters that can be omitted relative to the non-first request message, and do not need to be carried in the first extension field included in the first message header of the non-first request message. As described above, the target set communication parameters may include information of the communication node, data precision format, data operation type, first address information, second address information, and the amount of data to be operated. Then, the second address information can be determined as the set communication parameter to be omitted. Alternatively, the data operation type can be determined as the set communication parameter to be omitted. Alternatively, the second address information and the data operation type can be determined as a set communication parameter to be omitted. For a non-first request message, when generating the first message header, the first extension field included in the first message header can be used to carry the set communication parameters in the target set communication parameters except the set communication parameters to be omitted.

[0136] In one example, for the first request message, when generating the first message header, the first extension field included in the first message header may include: Figure 5-2 TPL prefix 0 to TPL prefix 5 in; for non-first request message, when generating the first message header, the first extension field included in the first message header may only include Figure 5-2 TPL prefix 0 to TPL prefix 3. Among them, TPL prefix 0 and TPL prefix 1 can carry the information of the communication node (specifically ring_id, rank_id, nranks), data precision format (specifically data_type), data operation type (specifically op_type), and the amount of data to be calculated (specifically len). TPL prefix 2 and TPL prefix 3 can carry the first address information (specifically recv buff addr). TPL prefix 4 and TPL prefix 5 can carry the second address information (specifically mailbox addr). Obviously, for the first message header that is not the first request message, the mailbox address (that is, the second address information) can be omitted.

[0137] In an embodiment of the present disclosure, when generating the first message header, based on whether the request message to which the first message header belongs is the first request message, the parameters that need to be carried by the first extension field included in the first message header can be reasonably determined. For example, for the first request message, the first extension field included in the first message header can carry all the collective communication parameters in the target collective communication parameters, while for the non-first request message, the first extension field included in the first message header only needs to carry part of the collective communication parameters in the target collective communication parameters. In this way, it is helpful to reduce the amount of data of non-first request messages. Since the number of non-first request messages is usually large, this is helpful to reduce the amount of data that the communication node needs to transmit to the switching node, thereby helping to improve the efficiency of collective communication.

[0138] Figure 6 It is a flowchart of a message header generation method provided by other exemplary embodiments of the present disclosure. Figure 6 The method shown may include step 610, step 620 and step 630. Optionally, the combination of step 610 to step 630 may be used as an optional implementation of generating the first message header in step 410 of the present disclosure. Figure 6 In the method shown, the number of request messages corresponding to each communication node is at least two.

[0139] Step 610: Determine address offset information based on the message sorting identifier of the request message and the amount of data to be calculated.

[0140] Optionally, the message sorting identifier of the request message may be a sorting number, which is used to characterize the relative sorting in at least two request messages corresponding to the communication node. The amount of data to be calculated of the request message may refer to the amount of data carried by the first message body of the request message. The amount of data carried by the first message bodies of different request messages may be the same, for example, all are predetermined data amounts. The predetermined data amount may be, for example, 4KB.

[0141] As described above, in order to realize the transmission of the data to be calculated, it may be necessary to generate at least two request messages corresponding to the communication node, for example, to generate R request messages. The R request messages can be generated sequentially. For any request message to be generated, it can be determined that the request message is the number of the R request messages, and the address offset information is determined in combination with the predetermined data amount. For example, if the request message is the i-th request message among the R request messages, and the predetermined data amount is M, then (i-1)*M can be used as the address offset information.

[0142] Step 620: applying an offset to the first address information according to the address offset information to obtain third address information.

[0143] Step 630: Generate a first message header, where the first message header includes a non-extension field, and the non-extension field carries the third address information.

[0144] Optionally, the first address information may be represented as P1, and if (i-1)*M is used as the address offset information, P2=P1+(i-1)*M may be used as the third address information. After obtaining the third address information, the third address information may be written into any position of the non-extended field of the first message header that is suitable for accommodating the address information, so as to obtain the first message header carrying the third address information in the non-extended field.

[0145] In the embodiment of the present disclosure, in the first message header of the request message, the non-extended field can carry the third address information. Since the determination process of the third address information uses the message sorting identifier of the request message, the switch node can infer the message sorting identifier of the request message through certain calculations on the switching node side. In this way, it is helpful to clarify the distribution of the predetermined amount of data carried by the first message body of the request message in the entire data to be calculated, so as to achieve data order preservation and ensure the correctness of collective communication.

[0146] The following introduces a method for implementing collective communication provided from the perspective of a switching node according to an embodiment of the present disclosure.

[0147] Figure 7 Some exemplary embodiments of the present disclosure provide a flowchart of a method for implementing collective communication from the perspective of a switching node. Figure 7 The method shown may include step 710 , step 720 , and step 730 .

[0148] Step 710, obtaining request messages from at least two communication nodes, where the at least two communication nodes are located in at least two chips, the request message includes a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated.

[0149] Optionally, the generation method and composition of the request message can refer to the relevant introduction in the above text and will not be repeated here.

[0150] In one example, for a certain collective communication, the switch node may receive Figure 1 The R request messages from the first communication node 142 in the chip 14 on the left, and the R request messages from Figure 1 The R request messages of the first communication node 142 in the chip 14 on the right side are received, so that a total of 2R request messages can be obtained.

[0151] In another example, for a certain collective communication, the switching node may receive Figure 1R request messages from each of the four communication nodes 142 in the chip 14 on the left, and R request messages from Figure 1 The R request messages of each of the four communication nodes 142 in the chip 14 located on the right side in the figure can obtain 8R request messages in total.

[0152] Step 720: Perform data processing based on the request message to obtain a data processing result.

[0153] Optionally, based on the request messages of at least two communication nodes, the switching node can obtain the data to be calculated corresponding to each communication node participating in the collective communication, and by performing data calculations on the data to be calculated, calculation result data can be obtained, and the calculation result data can be used as the data processing result. Of course, the method of performing data processing based on the request message to obtain the data processing result is not limited to this, and examples will be given later.

[0154] In one example, for a certain collective communication, the switch node may receive Figure 1 The R request messages from the first communication node 142 in the chip 14 on the left, and the R request messages from Figure 1 In the example, there are R request messages for the first communication node 142 in the chip 14 on the right, so there can be a total of 2R request messages. Assuming that in the 2R request messages, the collective communication parameters carried by the first extension field of the first message header of each request message include a data operation type, and the data operation type is an element-by-element addition operation, then based on the 2R first message bodies included in the 2R request messages, the data to be operated corresponding to the first communication node 142 in the chip 14 on the left and the data to be operated corresponding to the first communication node 142 in the chip 14 on the right can be obtained, and the element-by-element addition operation is performed on the two acquired data to be operated to obtain the operation result data.

[0155] Step 730: Send a response message to the communication node based on the data processing result.

[0156] Optionally, if the type of collective communication is Reduce, based on the data processing result, a response message may be sent to only one of the at least two communication nodes, and the specific communication node to which the response message is sent may be pre-configured. If the type of collective communication is AllReduce, based on the data processing result, a response message may be sent to each of the at least two communication nodes.

[0157] In some embodiments, the response message in step 730 may be a response message carrying operation result data, which may also be referred to as a response data packet. In other embodiments, the response message in step 730 may be a response message carrying a collective communication completion status.

[0158] In an embodiment of the present disclosure, a switching node can obtain request messages from at least two communication nodes. Based on the collective communication parameters carried by the first extended field included in the request message and the data to be calculated carried by the request message, the switching node can perform data processing, and then the switching node can send a response message to the communication node based on the obtained data processing result. In this way, by extending the communication protocol and allowing each communication node to send a request message that complies with the extended communication protocol to the switching node respectively, combined with the operation of the collective communication acceleration logic at the switching node, a predetermined type of collective communication can be achieved. In this process, the switching node does not need to forward data from some communication nodes to other communication nodes. In the related art, such data forwarding operations exist in large quantities. Therefore, the use of the embodiments of the present disclosure can reduce the amount of data transmission in the collective communication process, improve the efficiency of collective communication, and achieve the acceleration of collective communication.

[0159] Figure 8 It is a flowchart of a method for obtaining data processing results provided by some exemplary embodiments of the present disclosure. Figure 8 The method shown may include step 810, step 820, step 830 and step 840. Optionally, a combination of step 810 to step 840 may be used as an optional implementation of step 720 of the present disclosure. Figure 8 In the method shown, the number of request messages corresponding to each communication node is at least two.

[0160] Step 810: for any request message of the communication node, based on the corresponding collective communication parameter, determine the first address information corresponding to the communication node, where the first address information is used to store the calculation result data.

[0161] Optionally, the collective communication parameter carried by the first message header of the request message is the collective communication parameter corresponding to the request message. The collective communication parameter corresponding to the request message may include the first address information corresponding to the communication node, so the first address information corresponding to the communication node can be directly extracted from the collective communication parameter corresponding to the request message.

[0162] Step 820: determine address offset information between third address information and the first address information, where the third address information is located in a non-extended field of the request message.

[0163] Optionally, the third address information in the non-extended field of the request message can be represented as P2, and the first address information corresponding to the communication node can be represented as P1, then the address offset information between the third address information and the first address information corresponding to the communication node can be δP=P2-P1.

[0164] Step 830: Determine a message sorting identifier of the request message based on the address offset information and the amount of data to be calculated of the request message.

[0165] Optionally, the amount of data to be calculated in the request message may be the predetermined amount of data mentioned above.

[0166] In an example, the address offset information can be expressed as δP, and the predetermined data volume can be expressed as M. Then, δP can be divided by M to obtain a division result, which can be an integer. Then, the division result can be added to 1 to obtain an addition result, which can be used as the message sorting identifier of the request message. Figure 6 It can be seen from the illustrated embodiment that the addition result may specifically be i mentioned above.

[0167] It should be noted that Figure 6 In the illustrated embodiment, (i-1)*M may not be used as the address offset information. For example, i*M may be used as the address offset information. Accordingly, after obtaining the division result in the above paragraph, there is no need to add the division result to 1. The division result may be directly used as the message sorting identifier of the request message.

[0168] Step 840, performing data processing based on the message sorting identifier and the data to be calculated to obtain a data processing result.

[0169] In one example, for a certain collective communication, the switch node may receive Figure 1 The R request messages of the first communication node 142 in the chip 14 on the left side in FIG. 1 may be referred to as the first group of request messages. The switching node may also receive R request messages from Figure 1The R request messages of the first communication node 142 in the chip 14 located on the right side in the first group of request messages can be referred to as the second group of request messages. By executing steps 810 to 830, the message sorting identifiers corresponding to the R request messages in the first group of request messages can be determined, and the message sorting identifiers corresponding to the R request messages in the second group of request messages can be determined. Assuming that the 4KB data carried by the first message body of the request message with the message sorting identifier i in the first group of request messages is represented as D1, and the 4KB data carried by the first message body of the request message with the message sorting identifier i in the second group of request messages is represented as D2, then data operation can be performed on D1 and D2 to obtain operation result sub-data. Assuming that the 4KB data carried by the first message body of the request message with the message sorting identifier j in the first group of request messages is represented as D3, and the 4KB data carried by the first message body of the request message with the message sorting identifier j in the second group of request messages is represented as D4, then data operation can be performed on D3 and D4 to obtain operation result sub-data. All operation result sub-data can form operation result data. The operation result data can be used as data processing results.

[0170] In the embodiments of the present disclosure, for any request message of a communication node, the address offset information can be calculated in combination with the corresponding first address information and third address information. Combined with the amount of data to be calculated in the request message, the message sorting identifier of the request message can be determined efficiently and quickly. The data calculation process can refer to the determined message sorting identifier, which is conducive to maintaining the order of data and ensuring the correct implementation of collective communication.

[0171] In some optional examples, after receiving each request message, the switching node can obtain a predetermined amount of data from the first message body of the request message and cache it, record the specific cache location of the data, record the message sorting identifier corresponding to the data message, and can respectively record the total amount of data cached from each communication node, thereby forming a data status management table. As the switching node continues to receive request messages, the data status management table can be continuously updated.

[0172] Fig. 9 It is a flowchart of a method for obtaining data processing results provided by other exemplary embodiments of the present disclosure. Fig. 9 The method shown may include step 910, step 920, step 930, step 940 and step 950. Optionally, a combination of step 910 to step 950 may be used as an optional implementation of step 720 of the present disclosure.

[0173] Step 910: Determine a first data precision format corresponding to the data to be operated based on the aggregate communication parameters.

[0174] Optionally, the collective communication parameters carried by the first extension field may include a data precision format, and the data precision format may be extracted from the first extension field, and the extracted data precision format may be used as the first data precision format corresponding to the data to be calculated.

[0175] Step 920, determining a second data precision format supported by a computing unit, where the computing unit is located in a switch node.

[0176] Optionally, the operation unit located in the switching node may refer to: a hardware unit in the switching node for performing data operations. The operation unit is usually unable to perform data operations on data of all data precision formats, but can only perform data operations on data of certain data precision formats, which are the second data precision formats supported by the operation unit.

[0177] Step 930, determine whether the first data precision format matches the second data precision format; if they match, execute step 940; if they do not match, execute step 950.

[0178] Step 940, calling the operation unit to perform data operation on the operation data to obtain operation result data;

[0179] Step 950: The operation unit does not perform data operation on the data to be operated.

[0180] In the embodiments of the present disclosure, it can be determined whether the first data precision format is the same as the second data precision format. If the first data precision format is the same as the second data precision format, it can be determined that the first data precision format matches the second data precision format, and the operation unit can perform data operation on the data to be operated. Then, the operation unit can be called to perform data operation on the data to be operated to obtain operation result data. If the first data precision format is not the same as the second data precision format, it can be determined that the first data precision format does not match the second data precision format, and the operation unit cannot perform data operation on the data to be operated. Then, the operation unit does not perform data operation.

[0181] In one example, for a certain collective communication, the switch node may receive Figure 1 The R request messages from the first communication node 142 in the chip 14 on the left, and the R request messages from Figure 1The R request messages of the first communication node 142 in the chip 14 located on the right side, so there can be a total of 2R request messages. Assuming that the first message body of each request message in the 2R request messages carries 4KB of data, 2R*4KB data can be obtained from the 2R first message bodies included in the 2R request messages. In addition, assuming that the collective communication parameters carried by the first extension field of the first message header of each request message in the 2R request messages all include a data precision format, and the data precision format is int8, int8 can be used as the first data precision format. If the second data precision format supported by the operation unit is int8, the operation unit can be called to perform data operations on the above 2R*4KB data. If the second data precision format supported by the operation unit is different from int8, the operation unit does not perform data operations.

[0182] In the embodiments of the present disclosure, the consistency of the first data precision format corresponding to the data to be operated and the second data precision format supported by the operation unit in the switching node can be compared. If the two are consistent, data operation will be performed on the data to be operated. This is conducive to ensuring the normal execution of data operation, thereby ensuring the normal operation of the collective communication acceleration logic.

[0183] Fig.10 It is a flowchart of a response message sending method provided by some exemplary embodiments of the present disclosure. Fig.10 The method shown may include step 1010, step 1020, step 1030, step 1040 and step 1050. Optionally, a combination of step 1010 to step 1050 may be used as an optional implementation of step 730 of the present disclosure. Fig.10 The method shown may be executed after obtaining the operation result data by executing step 940 .

[0184] Step 1010, determine the response message receiving node.

[0185] Optionally, the response message receiving node may be determined from at least two communication nodes. If the type of collective communication is Reduce, a communication node among the at least two communication nodes may be determined as the response message receiving node, and the specific communication node used as the response message receiving node may be pre-configured. If the type of collective communication is AllReduce, each of the at least two communication nodes may be used as a response message receiving node.

[0186] Step 1020: Determine first address information corresponding to the response message receiving node based on the collective communication parameters, where the first address information is used to store the calculation result data.

[0187] Optionally, in the request message corresponding to the response message receiving node, the collective communication parameters carried by the first extended field may include first address information corresponding to the response message receiving node. Then, the first address information corresponding to the response message receiving node may be directly extracted from the first extended field.

[0188] Step 1030: Generate a second message header, where the second message header includes a second extension field, and the second extension field carries the first address information.

[0189] Optionally, according to the extended PCIE protocol, a second extended field carrying first address information corresponding to the response message receiving node may be inserted into a conventional message header to obtain a second message header.

[0190] Step 1040: Generate a second message body based on the calculation result data.

[0191] Optionally, the specific implementation of step 1040 may refer to the above description of step 420 and will not be repeated here.

[0192] Step 1050: Send a first response message to the response message receiving node, where the first response message includes a second message header and a second message body.

[0193] Optionally, by executing step 1030 and step 1040, at least two second message headers and at least two second message bodies can be generated; wherein, the at least two second message headers and the at least two second message bodies can correspond to each other one by one. Then, the at least two second message headers and the at least two second message bodies can be assembled to obtain at least two first response messages; wherein, each first response message includes a second message header and a second message body corresponding to the second message header. In an example, the second extension field included in each second message header can refer to Fig.11 , which carries recv buff addr. Each first response message can be called a response data packet.

[0194] Next, at least two first response messages may be sequentially sent to the response message receiving node. The chip to which the response message receiving node belongs may obtain operation result data based on at least two second message bodies included in the at least two received first response messages, and obtain first address information corresponding to the response message receiving node based on at least two second message headers included in the at least two received response messages, and store the operation result data in a space corresponding to the first address information in a memory included in the chip.

[0195] In the embodiments of the present disclosure, by determining the second message header and the second message body and performing message assembly, the first response message can be obtained efficiently and quickly, and the first response message can be sent to the response message receiving node, and the calculation result data can be provided to the chip to which the response message receiving node belongs. In this way, the entire process of collective communication can be completed.

[0196] Fig.12 It is a flowchart of a response message sending method provided by other exemplary embodiments of the present disclosure. Fig.12 The method shown may include step 1210, step 1220, step 1230 and step 1240. Optionally, a combination of step 1210 to step 1240 may be used as an optional implementation of step 730 of the present disclosure. Fig.12 The method shown may be performed after step 1050 of the present disclosure.

[0197] Step 1210: Determine second address information corresponding to the response message receiving node based on the collective communication parameters, where the second address information is used to store the collective communication completion status.

[0198] Optionally, in the request message corresponding to the response message receiving node, the collective communication parameters carried by the first extended field may include the second address information corresponding to the response message receiving node. Then, the second address information corresponding to the response message receiving node may be directly extracted from the first extended field.

[0199] Step 1220: Generate a third message header, where the third message header includes a third extension field, and the third extension field carries the second address information.

[0200] Optionally, the specific implementation of step 1220 may refer to the above description of step 1030 and will not be repeated here.

[0201] Step 1230: Generate a third message body, the third message body carries the aggregate communication completion status, and the aggregate communication completion status is a correct status.

[0202] Optionally, a third message body carrying a preset completion code may be generated. The preset completion code may be, for example, correct. In this way, the third message body may be used to indicate that the aggregate communication completion state is a correct state.

[0203] Step 1240: Send a second response message to the response message receiving node, where the second response message includes a third message header and a third message body.

[0204] Optionally, the third message header and the third message body may be message assembled to generate a second response message. The chip to which the response message receiving node belongs may determine the collective communication completion status based on the third message body of the received second response message, and obtain the second address information corresponding to the response message receiving node based on the third message header of the second response message, and store the collective communication completion status in a space corresponding to the second address information in a memory included in the chip.

[0205] Figure 13-1 It is a flowchart of a response message sending method provided by some further exemplary embodiments of the present disclosure. Figure 13-1 The method shown may include step 1310, step 1320 and step 1330. Optionally, the combination of step 1310 to step 1330 may be an optional implementation of step 730 of the present disclosure. The method shown in FIG. 13 may be performed after determining whether the first data precision format matches the second data precision format in step 930 of the present disclosure.

[0206] Step 1310: If the data processing result indicates that the first data precision format does not match the second data precision format, determine a response message receiving node.

[0207] Optionally, if the first data precision format is different from the second data precision format, a data processing result representing the mismatch between the first data precision format and the second data precision format can be obtained. In this case, the response message receiving node can be determined. The specific determination method can be referred to the relevant introduction to step 1010 above, which will not be repeated here.

[0208] Step 1320: Determine the second address information corresponding to the response message receiving node based on the collective communication parameters, where the second address information is used to store the collective communication completion status.

[0209] Optionally, the specific implementation of step 1320 may refer to the relevant introduction to step 1210 above, which will not be repeated here.

[0210] Step 1330: Send a third response message to the response message receiving node, where the third response message carries the second address information and a collective communication completion status, and the collective communication completion status is an error status.

[0211] In some optional embodiments of the present disclosure, Figure 13-2 As shown, step 1330 may include step 13301, step 13303 and step 13305.

[0212] Step 13301: Generate a fourth message header, where the fourth message header includes a fourth extension field, and the fourth extension field carries second address information.

[0213] Optionally, the specific implementation of step 13301 may refer to the relevant introduction to step 1030 above, which will not be repeated here.

[0214] Step 13303: Generate a fourth message body, the fourth message body carries the aggregate communication completion status, and the aggregate communication completion status is an error status.

[0215] Optionally, a fourth message body carrying a preset error code may be generated. The preset error code may be, for example, error or fail. In this way, the fourth message body may be used to indicate that the aggregate communication completion state is an error state.

[0216] Step 13305: Send a third response message to the response message receiving node, where the third response message includes a fourth message header and a fourth message body.

[0217] Optionally, the fourth message header and the fourth message body may be message assembled to generate a third response message. The switching node may send the third response message to the response message receiving node. The chip to which the response message receiving node belongs may determine the collective communication completion status based on the fourth message body included in the received third response message, and obtain the second address information corresponding to the response message receiving node based on the fourth message header included in the third response message, and store the collective communication completion status in a space corresponding to the second address information in the memory included in the chip.

[0218] In the embodiment of the present disclosure, the consistency of the first data precision format corresponding to the data to be operated and the second data precision format supported by the operation unit in the switching node can be compared. If the two are inconsistent, the data operation can be avoided to avoid obtaining wrong operation result data and avoid power consumption caused by data operation. In addition, by determining the fourth message header and the fourth message body and performing message assembly, the third response message can be obtained efficiently and quickly, and the third response message is sent to the response message receiving node, so that the collective communication completion status can be notified to the response message receiving node in a timely manner.

[0219] Fig.14 It is a flowchart of a method for obtaining data processing results provided by some further exemplary embodiments of the present disclosure. Fig.14 The method shown may include step 1410, step 1420 and step 1430. Optionally, the combination of step 1410 to step 1430 may be an optional implementation of step 730 of the present disclosure.

[0220] Step 1410 , determining whether the computing capability of the switching node matches the target set communication task; if so, executing step 1420 ; if not, executing step 1430 .

[0221] Step 1420, performing data operation on the data to be operated to obtain operation result data.

[0222] Step 1420: forward the request message to other switching nodes whose computing capabilities match the target set communication task.

[0223] The target collective communication task is a collective communication task to which all request messages belong. The target collective communication task can also be understood as a collective communication task in which at least two communication nodes participate.

[0224] Generally speaking, the computing power of a switching node is limited. For example, a switching node can only process a collective communication task in which at most A1 communication nodes participate. If at least two communication nodes participating in the target collective communication task are specifically A2 communication nodes, and A1 is greater than or equal to A2, it can be determined that the computing power of the switching node is sufficient to process the target collective communication task, and then it can be determined that the computing power of the switching node matches the target collective communication task. If A1 is less than A2, it can be determined that the computing power of the switching node is insufficient to process the target collective communication task, and then it can be determined that the computing power of the switching node does not match the target collective communication task.

[0225] If the computing capability of the switching node matches the target collective communication task, the data to be computed corresponding to the A2 communication nodes participating in the collective communication can be obtained, and data operations are performed on the data to be computed to obtain the operation result data.

[0226] If the computing power of the switching node does not match the target collective communication task, the forwarding function of the switching node can be used to forward the request message to other switching nodes that match the target collective communication task. The other switching node can be a switching node that can at least process the collective communication task in which A1 communication nodes participate together. For the target collective communication task, the other switching node can obtain the operation result data through data operation, and the other switching node can also generate some response messages, such as the first response message and the second response message mentioned above. The other switching node can return the generated response message to the original switching node (that is, the switching node that can only process the collective communication task in which A1 communication nodes participate together at most), and the original switching node can send the received response message to the response message receiving node.

[0227] In an embodiment of the present disclosure, the number of switching nodes can be at least two. When the switching node that receives the request message is unable to process the target set communication task, the request message can be forwarded between communication nodes so that the target set communication task can be processed by a switching node with stronger computing power. This is conducive to ensuring the normal completion of the collective communication.

[0228] Exemplary Structure

[0229] Fig.15 1 is a schematic diagram of the structure of a chip 14 provided by some exemplary embodiments of the present disclosure. The chip 14 may include a communication node 142, a memory 144 and a collective communication control unit 146; wherein,

[0230] The collective communication control unit 146 is used to obtain the to-be-calculated data and the preset collective communication parameters corresponding to the communication node 142 from the memory 144 , the number of the communication nodes 142 is at least two, and the at least two communication nodes 142 are located in at least two chips 14 ;

[0231] One of the collective communication control unit 146 and the communication node 142 is used to generate a request message based on the data to be calculated and the preset collective communication parameters, the request message including a first extension field, the first extension field carrying at least the amount of the data to be calculated and the information of the communication node 142;

[0232] The communication node 142 is used to Figure 1 or Fig.16 The switching node 12 shown sends a request message, so that the switching node 12 performs data processing based on the request message to obtain a data processing result.

[0233] Optionally, the memory 144 may be, for example, a double data rate synchronous dynamic random access memory (DDR).

[0234] Optionally, the collective communication control unit 146 may include a first register 1461, a direct memory access unit (DMA) 1463, and a second register 1465. The first register 1461 may be a command register. The second register 1465 may be used to store collective communication parameters.

[0235] Optionally, the chip 14 may further include an operation control unit 143 and an interconnection module 145. The operation control unit 143 may have operation and control functions. The interconnection module 145 may be used to interconnect different components in the chip 14. The interconnection module 145 may also be referred to as a NOC.

[0236] It should be noted that the specific implementation and beneficial effects of the chip 14 can be found in the above description of the method for implementing collective communication from the perspective of the chip, which will not be repeated here.

[0237] Fig.161 is a schematic diagram of the structure of a switching node 12 provided by some exemplary embodiments of the present disclosure. The switching node 12 may include a transceiver unit, a data processing unit and a message generating unit 121; wherein,

[0238] The transceiver unit is used to receive request messages from at least two communication nodes 142, the at least two communication nodes 142 are located in at least two chips 14, the request message includes a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated;

[0239] The data processing unit is used to process data based on the request message and obtain the data processing result;

[0240] The message generation unit 121 is used to generate a response message based on the data processing result;

[0241] The transceiver unit is used to send the response message generated by the message generation unit 121 to the communication node 142.

[0242] Optionally, the transceiver unit may include at least two down stream ports 127. The at least two down stream ports 127 may be used for sending and receiving messages.

[0243] Optionally, the data processing unit may include a state management unit 122, an operation unit 123, and an extension field processing unit 124. In addition, the switching node 12 may also include a switching logic unit 125 and a message parsing unit 126. The state management unit 122 may be used to maintain the data state management table mentioned above. The extension field processing unit 124 may be used to process the extension field, for example, to extract the required collective communication parameters from the extension field. The message generation unit 121, the state management unit 122, the operation unit 123, and the extension field processing unit 124 may jointly support the collective communication acceleration logic. The switching logic unit 125 may be used to support conventional switching logic. The message parsing unit 126 may be used to parse the request message.

[0244] It should be noted that the specific implementation and beneficial effects of the switching node 12 can be found in the above description of the method for implementing collective communication from the perspective of the switching node, which will not be repeated here.

[0245] Figure 1 It is a structural diagram of a system for implementing collective communication provided by some exemplary embodiments of the present disclosure. Figure 1 The system shown may include a switch node 12 and a chip 14; wherein,

[0246] The chip 14 is used to generate a request message corresponding to the communication node 142, and send the request message to the switching node 12, the number of the communication nodes 142 is at least two, and the at least two communication nodes 142 are located in at least two chips 14, the request message includes a first extension field, the first extension field carries the aggregate communication parameter, and the request message carries the data to be calculated;

[0247] The switching node 12 is used to obtain a request message, perform data processing based on the request message, obtain a data processing result, and send a response message to the communication node 142 based on the data processing result.

[0248] It should be noted that the system for implementing collective communication includes a chip 14 and a switching node 12. The specific implementation methods and beneficial effects of the chip 14 and the switching node 12 can be found in the relevant introduction above. The system for implementing collective communication can have corresponding beneficial effects, which will not be repeated here.

[0249] In some optional examples, when a predetermined type of collective communication is required, the operation control unit 143 may write the ring_id, rank_id, nranks, data_type, recv buff address, mailbox address, etc. into the second register 1465, and write the send buff address (specifically the storage address of the data to be calculated), length (specifically len in the above text) and other information to the DMA 1463. After the DMA 1463 is started, the first message header in the above text can be generated according to the ring_id, rank_id, nranks, data_type, recv buff address, mailbox address, length and other information. In addition, the data to be calculated can be obtained according to the send buff address, and the first message body is generated accordingly. Through message assembly, a request message can be obtained. The request message can be sent through the communication node 142.

[0250] On the switching node 12 side, after receiving the request message from the communication node 142, the request message can be parsed. If the request message carries a TLP prefix (such as the first extension field mentioned above), the collective communication acceleration logic can be run, otherwise, the regular switching logic can be run.

[0251] When running the collective communication acceleration logic, you can first determine whether the request message is the first request message based on the TLP prefix. If the request message is the first request message, you can record the port number of the downlink port 127 used to receive the request message, and record the mailbox address carried by the TLP prefix. In addition, you can cache the data carried by the first message body of the request message and establish a data status management table. If the request message is not the first request message, you can calculate the message sorting identifier corresponding to the request message (which can be used to indicate the offset of the data) based on the first address information carried by the TLPprefix and the third address information in the request message, and update the data status management table.

[0252] If all the messages of all ranks at a certain offset position have arrived (for example, D1 and D2 in the above text have been cached, and for example, D3 and D4 in the above text have been cached), data operation can be performed. After the data operation is completed, the data operation result can enter the message generation unit 121. The message generation unit 121 can construct the response message in the above text (for example, the first response message and the second response message), and send a response message from the downstream port 127 whose port number was previously recorded, thus completing the entire process of collective communication.

[0253] In summary, in the embodiments of the present disclosure, by extending PCIE so that the message header includes an extension field, and by the coordinated work of the switching node 12 and the chip 14, the efficiency of collective communication can be improved and the acceleration of collective communication can be achieved. This is conducive to accelerating the reasoning and training of large models.

[0254] Exemplary Devices

[0255] Fig.17 It is a schematic diagram of the structure of an apparatus for implementing collective communication provided from the perspective of a chip according to some exemplary embodiments of the present disclosure. Fig.17 The apparatus shown may include:

[0256] A first acquisition module 1710 is used to acquire data to be calculated and preset set communication parameters corresponding to a communication node, the number of the communication nodes is at least two, and the at least two communication nodes are located in at least two chips;

[0257] A generating module 1720, configured to generate a request message based on the data to be calculated and the preset set communication parameters, wherein the request message includes a first extension field, and the first extension field carries at least the amount of the data to be calculated and the information of the communication node;

[0258] The first sending module 1730 is used to send a request message to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result.

[0259] In some optional examples, the preset set communication parameters include:

[0260] Communication node information;

[0261] Data precision format;

[0262] Data operation type;

[0263] First address information for storing operation result data;

[0264] The second address information is used to store the completion status of the collective communication.

[0265] In some optional examples, such as Fig.18 As shown, the generating module 1720 includes:

[0266] The first determination submodule 1810 is used to determine the amount of data to be calculated;

[0267] The second determination submodule 1820 is used to determine the target aggregate communication parameters based on the preset aggregate communication parameters and the data volume of the data to be calculated, and the first extended field carries at least part of the target aggregate communication parameters.

[0268] In some optional examples, such as Fig.19 As shown, the generating module 1720 includes:

[0269] A first generating submodule 1910 is configured to generate a first message header, where the first message header includes a first extension field;

[0270] The second generating submodule 1920 is used to generate a first message body based on the data to be calculated;

[0271] The third generating submodule 1930 is used to generate a request message including a first message header and a first message body.

[0272] In some optional examples, the number of request messages corresponding to each communication node is at least two;

[0273] The first generation submodule 1910 includes:

[0274] A determination unit, configured to determine address offset information based on a message sorting identifier of the request message and an amount of data to be calculated;

[0275] an offset applying unit, configured to apply an offset to the first address information according to the address offset information to obtain third address information;

[0276] The first generating unit is used to generate a first message header, where the first message header includes a non-extension field, and the non-extension field carries the third address information.

[0277] In some optional examples, the first generating submodule 1910 includes:

[0278] A judging unit, used to judge whether the request message is the first request message;

[0279] A second generating unit, configured to generate a first message header if the request message is the first request message, the first message header including a first extension field, the first extension field being used to carry all the collective communication parameters in the target collective communication parameters;

[0280] The third generating unit is used to generate a first message header if the request message is not the first request message, the first message header includes a first extension field, and the first extension field is used to carry part of the target collective communication parameters.

[0281] Fig. 20 It is a structural diagram of an apparatus for implementing collective communication provided from the perspective of a switching node according to some exemplary embodiments of the present disclosure. Fig. 20 The apparatus shown may include:

[0282] A second acquisition module 2010 is used to acquire a request message from at least two communication nodes, where the at least two communication nodes are located in at least two chips, the request message includes a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated;

[0283] The processing module 2020 is used to process data based on the request message and obtain a data processing result;

[0284] The second sending module 2030 is used to send a response message to the communication node based on the data processing result.

[0285] In some optional examples, the number of request messages corresponding to each communication node is at least two;

[0286] like Fig.21 As shown, the processing module 2020 includes:

[0287] The third determination submodule 2110 is used to determine, for any request message of the communication node, first address information corresponding to the communication node based on the corresponding set communication parameter, where the first address information is used to store the operation result data;

[0288] A fourth determining submodule 2120, configured to determine address offset information between third address information and the first address information, where the third address information is located in a non-extended field of the request message;

[0289] A fifth determining submodule 2130, configured to determine a message sorting identifier of the request message based on the address offset information and the amount of data to be calculated of the request message;

[0290] The first processing submodule 2140 is used to perform data processing based on the message sorting identifier and the data to be calculated to obtain a data processing result.

[0291] In some optional examples, such as Fig. 22 As shown, the processing module 2020 includes:

[0292] A sixth determination submodule 2210, configured to determine a first data precision format corresponding to the data to be operated based on the aggregate communication parameter;

[0293] A seventh determination submodule 2220, configured to determine a second data precision format supported by a computing unit, the computing unit being located in the switch node;

[0294] The first judgment submodule 2230 is used to judge whether the first data precision format matches the second data precision format; if they match, the second processing submodule 2240 is triggered; if they do not match, the third processing submodule 2250 is triggered;

[0295] The second processing submodule 2240 is used to call the operation unit to perform data operation on the operation data to obtain operation result data;

[0296] The third processing submodule 2250 is used to perform data operation on the data to be operated without calling the operation unit.

[0297] In some optional examples, after obtaining the operation result data, such as Fig.23 As shown, the second sending module 2030 includes:

[0298] An eighth determination submodule 2310 is used to determine a response message receiving node;

[0299] A ninth determination submodule 2320, configured to determine first address information corresponding to the response message receiving node based on the aggregate communication parameter, wherein the first address information is used to store operation result data;

[0300] The fourth generating submodule 2330 is configured to generate a second message header, where the second message header includes a second extension field, and the second extension field carries the first address information;

[0301] The fifth generating submodule 2340 is used to generate a second message body based on the operation result data;

[0302] The first sending submodule 2350 is configured to send a first response message to a response message receiving node, where the first response message includes a second message header and a second message body.

[0303] In some optional examples, a first response message is sent to a response message receiving node, wherein the first response message includes a second message header and a second message body, such as Fig.24 As shown, the second sending module 2030 also includes:

[0304] A tenth determining submodule 2410 is used to determine, based on the collective communication parameters, second address information corresponding to the response message receiving node, where the second address information is used to store the collective communication completion status;

[0305] The sixth generating submodule 2420 is configured to generate a third message header, where the third message header includes a third extension field, and the third extension field carries the second address information;

[0306] The seventh generating submodule 2430 is used to generate a third message body, the third message body carries the aggregate communication completion status, and the aggregate communication completion status is a correct status;

[0307] The second sending submodule 2440 is configured to send a second response message to the response message receiving node, where the second response message includes a third message header and a third message body.

[0308] In some optional examples, such as Fig.25 As shown, the second sending module 2030 includes:

[0309] An eleventh determination submodule 2510 is configured to determine a response message receiving node if the data processing result indicates that the first data precision format does not match the second data precision format;

[0310] A twelfth determination submodule 2520 is used to determine, based on the collective communication parameters, second address information corresponding to the response message receiving node, the second address information being used to store the collective communication completion status;

[0311] The third sending submodule 2530 is used to send a third response message to the response message receiving node, where the third response message carries the second address information and the collective communication completion status, and the collective communication completion status is an error state.

[0312] In some optional examples, the third sending submodule 2530 includes:

[0313] a fourth generating unit, configured to generate a fourth message header, where the fourth message header includes a fourth extension field, and the fourth extension field carries the second address information;

[0314] A fifth generating unit, configured to generate a fourth message body, wherein the fourth message body carries a collective communication completion status, and the collective communication completion status is an error status;

[0315] The sending unit is used to send a third response message to the response message receiving node, where the third response message includes a fourth message header and a fourth message body.

[0316] In some optional examples, such as Fig.26 As shown, the processing module 2020 includes:

[0317] The second judgment submodule 2610 is used to judge whether the computing capability of the switching node matches the target set communication task; if so, the computing submodule 2620 is triggered; if not, the forwarding submodule 2630 is triggered;

[0318] The operation submodule 2620 is used to perform operation on the data to be operated to obtain operation result data.

[0319] The forwarding submodule 2630 is used to forward the request message to other switching nodes whose computing capabilities match the communication task of the target set;

[0320] The target collective communication task is the collective communication task to which all request messages belong.

[0321] In the device of the present disclosure, the various optional embodiments, optional implementation methods and optional examples disclosed above can be flexibly selected and combined as needed to achieve corresponding functions and effects, and the present disclosure does not list them one by one.

[0322] Exemplary Electronic Devices

[0323] Fig. 27 The block diagram of an electronic device according to an embodiment of the present disclosure is illustrated. The electronic device 2700 includes one or more processors 2710 and a memory 2720 .

[0324] The processor 2710 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 2700 to perform desired functions.

[0325] The memory 2720 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 2710 may execute one or more computer program instructions to implement the methods of the various embodiments of the present disclosure described above and / or other desired functions.

[0326] In one example, the electronic device 2700 may further include: an input device 2730 and an output device 2740 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0327] The input device 2730 may also include, for example, a keyboard, a mouse, etc.

[0328] The output device 2740 can output various information to the outside, and may include, for example, a display, a speaker, a printer, a communication network and its connected remote output device, etc.

[0329] Of course, to simplify, Fig. 27 Only some of the components related to the present disclosure in the electronic device 2700 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 2700 may also include any other appropriate components.

[0330] Exemplary computer program products and computer-readable storage media

[0331] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.

[0332] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0333] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the method according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0334] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0335] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations. It cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present disclosure. The specific details disclosed above are only for the purpose of illustration and ease of understanding, not limitation. The above details do not limit the present disclosure to being implemented by adopting the above specific details.

[0336] Those skilled in the art may make various changes and modifications to the present disclosure without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present disclosure claims and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. A method for implementing collective communication, applied to a chip, comprising: Obtaining the data to be calculated and the preset set communication parameters corresponding to the communication node; Generate a request message based on the data to be calculated and the preset set communication parameter, wherein the request message includes a first extension field, and the first extension field carries at least the amount of the data to be calculated and the information of the communication node; The request message is sent to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result.

2. The method according to claim 1, wherein: The preset set communication parameters include: Information of the communication node; Data precision format; Data operation type; First address information for storing operation result data; The second address information is used to store the completion status of the collective communication.

3. The method according to claim 2, wherein: The step of generating a request message based on the data to be calculated and the preset set communication parameter, wherein the request message includes a first extension field, and the first extension field carries at least the amount of the data to be calculated and the information of the communication node, including: Determining the amount of the data to be calculated; Based on the preset collective communication parameters and the data volume of the data to be calculated, a target collective communication parameter is determined, and the first extended field carries at least a part of the target collective communication parameter.

4. The method according to claim 3, wherein: The step of generating a request message based on the data to be calculated and the preset set communication parameter, wherein the request message includes a first extended field, including: Generate a first message header, where the first message header includes the first extension field; Generate a first message body based on the data to be calculated; Generate the request message including the first message header and the first message body.

5. The method according to claim 4, wherein: The number of request messages corresponding to each communication node is at least two; The generating of the first message header comprises: Determine address offset information based on a message sorting identifier of the request message and an amount of data to be calculated; According to the address offset information, applying an offset to the first address information to obtain third address information; A first message header is generated, wherein the first message header includes a non-extension field, and the non-extension field carries the third address information.

6. The method according to claim 4, wherein: The generating a first message header, wherein the first message header includes the first extension field, includes: Determine whether the request message is the first request message; If the request message is the first request message, a first message header is generated, wherein the first message header includes the first extension field, and the first extension field is used to carry all the collective communication parameters in the target collective communication parameters; If the request message is not the first request message, a first message header is generated, where the first message header includes the first extension field, where the first extension field is used to carry part of the target collective communication parameters.

7. The method according to claim 1, wherein: The number of the communication nodes is at least two, and at least two of the communication nodes are located in at least two of the chips.

8. A method for implementing collective communication, applied to a switching node, comprising: Obtaining request messages of at least two communication nodes, where at least two of the communication nodes are located in at least two chips, the request message comprising a first extension field, the first extension field carrying a collective communication parameter, and the request message carrying data to be calculated; Performing data processing based on the request message to obtain a data processing result; Based on the data processing result, a response message is sent to the communication node.

9. The method according to claim 8, wherein: The number of request messages corresponding to each communication node is at least two; The performing data processing based on the request message to obtain a data processing result includes: For any of the request messages of the communication node, based on the corresponding set communication parameter, determine first address information corresponding to the communication node, where the first address information is used to store calculation result data; Determine address offset information between third address information and the first address information, wherein the third address information is located in a non-extended field of the request message; Determine a message sorting identifier of the request message based on the address offset information and the amount of data to be calculated of the request message; Based on the message sorting identifier and the data to be calculated, data processing is performed to obtain a data processing result.

10. The method according to claim 8, wherein: The performing data processing based on the request message to obtain a data processing result includes: Based on the collective communication parameter, determining a first data precision format corresponding to the data to be operated; determining a second data precision format supported by a computing unit, the computing unit being located in the switch node; Determining whether the first data precision format matches the second data precision format; If there is a match, calling the operation unit to perform data operation on the data to be operated to obtain operation result data; If there is no match, the operation unit does not perform data operation on the data to be operated.

11. The method according to claim 10, wherein: After obtaining the operation result data, sending a response message to the communication node based on the data processing result includes: Determine a response message receiving node; Based on the collective communication parameter, determine first address information corresponding to the response message receiving node, where the first address information is used to store the operation result data; Generate a second message header, where the second message header includes a second extension field, and the second extension field carries the first address information; Based on the operation result data, generate a second message body; A first response message is sent to the response message receiving node, where the first response message includes the second message header and the second message body.

12. The method according to claim 11, wherein after sending a first response message to the response message receiving node, wherein the first response message includes the second message header and the second message body, sending a response message to the communication node based on the data processing result further comprises: Based on the collective communication parameters, determining second address information corresponding to the response message receiving node, wherein the second address information is used to store a collective communication completion status; Generate a third message header, where the third message header includes a third extension field, and the third extension field carries the second address information; Generate a third message body, the third message body carrying a collective communication completion status, and the collective communication completion status is a correct status; A second response message is sent to the response message receiving node, where the second response message includes the third message header and the third message body.

13. The method according to claim 10, wherein: The sending a response message to the communication node based on the data processing result includes: If the data processing result indicates that the first data precision format does not match the second data precision format, determining a response message receiving node; Based on the collective communication parameters, determining second address information corresponding to the response message receiving node, wherein the second address information is used to store a collective communication completion status; A third response message is sent to the response message receiving node, where the third response message carries the second address information and a collective communication completion status, and the collective communication completion status is an error status.

14. The method according to claim 13, wherein: The sending a third response message to the response message receiving node, wherein the third response message carries the second address information and a collective communication completion status, and the collective communication completion status is an error state, includes: Generate a fourth message header, where the fourth message header includes a fourth extension field, and the fourth extension field carries the second address information; Generate a fourth message body, the fourth message body carrying a collective communication completion status, and the collective communication completion status is an error state; A third response message is sent to the response message receiving node, where the third response message includes the fourth message header and the fourth message body.

15. The method according to claim 8, wherein the performing data processing based on the request message to obtain a data processing result comprises: Determining whether the computing capability of the switching node matches the target set communication task; If they match, performing data operation on the data to be operated to obtain operation result data; If there is no match, forwarding the request message to other switching nodes whose computing capabilities match the communication task of the target set; The target collective communication task is the collective communication task to which all the request messages belong.

16. A device for implementing collective communication, applied to a chip, comprising: A first acquisition module, used to acquire data to be calculated and preset set communication parameters corresponding to a communication node, the number of the communication nodes is at least two, and at least two of the communication nodes are located in at least two of the chips; A generating module, configured to generate a request message based on the data to be calculated and the preset set communication parameter, wherein the request message includes a first extension field, and the first extension field carries at least the amount of the data to be calculated and the information of the communication node; The first sending module is used to send the request message to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result.

17. A device for implementing collective communication, applied to a switching node, comprising: A second acquisition module, configured to acquire request messages of at least two communication nodes, where at least two of the communication nodes are located in at least two chips, the request message comprises a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated; A processing module, used to perform data processing based on the request message to obtain a data processing result; The second sending module is used to send a response message to the communication node based on the data processing result.

18. A chip comprising a communication node, a memory and a collective communication control unit; wherein: The collective communication control unit is used to obtain the to-be-calculated data and the preset collective communication parameters corresponding to the communication nodes from the memory, the number of the communication nodes is at least two, and at least two of the communication nodes are located in at least two of the chips; One of the collective communication control unit and the communication node is used to generate a request message based on the data to be calculated and the preset collective communication parameter, wherein the request message includes a first extension field, and the first extension field carries at least the data amount of the data to be calculated and the information of the communication node; The communication node is used to send the request message to the switching node, so that the switching node performs data processing based on the request message to obtain a data processing result.

19. A switching node, comprising a transceiver unit, a data processing unit and a message generating unit; wherein: The transceiver unit is used to receive request messages from at least two communication nodes, where the at least two communication nodes are located in at least two chips, the request message includes a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated; The data processing unit is used to perform data processing based on the request message to obtain a data processing result; The message generating unit is used to generate a response message based on the data processing result; The transceiver unit is used to send the response message generated by the message generation unit to the communication node.

20. A system for implementing collective communication, comprising a switching node and a chip; wherein: The chip is used to generate a request message corresponding to a communication node, and send the request message to the switching node, the number of the communication nodes is at least two, at least two of the communication nodes are located in at least two of the chips, the request message includes a first extension field, the first extension field carries a collective communication parameter, and the request message carries data to be calculated; The switching node is used to obtain the request message, perform data processing based on the request message to obtain a data processing result, and send a response message to the communication node based on the data processing result.

21. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the method for implementing collective communication as described in any one of claims 1 to 15.

22. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method for implementing collective communication as described in any one of claims 1-15 above.