Distributed communication method, device and equipment
By introducing unilateral operations and combined command and load transmission in the multiprocessor communication system, the high synchronization overhead problem caused by blocking operations in point-to-point communication in the prior art is solved, efficient and low-latency communication is achieved, and the data processing performance of multiprocessors is significantly improved.
Patent Information
- Application Number
- CN202411931853.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-11
AI Technical Summary
Existing multiprocessor communication schemes have blocking operations during point-to-point communication, resulting in high synchronization overhead, increasing communication delays and limiting system parallel performance.
By introducing a method of unilateral operations and a combination of commands and load transmission in the distributed communication device, the sender's processor can immediately prepare the next task after sending out the communication message carrying data processing instructions and task data without waiting for confirmation from the receiver. After receiving the communication message, the receiver's processor can directly process the task data according to the data processing instructions therein.
It effectively reduces the synchronization latency between point-to-point communications, reduces communication delay, and improves the data processing performance of multiprocessor systems.
Smart Images

Figure CN119814784A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of processors, and in particular to a distributed communication method, apparatus, and device. Background Art
[0002] Currently, when existing multi-processor communication schemes such as NCCL perform point-to-point communication between processors, the processor of the sender and the processor of the receiver need to call ncclSend() and ncclRecv() respectively to send the task data first. After the receiver feedbacks that the task data has been received, the sender or the host computer sends the processing instructions corresponding to the task data to the receiver, so that the receiver can perform the corresponding data processing process. That is, the synchronization between data communication is achieved through the synchronous confirmation operation of data transmission and reception by the sender and the receiver, so as to complete the data communication process.
[0003] However, in the above scheme, the bilateral synchronization confirmation operation of data transmission and reception is blocked, which means that the sender must wait for the receiver to confirm the receipt of the data before continuing to perform subsequent tasks. This blocking operation in point-to-point communication will cause a high synchronization overhead in the multi-processor communication system, which not only increases the communication delay, but also limits the parallel performance of the communication system. Especially in a high-bandwidth, low-latency network environment, the high synchronization overhead problem caused by the blocking operation in point-to-point communication will seriously affect the data processing performance of the multi-processor communication system. Summary of the invention
[0004] The embodiments of the present disclosure provide a distributed communication method, apparatus and device, which can solve the problem of high synchronization overhead caused by blocking operations in point-to-point communications in the prior art, achieve efficient and low-latency communication, and improve the data processing performance of multiple processors.
[0005] According to one aspect of the present disclosure, a distributed communication method is provided, which is applied to a distributed communication device, wherein the distributed communication device includes multiple processors connected in a distributed communication manner; for each of the processors in the distributed communication device, the distributed communication method includes: receiving a communication data packet sent by an upper computer application; obtaining first task data, first processing task information and first transmission task information according to the communication data packet; performing data processing on the first task data according to the first processing task information to obtain second task data; obtaining a first data processing instruction according to the first transmission task information, and sending a communication message carrying the first data processing instruction and the second task data to the next processor, so that the next processor performs data processing on the second task data based on the first data processing instruction.
[0006] Optionally, in some embodiments, the processor includes a command processing unit and a computing unit, and the processing the first task data according to the first processing task information to obtain second task data includes: allocating a corresponding data processing task to the computing unit according to the first processing task information by the command processing unit; and processing the first task data based on the data processing task by the computing unit to obtain second task data.
[0007] Optionally, in some embodiments, the processor also includes a data transmission unit, which obtains a first data processing instruction based on the first transmission task information and sends a communication message carrying the first data processing instruction and the second task data to the next processor, including: obtaining the first data processing instruction based on the first transmission task information by the command processing unit; constructing a communication message according to the first data processing instruction and the second task data by the data transmission unit; and sending the communication message to the next processor by the data transmission unit.
[0008] Optionally, in some embodiments, sending the communication message to the next processor through the data transmission unit includes: determining the next processor according to the first transmission task information through the command processing unit; selecting a message transmission path whose sending target is the next processor through the data transmission unit; and sending the communication message to the next processor based on the message transmission path through the data transmission unit.
[0009] Optionally, in some embodiments, the distributed communication method also includes: when receiving a data packet sent by a previous processor, performing processing instruction detection on the data packet; when the data packet carries the first data processing instruction, performing data processing on the second task data carried by the data packet based on the first data processing instruction; when the data packet does not carry the first data processing instruction, performing data processing on the second task data carried by the data packet in response to the first data processing instruction issued by the upper computer application.
[0010] Optionally, in some embodiments, the data processing of the second task data carried by the data message based on the first data processing instruction includes: when the first data processing instruction includes second processing task information and second transmission task information, data processing the second task data carried by the data message according to the second processing task information to obtain third task data; obtaining the second data processing instruction according to the second transmission task information, and sending the communication message carrying the second data processing instruction and the third task data to the next processor corresponding to the second transmission task information, so that the next processor corresponding to the second transmission task information performs data processing on the third task data based on the second data processing instruction.
[0011] Optionally, in some embodiments, the data transmission unit includes a hardware transcoding device installed on the processor, and constructing a communication message according to the first data processing instruction and the second task data through the data transmission unit includes: encoding the first data processing instruction through the hardware transcoding device to obtain a message command header; encoding the second task data through the hardware transcoding device to obtain message metadata; and splicing the message command header and the message metadata to construct a communication message.
[0012] Optionally, in some embodiments, sending the communication message carrying the first data processing instruction and the second task data to the next processor includes: determining a connection relationship between the processor and the next processor;
[0013] A target communication protocol is selected according to the connection relationship, and a communication message carrying the first data processing instruction and the second task data is sent to the next processor based on the target communication protocol.
[0014] Optionally, in some embodiments, selecting the target communication protocol according to the connection relationship includes: when the connection relationship represents that the processor and the next processor are located in the same node, selecting a local node communication protocol as the target communication protocol; when the connection relationship represents that the processor and the next processor are located in different nodes, selecting a cross-node communication protocol as the target communication protocol; wherein the local node communication protocol includes a PCle communication protocol, and the cross-node communication protocol includes a RoCEv2 communication protocol.
[0015] Optionally, in some embodiments, after performing data processing on the second task data carried by the data message based on the first data processing instruction, the distributed communication method further includes: if a task result representing the completion of the data processing task is obtained, reporting the task result to the host computer.
[0016] According to another aspect of the present disclosure, a distributed communication device is provided, comprising: a plurality of processors connected in communication; wherein each of the processors is used to: receive a communication data packet sent by an upper computer application; obtain first task data, first processing task information and first transmission task information according to the communication data packet; perform data processing on the first task data according to the first processing task information to obtain second task data; obtain a first data processing instruction according to the first transmission task information, and send a communication message carrying the first data processing instruction and the second task data to the next processor, so that the next processor performs data processing on the second task data based on the first data processing instruction.
[0017] Optionally, in some embodiments, the processor includes a command processing unit, a data transmission unit and a computing unit, the data transmission unit includes a hardware transcoding device installed on the processor, the hardware transcoding device includes an encoding end and a decoding end, the encoding end is used to send the communication message to another processor, and the decoding end is used to receive the communication message sent by another processor.
[0018] Optionally, in some embodiments, when the first task data is processed according to the first processing task information to obtain second task data, the command processing unit is used to assign corresponding data processing tasks to the computing unit according to the first processing task information; and the computing unit is used to process the first task data based on the data processing task to obtain second task data.
[0019] Optionally, in some embodiments, when obtaining the first data processing instruction based on the first transmission task information and sending the communication message carrying the first data processing instruction and the second task data to the next processor, the command processing unit is used to obtain the first data processing instruction based on the first transmission task information; the data transmission unit is used to construct a communication message based on the first data processing instruction and the second task data, and send the communication message to the next processor.
[0020] Optionally, in some embodiments, when the communication message is sent to the next processor through the data transmission unit, the command processing unit is used to determine the next processor based on the first transmission task information; the data transmission unit is used to select a message transmission path whose sending target is the next processor, and send the communication message to the next processor based on the message transmission path.
[0021] Optionally, in some embodiments, the processor is also used to: when receiving a data packet sent by a previous processor, perform processing instruction detection on the data packet; when the data packet carries the first data processing instruction, perform data processing on the second task data carried by the data packet based on the first data processing instruction; when the data packet does not carry the first data processing instruction, perform data processing on the second task data carried by the data packet in response to the first data processing instruction issued by the host computer application.
[0022] Optionally, in some embodiments, when data processing is performed on the second task data carried by the data message based on the first data processing instruction, when the first data processing instruction includes second processing task information and second transmission task information, the processor is also used to: perform data processing on the second task data carried by the data message according to the second processing task information to obtain third task data; obtain the second data processing instruction according to the second transmission task information, and send the communication message carrying the second data processing instruction and the third task data to the next processor corresponding to the second transmission task information, so that the next processor corresponding to the second transmission task information performs data processing on the third task data based on the second data processing instruction.
[0023] Optionally, in some embodiments, when constructing a communication message according to the first data processing instruction and the second task data through the data transmission unit, the hardware transcoding device is used to: encode the first data processing instruction to obtain a message command header; encode the second task data to obtain message metadata; and splice the message command header and the message metadata to construct a communication message.
[0024] Optionally, in some embodiments, when the communication message carrying the first data processing instruction and the second task data is sent to the next processor, the data transmission unit is used to: determine the connection relationship between the processor and the next processor; when the connection relationship indicates that the processor and the next processor are located in the same node, select the local node communication protocol as the target communication protocol; when the connection relationship indicates that the processor and the next processor are located in different nodes, select the cross-node communication protocol as the target communication protocol; wherein the local node communication protocol includes the PCle communication protocol, and the cross-node communication protocol includes the RoCEv2 communication protocol.
[0025] According to another aspect of the present disclosure, an electronic device is provided, comprising the distributed communication device as described in any one of the above embodiments.
[0026] The distributed communication method, distributed communication device and equipment provided by the present disclosure have at least the following beneficial effects: the distributed communication method is applied to a distributed communication device, and the distributed communication device includes multiple processors connected in a distributed communication manner. For each processor in the distributed communication device, a communication data packet sent by an upper computer application can be received, and first task data, first processing task information and first transmission task information can be obtained according to the communication data packet; the first task data can be processed according to the first processing task information to obtain second task data; the first data processing instruction can be obtained according to the first transmission task information, and a communication message carrying the first data processing instruction and the second task data can be sent to the next processor, so that the next processor can process the second task data based on the first data processing instruction; it can be understood that in traditional bilateral operations, the sender must wait for the receiver to confirm that the data has been received before It can continue to execute subsequent tasks, which increases communication delay and limits the parallel performance of the system. In the present disclosure, after the processor of the sender sends out the communication message carrying data processing instructions and task data, it can immediately prepare for the next task without waiting for the confirmation of the receiver. After receiving the communication message, the processor of the receiver can directly process the task data according to the data processing instructions therein without waiting for additional instructions, that is, the above-mentioned unilateral operation method allows the sender to independently perform the sending operation, and the receiver can process it immediately after receiving the data. The sender and the receiver will not block each other, which can effectively reduce the waiting time for synchronization between the two. At the same time, by merging the command (the first data processing instruction) and the load (the second task data) into a communication message for transmission, it can also reduce additional communication overhead, avoid multiple interactions between the sender, the host computer and the receiver, and further reduce communication delay. In summary, by introducing unilateral operation and command and load combined transmission, the distributed communication method disclosed in the present disclosure can effectively solve the high synchronization overhead problem caused by the blocking operation in the prior art point-to-point communication, realize efficient and low-latency communication, thereby significantly improving the data processing performance of multiple processors.
[0027] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0029] Figure 1is a schematic diagram of a distributed communication device in some embodiments of the present disclosure;
[0030] Figure 2 is a main flow chart of a distributed communication method in some embodiments of the present disclosure;
[0031] Figure 3 is a main flow chart for obtaining second task data in some embodiments of the present disclosure;
[0032] Figure 4 is a main flow chart of sending communication messages in some embodiments of the present disclosure;
[0033] Figure 5 is a main flow chart for selecting a message transmission path in some embodiments of the present disclosure;
[0034] Figure 6 is another schematic diagram of a distributed communication device in some embodiments of the present disclosure;
[0035] Figure 7 is a main flow chart of receiving a data message sent by a previous processor in some embodiments of the present disclosure;
[0036] Figure 8 is a schematic diagram of communication between processors in some embodiments of the present disclosure;
[0037] Fig. 9 is a main flow chart of sending a communication message based on a target communication protocol in some embodiments of the present disclosure;
[0038] Fig.10 This is a main flow chart for selecting a target communication protocol in some embodiments of the present disclosure. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0040] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0041] Processor: used to process data, widely used in high-performance computing, deep learning, scientific computing and other fields. In the present disclosure, multiple processors are physically connected to form a distributed communication device.
[0042] Distributed communication device: A system formed by multiple processors connected by communication, used to efficiently transmit data and synchronize computing tasks between different distributed communication devices. The device can be a multi-processor configuration within a single node or a distributed system across multiple nodes.
[0043] The host computer application is an application running on the host computer, which is responsible for generating and sending distributed communication tasks to each processor. The host computer can include a central processing unit or a host system of an operating system. It works with the processor to manage the allocation of computing tasks and data transmission, and is used to prepare and send communication data packets, and guide distributed communication devices to perform specific computing and communication operations.
[0044] Communication data packet: In a distributed communication system, a data unit generated by the host computer application and sent to the processor. Each communication data packet contains the communication operation to be performed and its related data, which may include: command data indicating the specific type of communication operation to be performed; metadata describing the characteristics and attributes of the data, such as data type, size, shape, source and target device identifiers; actual data content payload to be transmitted, such as model parameters, gradients, intermediate calculation results, etc.
[0045] First task data and second task data: The first task data refers to the initial data extracted from the communication data packet, which is usually the task data sent by the host computer application. The second task data refers to the result data generated after processing the first task data according to the first processing task information. The second task data will be further transmitted to the next processor for subsequent processing to ensure that the data is correctly transmitted and processed between multiple processors and support the parallel execution of distributed computing tasks.
[0046] First processing task information, first transmission task information: The first processing task information refers to the instructions contained in the communication data packet on how to process the first task data, such as the type of computing operation to be performed and its parameters; the first transmission task information refers to the instructions contained in the communication data packet on how to transmit the second task data, such as the identifier of the target device, the selection of the transmission path, etc., to instruct the computing unit and transmission unit inside the processor to perform data processing and data transmission tasks respectively, to ensure the orderly progress of communication and calculation.
[0047] Command processing unit: A module located inside the processor, responsible for parsing commands and metadata in communication data packets, obtaining first processing task information and first transmission task information, coordinating computing and communication tasks within the processor, and assigning computing tasks to computing units.
[0048] Computing unit: A module in the processor that is responsible for executing specific computing operations, used to calculate the first task data and generate the second task data according to the task information sent by the command processing unit.
[0049] Synchronization overhead: refers to the extra time and resource costs incurred to ensure coordination and consistency between multiple devices or processes. Synchronization overhead usually includes waiting time, additional communication overhead, etc. Excessive synchronization overhead will lead to reduced system efficiency and increased communication delay.
[0050] NCCL: It is a GPU communication library provided by NVIDIA for distributed deep learning training. NCCL supports a variety of collective communication operations, such as broadcasting, full aggregation, point-to-point communication, etc., and can perform efficient communication in a multi-GPU, multi-node environment.
[0051] Currently, when existing multi-processor communication schemes such as NCCL perform point-to-point communication between processors, the processor of the sender and the processor of the receiver need to call ncclSend() and ncclRecv() respectively to send the task data first. After the receiver feedbacks that the task data has been received, the sender or the host computer sends the processing instructions corresponding to the task data to the receiver, so that the receiver can perform the corresponding data processing process. That is, the synchronization between data communication is achieved through the synchronous confirmation operation of data transmission and reception by the sender and the receiver, so as to complete the data communication process.
[0052] However, in the above scheme, the bilateral synchronization confirmation operation of data transmission and reception is blocked, which means that the sender must wait for the receiver to confirm the receipt of the data before continuing to perform subsequent tasks. This blocking operation in point-to-point communication will cause a high synchronization overhead in the multi-processor communication system, which not only increases the communication delay, but also limits the parallel performance of the communication system. Especially in a high-bandwidth, low-latency network environment, the high synchronization overhead problem caused by the blocking operation in point-to-point communication will seriously affect the data processing performance of the multi-processor communication system.
[0053] Based on this, the present disclosure proposes a distributed communication method, device and equipment, and the method includes: receiving a communication data packet sent by an upper computer application; obtaining first task data, first processing task information and first transmission task information according to the communication data packet; performing data processing on the first task data according to the first processing task information to obtain second task data; obtaining a first data processing instruction according to the first transmission task information, and sending a communication message carrying the first data processing instruction and the second task data to the next processor, so that the next processor performs data processing on the second task data based on the first data processing instruction, so that the sender can independently perform the sending operation, and the receiver can process the data immediately after receiving the data, thereby avoiding mutual blocking, solving the high synchronization overhead problem caused by the blocking operation in the prior art point-to-point communication, and improving data processing performance.
[0054] The embodiments disclosed in this application are further described below in conjunction with the accompanying drawings.
[0055] Overall implementation of the distributed communication method of the present disclosure
[0056] refer to Figure 1 and Figure 2 , Figure 1 is a schematic diagram of a distributed communication device 100 in some embodiments of the present disclosure, Figure 2 is a main flow chart of a distributed communication method in some embodiments of the present disclosure; according to one aspect of the present disclosure, Figure 1 The present invention provides a distributed communication device 100, which includes a plurality of processors 110 connected in a distributed communication manner. The device is intended to improve the efficiency of data processing and transmission in a multi-processor environment and ensure efficient execution of computing tasks. For each processor 110 in the distributed communication device, a corresponding Figure 2 , the distributed communication method comprises at least the following steps:
[0057] Step S210, receiving a communication data packet sent by an upper computer application;
[0058] Step S220, obtaining first task data, first processing task information and first transmission task information according to the communication data packet;
[0059] Step S230, performing data processing on the first task data according to the first processing task information to obtain second task data;
[0060] Step S240, obtaining a first data processing instruction according to the first transmission task information, and sending a communication message carrying the first data processing instruction and the second task data to the next processor, so that the next processor processes the second task data based on the first data processing instruction.
[0061] Among them, it can be understood that in traditional bilateral operations, the sender must wait for the receiver to confirm that the data has been received before continuing to perform subsequent tasks, which increases communication delay and limits the parallel performance of the system; in the present disclosure, after the sender's processor 110 sends out the communication message carrying data processing instructions and task data, it can immediately prepare for the next task without waiting for the receiver's confirmation. After receiving the communication message, the receiver's processor 110 can directly process the task data according to the data processing instructions therein without waiting for additional instructions, that is, the above-mentioned unilateral operation method allows the sender to independently perform the sending operation, and the receiver can process the data immediately after receiving it. The sender and the receiver will not block each other, which can effectively reduce the waiting time for synchronization between the two. At the same time, by merging the command (first data processing instruction) and the load (second task data) into one communication message for transmission, it can also reduce additional communication overhead, avoid multiple interactions between the sender, the host computer and the receiver, and further reduce communication delay. In summary, by introducing unilateral operations and combined transmission of commands and loads, the distributed communication method disclosed in the present invention can effectively solve the high synchronization overhead problem caused by blocking operations in point-to-point communications in the prior art, and achieve efficient and low-latency communication, thereby significantly improving the data processing performance of multiple processors.
[0062] In some embodiments, corresponding to the above steps S210 to S240, taking a distributed machine learning training as an example, when multiple processors 110 need to work together to process a large-scale data set: the host computer application is responsible for decomposing the training task into multiple subtasks, and assigning these subtasks and their related data to each processor 110; each processor 110, as a sender, packages the processed intermediate results such as gradient information and instructions for the next step of processing into a communication message, and sends it to the next processor 110; after receiving the communication message, the receiving processor 110 immediately processes the intermediate results according to the instructions, such as updating model parameters or calculating new gradients; due to the use of unilateral operations, each processor 110 can start processing a new task immediately after sending the data, and will not be idle due to waiting for confirmation; in summary, by introducing unilateral operations and command and load combined transmission, the distributed communication method disclosed in the present invention effectively solves the high synchronization overhead problem caused by blocking operations in the prior art point-to-point communication, so as to achieve efficient and low-latency communication, thereby improving the data processing performance of multiple processors.
[0063] In some embodiments, the processor may be a computing component such as a central processing unit (CPU), a graphics processing unit (GPU), a general-purpose graphics processing unit computing (GPGPU), a neural network processor (NPU), a tensor processing unit (TPU), etc. These different processor types are each used to process specific types of tasks; for example, when the task involves graphics processing related work, such as image recognition, animation rendering, and other operations that require a large amount of parallel computing, a graphics processing unit (GPU) can be selected as the computing component deployed in the method of the present application, and for running an operating system, executing conventional applications or other wide-ranging computing tasks, a central processing unit (CPU) can be selected as the computing component deployed in the method of the present application to efficiently manage system resources and execute various types of instructions. In addition, for deep learning and artificial intelligence applications, a neural network processor (NPU) or a tensor processing unit (TPU) can also be selected as the computing component deployed in the method of the present application to process large-scale matrix operations and machine learning algorithm tasks; it can be understood that according to specific application scenarios and technical requirements, those skilled in the art can select corresponding computing components to execute the method of the present application to effectively improve the performance and efficiency of the system.
[0064] In some embodiments, the multiprocessors in the present disclosure may be deployed in multiple computing nodes respectively. For example, in the gradient calculation scenario, the processor is a graphics processing unit (GPU). The multiprocessors in the present disclosure may include 4 computing nodes, each node includes 4 processors 110, and a total of 16 processors 110. In each round of iteration, after each processor 110 calculates the gradient, it needs to send the gradient to other processors 110 for gradient aggregation. In the traditional bilateral synchronization scheme, each processor 110 must wait for other GPUs to complete gradient transmission and confirmation before continuing to the next round of iteration, which leads to a long synchronization waiting time and limits the parallel performance of the system; in the present application, each processor 110 can start processing new tasks immediately after sending the gradient without waiting for confirmation from other processors 110. After receiving the gradient, the receiving processor 110 can immediately start gradient aggregation or model parameter update according to the data processing instructions in the communication message to eliminate explicit synchronization operations, significantly reduce synchronization waiting time, and thus accelerate parallel computing speed.
[0065] In some embodiments, regarding the characteristics of the unilateral operation of the disclosed solution, illustratively, in the case where the processor is a graphics processor (GPU), the disclosed solution may include two processors 110 (GPU A and GPU B) that need to perform point-to-point communication. In the traditional bilateral synchronization solution, after GPU A sends the gradient to GPU B, it must wait for the confirmation message of GPU B before continuing to execute the next task. This method causes mutual blocking between GPU A and GPU B and increases communication delay; in the present application, after GPU A sends the gradient, it can immediately start processing the new task without waiting for the confirmation of GPU B. After receiving the gradient, GPU B can immediately start gradient aggregation or model parameter update according to the data processing instructions in the communication message, so the mutual blocking between the sender and the receiver can be eliminated.
[0066] In some embodiments, regarding the characteristics of the data computing commands and data computing loads of the disclosed solution being transmitted together, exemplarily, in the case where the processor is a graphics processing unit (GPU), the disclosed solution may include two processors 110 (GPU A and GPU B) that need to perform point-to-point communication, GPU A needs to send gradients to GPU B, and tell GPU B how to process these gradients. In the traditional bilateral synchronization scheme, GPU A needs to send gradients and processing instructions separately, resulting in two communications. This method increases the number of communications and prolongs the overall communication time; in the present application, GPU A can combine the gradients and processing instructions into one communication message and send it to GPU B at one time. After receiving the communication message, GPU B can immediately start processing the gradients according to the data processing instructions therein without waiting for additional instructions, so the number of communications can be reduced and the communication delay of the computing task can be reduced.
[0067] In some embodiments, corresponding to step S210, the processor 110 can receive a communication data packet from a host computer application through a network interface (such as an Ethernet card, an InfiniBand adapter, etc.), and the communication data packet can be transmitted to the target processor 110 through a network protocol. The communication data packet received by the processor 110 can be first stored in a temporary buffer for subsequent processing. The temporary buffer can be either a hardware-level direct memory access buffer or a software-level ring buffer, depending on the system's hardware architecture and communication protocol.
[0068] In some embodiments, when the arrival of a communication data packet is detected, the network interface of the processor 110 may notify the command processing unit 111 through an interrupt mechanism, or the command processing unit 111 may periodically check whether there is a new data packet in the buffer through a polling mechanism. The interrupt mechanism is suitable for low-latency scenarios, while the polling mechanism is suitable for high-throughput scenarios.
[0069] In some embodiments, corresponding to step S220, the processor 110 or the command processing unit 111 in the processor 110 can read the header information of the communication data packet from the buffer and parse out the following fields: source address: identifier of the sender host computer application; target address: identifier of the receiver processor 110; communication protocol: type of communication protocol used; instruction type: type of first processing task information; load length: size of first task data; sequence number: unique identifier used to track communication messages to ensure that the receiver can correctly reassemble multiple segments of transmitted data; check code: check code used to verify data integrity. The command processing unit 111 can extract the first task data from the buffer according to the load length field in the message header. The first task data is the data prepared by the host computer application in the previous step, and parse out the first processing task information according to the instruction type field in the message header. These instructions can be specific calculation operations or control instructions. Further, the command processing unit 111 can also extract the first transmission task information according to the target address, communication protocol and other fields in the message header. This information is used to guide subsequent communication operations, such as sending the processed data to the next processor.
[0070] In some embodiments, corresponding to step S230, the command processing unit 111 can construct a standardized task descriptor based on the first processing task information, where the task descriptor includes the task type, task parameters, and a pointer or buffer address of the first task data, and then select a suitable computing unit 112 for computing task allocation based on the target computing unit 112 identifier in the task descriptor, so that the computing unit 112 calls the corresponding computing kernel to execute the data processing task and generate the second task data according to the task type in the task descriptor.
[0071] In some embodiments, corresponding to step S240, the command processing unit 111 generates a first data processing instruction according to the instruction type field in the first transmission task information, and constructs a communication message, and selects a message transmission path corresponding to a suitable communication protocol according to the communication protocol field in the first transmission task information to send the message; it can be understood that, when the first task data is the original data sent by the upper computer, and the first processing task information represents the task of the upper computer to send to the processor 110 to process the original data, the first transmission task information represents the subsequent processing task of the upper computer to send to the next processor of the processor 110 or multiple subsequent image processors to perform on the second task data, and the first transmission task information also carries communication target information for determining the next processor, which is used to determine the next processor from multiple processors 110.
[0072] refer to Figure 3 , Figure 3 is a main flow chart for obtaining the second task data in some embodiments of the present disclosure; in some embodiments, the processor 110 is designed to include a command processing unit 111 (Command Processor, CP) and a computing unit 112 (Compute Unit, CU), aiming to optimize the execution of graphics and computing intensive tasks through task allocation and data processing mechanisms, wherein the first task data is processed according to the first processing task information to generate the second task data, which at least includes the following steps:
[0073] Step S310, assigning corresponding data processing tasks to the computing unit 112 according to the first processing task information through the command processing unit 111;
[0074] Step S320 , the computing unit 112 performs data processing on the first task data based on the data processing task to obtain second task data.
[0075] In some embodiments, corresponding to step S310, the command processing unit 111 can determine the task type in the first processing task information based on the parsed first processing task information, and extract corresponding task parameters based on the task type. The task parameters will be passed to the computing unit 112 so that it can correctly execute the computing task.
[0076] In some embodiments, the command processing unit 111 can also adjust the task allocation according to the current load conditions. For example, if a computing unit 112 is heavily loaded, the command processing unit 111 can allocate tasks to other idle computing units 112 to avoid wasting resources. If multiple tasks arrive at the command processing unit 111 at the same time, the command processing unit 111 can schedule them according to the priority of the tasks. High-priority tasks will be allocated to computing units 112 first to ensure that important tasks can be processed in a timely manner.
[0077] In some embodiments, the command processing unit 111 can assign corresponding data processing tasks to the computing unit 112 by constructing a task descriptor based on the first processing task information. For example, the command processing unit 111 can encapsulate information such as the task type, task parameters, and target computing unit 112 in the first processing task information into a standardized task descriptor and send it to the computing unit 112 to guide it to perform a specific computing task.
[0078] In some embodiments, corresponding to step S320, the computing unit 112 may receive a task descriptor transmitted from the command processing unit 111, wherein the task descriptor includes a task type, task parameters, and a pointer or buffer address of the first task data to perform the following steps:
[0079] Loading the first task data: The computing unit 112 loads the first task data from the memory according to the data pointer or buffer address in the task descriptor. For large-scale data sets, the computing unit 112 can use block loading to gradually load the data into the cache to reduce the pressure on the memory bandwidth; and in order to improve the efficiency of data loading, the computing unit 112 can also load the data required for subsequent use into the cache in advance to avoid pauses caused by data missing. Data prefetching can be implemented through hardware or software, depending on the architecture of the computing unit 112.
[0080] Executing data processing tasks: The computing unit 112 can call the corresponding computing kernel to execute the data processing task according to the task type in the task descriptor. The computing kernel is a pre-written low-level code specifically used to perform a specific type of data processing operation to obtain processed data, namely, the second task data.
[0081] Generate second task data: The computing unit 112 stores the second task data in the specified memory area. The second task data can be intermediate results such as gradients and activation values, or final results such as prediction values and loss function values. After generating the second task data, the computing unit 112 can notify the command processing unit 111 through an asynchronous mechanism, informing that the data processing has been completed, so that the computing unit 112 can start processing a new task after completing the task.
[0082] In some embodiments, it is worth noting that the computing unit 112 can be used to implement simple data processing such as broadcast, scatter, gather, all-gather, reduce, all-reduce, reduce-scatter and point-to-point communication send / receive primitives provided by NCCL. These operations do not require complex computing logic, but focus on efficient data transmission and synchronization to improve the efficiency and performance of distributed communication.
[0083] refer to Figure 4 , Figure 4 is a main flow chart of sending a communication message in some embodiments of the present disclosure; in some embodiments, the processor 110 further includes a data transmission unit 113, which obtains a first data processing instruction according to the first transmission task information, and sends a communication message carrying the first data processing instruction and the second task data to the next processor, which at least includes the following steps:
[0084] Step S410, obtaining a first data processing instruction based on the first transmission task information through the command processing unit 111;
[0085] Step S420, constructing a communication message according to the first data processing instruction and the second task data through the data transmission unit 113;
[0086] Step S430: Send the communication message to the next processor through the data transmission unit 113.
[0087] In some embodiments, corresponding to step S410, the command processing unit 111 can parse the first transmission task information from the communication data packet. When the processor is a graphics processing unit (GPU), the information may include the identifier of the processor 110, the communication protocol type, the transmission mode, and the instruction type required for subsequent processing; further, the command processing unit 111 can parse the identifier of the target GPU, and determine the destination of the communication message by querying the internal routing table or using a predefined topology structure, and select a suitable communication protocol according to the protocol type in the first transmission task information. Different protocols are suitable for different application scenarios. For example, RDMA is suitable for low-latency, high-bandwidth communication, while MPI is suitable for complex distributed computing tasks; further, the command processing unit 111 can also generate corresponding data processing instructions according to the instruction type in the first transmission task information. The data processing instructions can be specific calculation operations such as addition, multiplication, reduction, etc., or they can be control instructions such as synchronization and broadcasting.
[0088] It can be understood that the command processing unit 111 formats the parsed target address, communication protocol and instruction type into a standardized data structure as a first data processing instruction. The first data processing instruction will be embedded in subsequent communication messages to instruct the receiving GPU how to process the received data. In order to improve efficiency, the command processing unit 111 can also cache the generated first data processing instructions to avoid the need to regenerate them each time, so that instructions can be quickly obtained in similar communication tasks in the future, reducing processing time.
[0089] In some embodiments, corresponding to step S420, the data transmission unit 113 receives a first data processing instruction from the command processing unit 111, and receives second task data from the computing unit 112, where the second task data is the result of processing by the computing unit 112 in step S230. The data transmission unit 113 may construct a header of the communication message according to the first data processing instruction. When the processor is a graphics processing unit (GPU), the message header may include the following fields: source address: identifier of the sender's GPU; destination address: identifier of the recipient's GPU; communication protocol: type of communication protocol used; instruction Type: the type of the first data processing instruction (such as gradient aggregation, model parameter update, etc.); Payload length: the size of the second task data (in bytes); Sequence number: a unique identifier used to track communication messages to ensure that the receiver can correctly reassemble multiple segments of transmitted data; Further, the data transmission unit 113 can combine the message header and the second task data as the message body into a communication message, with the message header located at the front end of the message, followed by the message body, so that the processor 110 of the receiver can first read the message header and process the second task data in the message body according to the first data processing instruction in the message header.
[0090] In some embodiments, in order to reduce communication overhead, the data transmission unit 113 may also compress the second task data or perform load segmentation processing. For example, if the second task data is too large to be transmitted all at once, the data transmission unit 113 may segment it into multiple smaller segments, each of which will be sent as an independent communication message, and the receiver may reassemble the complete data according to the sequence number in the message header.
[0091] In some embodiments, corresponding to step S430, after the command processing unit 111 is responsible for parsing the first transmission task information and generating the first data processing instruction, and the data transmission unit 113 constructs a communication message according to the first data processing instruction and the second task data, the data transmission unit 113 can send the communication message to the next processor by selecting a suitable communication protocol and transmission mode, and can adopt an asynchronous sending and retransmission mechanism during the transmission process to improve the parallel performance and reliability of the system.
[0092] refer to Figure 5 , Figure 5 is a main flow chart for selecting a message transmission path in some embodiments of the present disclosure; in some embodiments, sending a communication message to a next processor through the data transmission unit 113 includes at least the following steps:
[0093] Step S510, determining the next processor according to the first transmission task information by the command processing unit 111;
[0094] Step S520, selecting a message transmission path whose destination is the next processor through the data transmission unit 113;
[0095] Step S530: Send the communication message to the next processor through the data transmission unit 113 based on the message transmission path.
[0096] In some embodiments, the command processing unit 111 receives the first transmission task information generated from step S240. When the processor is a graphics processing unit (GPU), the information generally includes an identifier of the target GPU, a communication protocol type, a transmission mode, and an instruction type required for subsequent processing. The command processing unit 111 can determine the destination of the communication message by parsing the identifier of the target GPU, determine the processor 110 corresponding to the destination as the next processor, and verify the status of the target GPU through a heartbeat detection mechanism or network status monitoring. If the target GPU is unreachable, the command processing unit 111 can trigger an error handling mechanism to notify the host computer application or take other recovery measures.
[0097] In some embodiments, the data transmission unit 113 can determine the connection relationship between each GPU based on the topology information of the current network. The topology information can be obtained through a static configuration file, a dynamic detection mechanism or a network management tool, and the data transmission unit 113 can select the message transmission path matched by the next processor based on the network topology information.
[0098] In addition, it is worth noting that in order to improve the fault tolerance of the system, the data transmission unit 113 can also select multiple redundant paths corresponding to the next processor to ensure that communication can continue even if some paths fail, wherein the selection of redundant paths can be achieved through multi-path transmission or redundant routing protocols.
[0099] In some embodiments, in the process of sending the communication message to the next processor based on the message transmission path through the data transmission unit 113, the data transmission unit 113 can construct the header of the communication message according to the first processing instruction corresponding to the first transmission task information, construct the message body according to the second task data, and combine the message header and the message body into a complete communication message. The message header is located at the front end of the message, followed by the message body, so that the next processor as the receiver can perform data processing on the second task data based on the first data processing instruction.
[0100] In some embodiments, in the process of sending a communication message to the next processor based on the message transmission path through the data transmission unit 113, if the communication message is successfully sent, the data transmission unit 113 can record the sending log for subsequent debugging and monitoring. In addition, the sending processor 110 can immediately start processing a new task without waiting for the receiver's confirmation; if the communication message fails to be sent, such as network failure, target unreachable, etc., the data transmission unit 113 can trigger a retransmission mechanism and try to resend the communication message. If multiple retransmissions still fail, the data transmission unit 113 can notify the host computer application through the command processing unit 111 or take other recovery measures.
[0101] refer to Figure 6 , Figure 6 It is another schematic diagram of a distributed communication device 100 in some embodiments of the present disclosure; the distributed communication device includes a processor 110, and an upper processor 120 and a lower processor 130 respectively connected to the processor 110, the upper processor 120 is used to send data messages to the processor 110, and the upper processor 120 is used to receive data messages sent by the processor 110, and multiple processors 110 are interconnected through their respective data transmission units 113, wherein it is worth noting that the upper processor 120 and the lower processor 130 can be physically the same processor 110, that is, one processor 110 and another processor 110 send messages to each other.
[0102] refer to Figure 7 , Figure 7 is a main flow chart of receiving a data message sent by the previous processor 120 in some embodiments of the present disclosure; in some embodiments, the distributed communication method further includes at least the following steps:
[0103] Step S710, when receiving a data message sent by the previous processor 120, performing a processing instruction detection on the data message;
[0104] Step S720, when the data message carries the first data processing instruction, performing data processing on the second task data carried by the data message based on the first data processing instruction;
[0105] Step S730: When the data message does not carry the first data processing instruction, in response to the first data processing instruction sent by the host computer application, data processing is performed on the second task data carried by the data message.
[0106] Step S710: When receiving a data message sent by the previous processor 120, perform a processing instruction detection on the data message.
[0107] In some embodiments, corresponding to step S710, when a processor 110 receives a data packet sent by the previous processor 120, it is first necessary to perform a processing instruction detection on the data packet. For example, the data transmission unit 113 receives a data packet from the previous processor 120, and the command processing unit 111 parses the header information of the data packet and extracts the first data processing instruction. The command processing unit 111 checks whether the first data processing instruction exists. If so, it goes to step S720; if not, it goes to step S730.
[0108] In some embodiments, corresponding to step S720, if the data message carries the first data processing instruction, the processor 110 will process the second task data in the data message according to the instruction. It can be understood that the command processing unit 111 extracts the first data processing instruction from the data message, and the computing unit 112 processes the second task data according to the first data processing instruction. For example, it can be gradient aggregation, model parameter update and other operations. After the processing is completed, new task data (third task data) is generated and is ready to be sent to the next processor 130.
[0109] In some embodiments, corresponding to step S730, if there is no first data processing instruction in the data message, the processor 110 will process the second task data in the data message according to the instruction issued by the host computer application. It can be understood that the command processing unit 111 receives the first data processing instruction issued by the host computer application, and the computing unit 112 processes the second task data according to the first data processing instruction.
[0110] In some embodiments, data processing is performed on the second task data carried by the data message based on the first data processing instruction, including: when the first data processing instruction includes second processing task information and second transmission task information, data processing is performed on the second task data carried by the data message according to the second processing task information to obtain third task data; the second data processing instruction is obtained according to the second transmission task information, and the communication message carrying the second data processing instruction and the third task data is sent to the next processor 130 corresponding to the second transmission task information, so that the next processor 130 corresponding to the second transmission task information performs data processing on the third task data based on the second data processing instruction; it can be understood that the communication data packet sent by the upper computer application can carry the transmission task information of the current processor 110 and subsequent multiple image processors. Through the above steps, the distributed communication method in the present disclosure can effectively transmit and process data between multiple processors 110, and each processor 110 can perform corresponding data processing according to the instructions in the received data message, and pass the processed data to the next processor 130 along with subsequent instructions, so as to be suitable for complex distributed computing scenarios.
[0111] refer to Figure 8 , Figure 8 is a schematic diagram of communication between processors 110 in some embodiments of the present disclosure. Figure 8 In FIG. 1 , a distributed communication link between two processors 110 is shown. Each processor 110 includes the following components: a command processing unit 111: responsible for parsing and executing data processing instructions; a computing unit 112: performing specific computing tasks; and a data transmission unit 113: responsible for encoding, decoding, and transmitting data. The data transmission unit 113 is further divided into: an encoding end: encoding data, generating a message command header and message metadata; a decoding end: decoding received data. The two processors 110 communicate with each other through protocols such as PCIe / RDMA.
[0112] In some embodiments, the data transmission unit 113 includes a hardware transcoding device installed on the processor 110, and the communication message is constructed according to the first data processing instruction and the second task data by the data transmission unit 113, which includes at least the following steps: encoding the first data processing instruction by the hardware transcoding device to obtain a message command header; encoding the second task data by the hardware transcoding device to obtain message metadata; splicing the message command header and the message metadata to construct a communication message; wherein it can be understood that the hardware transcoding device is used to encode the data processing instruction, and can convert the first data processing instruction into a binary or compressed format message command header according to a predefined protocol format. For example, the hardware transcoding device can package information such as instruction type, source address, target address, serial number, etc. into a compact binary format to reduce the size of the message header; in addition, since the hardware transcoding device has parallel processing capabilities, it can complete the encoding of multiple instructions in a short time, which makes the instruction encoding speed much higher than the traditional software implementation method, so by directly integrating the hardware transcoding device into the processor 110, the communication efficiency can be effectively improved.
[0113] For example, assume that there are three processors in the disclosed method: A (previous processor 120), B (processor 110) and C (next processor 130), and data needs to be transferred from A to B and then to C in sequence:
[0114] In the process of A->B: A encodes the first data processing instruction through the hardware transcoding device to generate a message command header. A encodes the second task data through the hardware transcoding device to generate message metadata. A splices the message command header and the message metadata together to construct a communication message, and sends it to B through the communication protocol. After receiving the communication message, B decodes the message command header through the hardware transcoding device, obtains the first data processing instruction, and processes the second task data according to the instruction to generate the third task data.
[0115] In the process of B->C: the second data processing instruction is embedded in the first data processing instruction, B obtains the second data processing instruction according to the first data processing instruction, and B encodes the second data processing instruction through the hardware transcoding device to generate a new message command header. B encodes the third task data through the hardware transcoding device to generate new message metadata. B splices the new message command header and the message metadata together to construct a communication message, and sends it to C through the communication protocol. After receiving the communication message, C decodes the message command header through the hardware transcoding device, obtains the second data processing instruction, and processes the third task data according to the instruction to generate the fourth task data.
[0116] It can be understood that the message command header of the communication message can include data processing instructions corresponding to the subsequent multiple processors 110, and then in the subsequent data transmission process, the subsequent multiple processors 110 can extract the corresponding data processing instructions from the message command header in turn, and then execute the corresponding data processing tasks.
[0117] refer to Fig. 9 , Fig. 9 is a main flow chart of sending a communication message based on a target communication protocol in some embodiments of the present disclosure; in some embodiments, sending a communication message carrying a first data processing instruction and a second task data to a next processor 130 includes at least the following steps:
[0118] Step S910, determining the connection relationship between the processor 110 and the next processor 130;
[0119] Step S910: Select a target communication protocol according to the connection relationship, and send a communication message carrying the first data processing instruction and the second task data to the next processor 130 based on the target communication protocol.
[0120] It is understandable that before sending a communication message, it is first necessary to determine the connection relationship between the current processor 110 and the next processor 110 that will receive the message, and then establish the connection relationship, select an appropriate target communication protocol, and construct and send the communication message based on the protocol.
[0121] refer to Fig.10 , Fig.10 is a main flow chart for selecting a target communication protocol in some embodiments of the present disclosure; in some embodiments, selecting a target communication protocol according to a connection relationship includes at least the following steps:
[0122] Step S1010, when the connection relationship represents that the processor 110 and the next processor 130 are located in the same node, selecting the local node communication protocol as the target communication protocol;
[0123] Step S1020, when the connection relationship represents that the processor 110 and the next processor 130 are located in different nodes, selecting a cross-node communication protocol as a target communication protocol;
[0124] Among them, the local node communication protocol includes the PCle communication protocol, and the cross-node communication protocol includes the RoCEv2 communication protocol.
[0125] In some embodiments, when two processors 110 are located in the same computing node, in this case, the disclosed solution may select a local node communication protocol as the target communication protocol. Communications within the local node are generally faster and have lower latency because they do not need to be transmitted over the network. The local node communication protocol mentioned here may include PCle.
[0126] In some embodiments, when two processors 110 are located in different server nodes or computing nodes, a cross-node communication protocol is selected. Cross-node communication may involve more complex network settings, so a protocol that can efficiently transmit data across network boundaries is required. The cross-node communication protocol may include RoCEv2, which allows remote direct memory access, thereby reducing network transmission latency and CPU load.
[0127] It can be understood that the above process can optimize the communication efficiency between processors 110 and ensure that the most suitable communication protocol can be selected in different situations (same node or across nodes) to achieve fast and reliable data exchange.
[0128] In some embodiments, after performing data processing on the second task data carried by the data message based on the first data processing instruction, the distributed communication method further includes: if a task result indicating the completion of the data processing task is obtained, reporting the task result to the host computer.
[0129] In a specific embodiment, the present disclosure may include the following steps: when the processor is a graphics processing unit (GPU), the GPU application generates and sends a CCLPacket containing commands and data to the processor card; after receiving the CCLPacket, the command processing unit inside the GPU card parses the content therein and assigns the corresponding task to the computing unit; after receiving the task, the computing unit performs the corresponding computing operation and generates a computing result; the transmission unit encodes the command part according to the CCLPacket content parsed by the processor to generate a first data processing instruction CMD; the transmission unit obtains the second task data as the computing result from the computing unit, and splices it with the previously generated CMD to form a complete communication message payload; the transmission unit selects a suitable transmission path (PCIe or RDMA) according to specific transmission requirements, and sends the payload to the receiving end; after receiving the communication message, the transmission unit at the receiving end checks whether the data carries the CMD; if the data carries the CMD, the transmission unit at the receiving end parses the CMD information from the data header, and the receiving end continues to receive the subsequent second task data, and further processes the data according to the information in the CMD, so that the sender can independently perform the sending operation, and the receiver can process the data immediately after receiving the data, thereby avoiding mutual blocking.
[0130] Distributed communication device description of the embodiment of the present disclosure
[0131] According to another aspect of the present disclosure, a distributed communication device is provided, comprising: a plurality of processors connected in communication; wherein each processor is used to: receive a communication data packet sent by an upper computer application; obtain first task data, first processing task information and first transmission task information according to the communication data packet; perform data processing on the first task data according to the first processing task information to obtain second task data; obtain a first data processing instruction according to the first transmission task information, and send a communication message carrying the first data processing instruction and the second task data to the next processor, so that the next processor performs data processing on the second task data based on the first data processing instruction.
[0132] Among them, a distributed communication device formed by multiple processors connected by communication is used to execute a distributed communication method. For each processor in the distributed communication device, by receiving a communication data packet sent by an upper computer application, first task data, first processing task information and first transmission task information can be obtained according to the communication data packet; the first task data can be processed according to the first processing task information to obtain second task data; the first data processing instruction can be obtained according to the first transmission task information, and a communication message carrying the first data processing instruction and the second task data can be sent to the next processor, so that the next processor can process the second task data based on the first data processing instruction; it can be understood that in traditional bilateral operations, the sender must wait for the receiver to confirm that the data has been received before continuing to execute subsequent tasks, which increases the communication cost. The signal delay and limits the parallel performance of the system. In the present disclosure, after the processor of the sender sends out the communication message carrying the data processing instructions and task data, it can immediately prepare for the next task without waiting for the confirmation of the receiver. After receiving the communication message, the processor of the receiver can directly process the task data according to the data processing instructions therein without waiting for additional instructions, that is, the above-mentioned unilateral operation method allows the sender to independently perform the sending operation, and the receiver can process the data immediately after receiving the data. The sender and the receiver will not block each other, which can effectively reduce the waiting time for synchronization between the two. At the same time, by merging the command and the load into a communication message for transmission, the additional communication overhead can also be reduced, avoiding multiple interactions between the sender, the host computer and the receiver, and further reducing the communication delay. In summary, by introducing unilateral operation and command and load combined transmission, the distributed communication method disclosed in the present disclosure can effectively solve the high synchronization overhead problem caused by the blocking operation in the prior art point-to-point communication, realize efficient and low-latency communication, and thus significantly improve the data processing performance of multiple processors.
[0133] In some embodiments, the processor includes a command processing unit, a data transmission unit and a computing unit. The data transmission unit includes a hardware transcoding device installed on the processor. The hardware transcoding device includes an encoding end and a decoding end. The encoding end is used to send communication messages to another processor, and the decoding end is used to receive communication messages sent by another processor.
[0134] In some embodiments, when the first task data is processed according to the first processing task information to obtain the second task data, the command processing unit is used to assign the corresponding data processing task to the computing unit according to the first processing task information; the computing unit is used to process the first task data based on the data processing task to obtain the second task data.
[0135] In some embodiments, when a first data processing instruction is obtained based on first transmission task information and a communication message carrying the first data processing instruction and second task data is sent to the next processor, the command processing unit is used to obtain the first data processing instruction based on the first transmission task information; the data transmission unit is used to construct a communication message based on the first data processing instruction and the second task data, and send the communication message to the next processor.
[0136] In some embodiments, when a communication message is sent to the next processor through a data transmission unit, the command processing unit is used to determine the next processor based on the first transmission task information; the data transmission unit is used to select a message transmission path with the sending target being the next processor, and send the communication message to the next processor based on the message transmission path.
[0137] In some embodiments, the processor is also used to: when receiving a data packet sent by a previous processor, perform processing instruction detection on the data packet; when the data packet carries a first data processing instruction, perform data processing on the second task data carried by the data packet based on the first data processing instruction; when the data packet does not carry the first data processing instruction, perform data processing on the second task data carried by the data packet in response to the first data processing instruction issued by the upper computer application.
[0138] In some embodiments, when data processing is performed on second task data carried by a data message based on a first data processing instruction, when the first data processing instruction includes second processing task information and second transmission task information, the processor is also used to: perform data processing on the second task data carried by the data message according to the second processing task information to obtain third task data; obtain the second data processing instruction according to the second transmission task information, and send the communication message carrying the second data processing instruction and the third task data to the next processor corresponding to the second transmission task information, so that the next processor corresponding to the second transmission task information performs data processing on the third task data based on the second data processing instruction.
[0139] In some embodiments, when a communication message is constructed according to a first data processing instruction and a second task data through a data transmission unit, a hardware transcoding device is used to: encode the first data processing instruction to obtain a message command header; encode the second task data to obtain message metadata; and splice the message command header and the message metadata to construct a communication message.
[0140] In some embodiments, when a communication message carrying a first data processing instruction and a second task data is sent to a next processor, the data transmission unit is used to: determine the connection relationship between the processor and the next processor; when the connection relationship indicates that the processor and the next processor are located in the same node, select the local node communication protocol as the target communication protocol; when the connection relationship indicates that the processor and the next processor are located in different nodes, select the cross-node communication protocol as the target communication protocol; wherein the local node communication protocol includes the PCle communication protocol, and the cross-node communication protocol includes the RoCEv2 communication protocol.
[0141] The distributed communication device disclosed in the present invention is used to execute the distributed communication method as in the above embodiment, and its specific processing process is the same as the distributed communication method in the above embodiment, which will not be repeated here.
[0142] Description of the electronic device of the present disclosure
[0143] According to another aspect of the present disclosure, an electronic device is provided, including a distributed communication device as in any of the above-mentioned embodiments, wherein the distributed communication device formed by a plurality of processors being connected by communication is used to execute a distributed communication method, and for each processor in the distributed communication device, a communication data packet sent by an upper computer application can be received, and according to the communication data packet, first task data, first processing task information and first transmission task information can be obtained; data processing is performed on the first task data according to the first processing task information to obtain second task data; a first data processing instruction is obtained according to the first transmission task information, and a communication message carrying the first data processing instruction and the second task data is sent to a next processor, so that the next processor performs data processing on the second task data based on the first data processing instruction; wherein it can be understood that in traditional bilateral operations, the sender must wait for the receiver to confirm receipt. The subsequent tasks can only be continued after receiving the data, which increases the communication delay and limits the parallel performance of the system. In the present disclosure, after the processor of the sender sends out the communication message carrying the data processing instructions and task data, it can immediately prepare for the next task without waiting for the confirmation of the receiver. After receiving the communication message, the processor of the receiver can directly process the task data according to the data processing instructions therein without waiting for additional instructions, that is, the above-mentioned unilateral operation method allows the sender to independently perform the sending operation, and the receiver can process it immediately after receiving the data. The sender and the receiver will not block each other, which can effectively reduce the waiting time for synchronization between the two. At the same time, by merging the command and the load into a communication message for transmission, the additional communication overhead can also be reduced, avoiding multiple interactions between the sender, the host computer and the receiver, and further reducing the communication delay. In summary, by introducing unilateral operation and command and load combined transmission, the distributed communication method disclosed in the present disclosure can effectively solve the high synchronization overhead problem caused by the blocking operation in the prior art point-to-point communication, realize efficient and low-latency communication, thereby significantly improving the data processing performance of multiple processors.
[0144] Among them, the electronic device disclosed in the present invention includes a distributed communication device, which is used to execute the distributed communication method as in the above embodiment. Its specific processing process is the same as the distributed communication method in the above embodiment, and will not be repeated here.
[0145] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0146] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0147] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood as not including the number, and above, below, within, etc. are understood as including the number.
[0148] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0149] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0150] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0151] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0152] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A distributed communication method, characterized in that: Applied to a distributed communication device, the distributed communication device includes a plurality of processors connected in a distributed communication manner, and for each of the processors, the distributed communication method includes: Receive communication data packets sent by the host computer application; According to the communication data packet, first task data, first processing task information and first transmission task information are obtained; Performing data processing on the first task data according to the first processing task information to obtain second task data; A first data processing instruction is obtained according to the first transmission task information, and a communication message carrying the first data processing instruction and the second task data is sent to a next processor, so that the next processor processes the second task data based on the first data processing instruction.
2. The distributed communication method according to claim 1, characterized in that: The processor includes a command processing unit and a computing unit, and the step of performing data processing on the first task data according to the first processing task information to obtain second task data includes: Allocate corresponding data processing tasks to the computing unit according to the first processing task information by the command processing unit; The computing unit performs data processing on the first task data based on the data processing task to obtain second task data.
3. The distributed communication method according to claim 2, characterized in that: The processor further includes a data transmission unit, which obtains a first data processing instruction according to the first transmission task information, and sends a communication message carrying the first data processing instruction and the second task data to a next processor, including: Obtaining, by the command processing unit, a first data processing instruction based on the first transmission task information; Constructing a communication message according to the first data processing instruction and the second task data by the data transmission unit; The communication message is sent to the next processor through the data transmission unit.
4. The distributed communication method according to claim 3, characterized in that: The sending the communication message to the next processor through the data transmission unit includes: Determining a next processor according to the first transmission task information by the command processing unit; Selecting, by the data transmission unit, a message transmission path whose sending target is the next processor; The communication message is sent to the next processor through the data transmission unit based on the message transmission path.
5. The distributed communication method according to claim 1, characterized in that: The distributed communication method further comprises: When receiving a data message sent by a previous processor, performing processing instruction detection on the data message; In a case where the data message carries the first data processing instruction, performing data processing on the second task data carried by the data message based on the first data processing instruction; In the case that the data message does not carry the first data processing instruction, in response to the first data processing instruction issued by the host computer application, data processing is performed on the second task data carried by the data message.
6. The distributed communication method according to claim 5, characterized in that: The performing data processing on the second task data carried by the data message based on the first data processing instruction includes: In a case where the first data processing instruction includes second processing task information and second transmission task information, data processing is performed on the second task data carried by the data message according to the second processing task information to obtain third task data; A second data processing instruction is obtained according to the second transmission task information, and a communication message carrying the second data processing instruction and the third task data is sent to the next processor corresponding to the second transmission task information, so that the next processor corresponding to the second transmission task information processes the third task data based on the second data processing instruction.
7. The distributed communication method according to claim 3, characterized in that: The data transmission unit includes a hardware transcoding device installed on the processor, and the communication message is constructed according to the first data processing instruction and the second task data by the data transmission unit, including: Encoding the first data processing instruction by the hardware transcoding device to obtain a message command header; Encoding the second task data by the hardware transcoding device to obtain message metadata; The message command header and the message metadata are concatenated to construct a communication message.
8. The distributed communication method according to claim 1, characterized in that: The step of sending the communication message carrying the first data processing instruction and the second task data to the next processor comprises: Determining a connection relationship between the processor and a next processor; A target communication protocol is selected according to the connection relationship, and a communication message carrying the first data processing instruction and the second task data is sent to the next processor based on the target communication protocol.
9. The distributed communication method according to claim 8, characterized in that: The selecting a target communication protocol according to the connection relationship comprises: In a case where the connection relationship indicates that the processor and the next processor are located in the same node, selecting a local node communication protocol as a target communication protocol; In a case where the connection relationship indicates that the processor and the next processor are located in different nodes, selecting a cross-node communication protocol as a target communication protocol; Among them, the local node communication protocol includes the PCle communication protocol, and the cross-node communication protocol includes the RoCEv2 communication protocol.
10. A distributed communication device, characterized in that: include: Multiple processors connected in communication; Among them, each of the processors is used to: receive a communication data packet sent by an upper computer application; obtain first task data, first processing task information and first transmission task information according to the communication data packet; perform data processing on the first task data according to the first processing task information to obtain second task data; obtain a first data processing instruction according to the first transmission task information, and send a communication message carrying the first data processing instruction and the second task data to the next processor, so that the next processor performs data processing on the second task data based on the first data processing instruction.
11. The distributed communication device according to claim 10, characterized in that: The processor includes a command processing unit, a data transmission unit and a computing unit. The data transmission unit includes a hardware transcoding device installed on the processor. The hardware transcoding device includes an encoding end and a decoding end. The encoding end is used to send the communication message to another processor, and the decoding end is used to receive the communication message sent by another processor.
12. An electronic device, characterized in that: Comprising a distributed communication device as described in any one of claims 10 to 11.