Data processing method and device applied to set communication, equipment and storage medium

By sending requests containing multiple device address information and data to the network device, the network device completes data reading, processing and writing, solving the delay problem caused by the inability to realize all data processing and multiple data interactions in the prior art, and achieving efficient data processing and shortened delay.

CN119814872APending Publication Date: 2025-04-11MOORE THREADS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411997253.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art cannot realize that all data processing operations are performed by network devices, and multiple data interactions between local devices and network devices during the collective communication process lead to a large delay.

Method used

By sending a request to the network device that includes at least one second device address information, data provided by the first device and at least one third device address information, the network device reads, processes and writes data, implements a complete process of data processing, and reduces the number of request interactions between the local device and the network device.

Benefits of technology

The data processing operations are completed using on-network computing, avoiding the consumption of additional computing resources of local devices and shortening the delay in data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814872A_ABST
    Figure CN119814872A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device applied to set communication, equipment and a storage medium, and relates to the technical field of data processing. The method comprises the following steps: a first device sends a first request to a network device, wherein the first request comprises address information of at least one second device, data provided by the first device and address information of at least one third device; the network device determines result data according to the data provided by the first device and the data read from the at least one second device; and the network device writes the result data into the third device according to the address information of the at least one third device. According to the method and the device, the network equipment can obtain all data participating in the processing operation, so that the whole processing operation is realized by utilizing online computing, and local computing resources of the first equipment do not need to be additionally consumed. Moreover, only one request interaction process needs to be carried out between the first equipment and the network equipment, so that the number of times of the request interaction process is reduced, and the time delay is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, equipment and storage medium applied to collective communication. Background Art

[0002] Collective communication is an important concept in parallel computing, which is used to exchange data and synchronize operations between multiple processes. Collective communication involves coordination between multiple processes to complete operations such as broadcast, scatter, gather, all gather, reduce, and all reduce.

[0003] In-Network Computing is a technology that accelerates data processing and communication by using network devices (such as switches, network cards, etc.) for computing. It breaks through the limitations of traditional computing architecture and transfers some computing tasks from the host CPU (Central Processing Unit) and GPU (Graphics Processing Unit) to network devices, thereby improving the overall performance of the system.

[0004] At present, the data processing operations in collective communication can be performed by network devices using on-line computing, thereby saving the computing resources of local devices. However, it is still not possible to use on-line computing to perform all data processing operations by network devices, and the above process involves multiple data interactions between local devices and network devices, resulting in large delays. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, apparatus, device and storage medium for collective communication. The technical solution provided by the embodiments of the present application includes the following aspects.

[0006] According to one aspect of an embodiment of the present application, a data processing method applied to collective communication is provided, the method comprising:

[0007] A first device sends a first request to a network device, where the first request includes: address information of at least one second device, data provided by the first device, and address information of at least one third device;

[0008] The network device reads data from the at least one second device respectively according to the address information of the at least one second device;

[0009] The network device determines result data according to the data provided by the first device and the data respectively read from the at least one second device;

[0010] The network device writes the result data into the at least one third device according to the address information of the at least one third device.

[0011] According to one aspect of an embodiment of the present application, a data processing method applied to collective communication is provided, the method being executed by a first device, the method comprising:

[0012] A first request is sent to a network device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

[0013] According to one aspect of an embodiment of the present application, a data processing method applied to collective communication is provided, the method being executed by a network device, the method comprising:

[0014] A first request is received from a first device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

[0015] According to one aspect of an embodiment of the present application, there is provided a data processing device for collective communication, the device comprising:

[0016] A sending module is used to send a first request to a network device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

[0017] According to one aspect of an embodiment of the present application, there is provided a data processing device for collective communication, the device comprising:

[0018] A receiving module is used to receive a first request sent by a first device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

[0019] According to one aspect of an embodiment of the present application, a device is provided, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the data processing method applied to collective communication executed by the above-mentioned first device, or to implement the data processing method applied to collective communication executed by the above-mentioned network device.

[0020] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is used to be executed by a processor to implement the data processing method applied to collective communication executed by the above-mentioned first device, or to implement the data processing method applied to collective communication executed by the above-mentioned network device.

[0021] According to one aspect of an embodiment of the present application, a chip is provided, which includes a programmable logic circuit and / or program instructions. When the chip is running, it is used to implement the data processing method applied to collective communication executed by the above-mentioned first device, or to implement the data processing method applied to collective communication executed by the above-mentioned network device.

[0022] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program, and the computer program is loaded and executed by a processor to implement the data processing method applied to collective communication executed by the above-mentioned first device, or to implement the data processing method applied to collective communication executed by the above-mentioned network device.

[0023] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:

[0024] In the embodiment of the present application, the first request sent by the first device to the network device is different from the traditional read request and write request. In addition to the address information of at least one second device, the first request may also include the data provided by the first device and the address information of at least one third device. On the one hand, in the case where the data provided by the first device also participates in the processing operation, the first request sent by the first device includes the data provided by the first device, so that the network device can obtain all the data involved in the processing operation based on the address information of each second device and the data provided by the first device, so that the network device directly completes the processing operation to obtain the result data, and uses the network computing to realize the entire processing operation without consuming the local computing resources of the first device. On the other hand, the network device can send the result data obtained by the processing operation to the third device according to the address information of the third device included in the first request, so that when the complete process of data reading, data processing and data writing involved in the collective communication data processing process is realized, only one request interaction process is required between the first device and the network device, and multiple request interaction processes are not required between the first device and the network device, which saves the number of request interaction processes and shortens the delay. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A schematic diagram of a full protocol operation is exemplarily shown;

[0026] Figure 2 A schematic diagram exemplarily shows the reduction divergence step in the full reduction operation;

[0027] Figure 3 A schematic diagram exemplarily shows a full collection step in a full reduction operation;

[0028] Figure 4 It is a schematic diagram of the related technology using on-network computing to achieve full protocol operation;

[0029] Figure 5 It is a flowchart of the related technology using on-line computing to realize full protocol operation;

[0030] Figure 6 It is a schematic diagram of a solution implementation environment provided in a possible implementation of the present application;

[0031] Figure 7 is a flow chart of a data processing method applied to collective communication provided in a possible implementation of the present application;

[0032] Figure 8 is a flow chart of a data processing method applied to collective communication provided in another possible implementation of the present application;

[0033] Fig. 9is a flowchart of a data processing method applied to collective communication provided in another possible implementation of the present application;

[0034] Fig.10 is a flow chart of a data processing method applied to collective communication provided in another possible implementation of the present application;

[0035] Fig.11 It is a schematic diagram of the present application using on-line computing to implement full protocol operation;

[0036] Fig.12 This is a flow chart of the application using on-line computing to implement full protocol operations;

[0037] Fig.13 is a block diagram of a data processing device applied to collective communication provided in a possible implementation of the present application;

[0038] Fig.14 is a block diagram of a data processing device applied to collective communication provided in another possible implementation of the present application;

[0039] Fig.15 It is a structural schematic diagram of a device provided in a possible implementation of the present application. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0041] Before introducing the technical solution of the present application, some processing operations in collective communication are first introduced.

[0042] In collective communication, each device is generally controlled by a different process, and the process number is called rank.

[0043] Collective communication involves coordination between multiple processes to complete operations such as broadcast, scatter, gather, all gather, reduce, and all reduce.

[0044] The broadcast operation is to broadcast the data of a process to other processes. The process that sends the broadcast operation is generally called the root process (root). After the operation is completed, all other processes get the data of the root process.

[0045] The divergence operation is that the root process divides the data equally and distributes each part of the data to different processes. It should be noted that in the divergence operation, other processes only get part of the data in the root process.

[0046] The collection operation is to aggregate the data of different processes to the root process, and finally the root process obtains the data of all other processes.

[0047] The full collection operation is to collect the data of different processes into all processes, and finally all processes have the data of all other processes.

[0048] The reduction operation is to obtain a set of data on each process, and then perform operations such as summing, finding the maximum value, and taking the average after obtaining the data on all processes. The final result data of the operation is aggregated to the root process.

[0049] The full reduction operation distributes the result data obtained by the reduction operation to all other processes. In fact, it is a combination of the reduction operation and the broadcast operation.

[0050] Figure 1 The schematic diagram of a full reduction operation is shown as an example. In a full reduction operation involving N devices, in the initial state, the send buffers (sendbuffer) of the N devices all contain a data array, the contents of which are recorded as sendbuff0[], sendbuff1[], ..., sendbuff(N-1)[], and the length of the array is recorded as L. After the full reduction operation is completed, the data arrays in all devices will be operated on so that the same result data is obtained on the N devices and recorded in the receive buffer (recvbuffer), whose length is also L. For example, when the operation is addition, recvbuff[i] = sum(sendbuff_k[i]), where k = 0, 1 ..., N-1, i = 0, 1, ..., L-1.

[0051] exist Figure 1 In the example of N=4, the data array sentbuff0[] contained in the send buffer of device 0 is recorded as data 0, the data array sentbuff1[] contained in the send buffer of device 1 is recorded as data 1, the data array sentbuff2[] contained in the send buffer of device 2 is recorded as data 2, and the data array sentbuff3[] contained in the send buffer of device 3 is recorded as data 3. After the full protocol operation is completed, the receive buffers of device 0, device 1, device 2 and device 3 all contain the same result data. For example, when the operation is addition, the result data is the sum of the above data 0, data 1, data 2 and data 3.

[0052] In order to improve the performance of full-reduce operations on hardware, full-reduce operations are generally split on N devices, each of which completes L / N data volumes. It can be considered that full-reduce operations are split into two steps: reduce scatter and all gather.

[0053] The reduce scatter steps are as follows: Figure 2 As shown, for each of the N devices, the data in the send buffer of each device will be divided into N parts, and the final result is that each device's receive buffer will obtain 1 / N of the result data. Assume Figure 2 In the example, N devices are device 0, device 1, device 2, and device 3, and their corresponding processes are rank 0, rank 1, rank 2, and rank 3. Data 0 in the send buffer of device 0 will be divided into 4 parts, each of which is L / N long, recorded as data 0-0, data 0-1, data 0-2, and data 0-3; data 1 in the send buffer of device 1 will be divided into 4 parts, each of which is L / N long, recorded as data 1-0, data 1-1, data 1-2, and data 1-3; data 2 in the send buffer of device 2 will be divided into 4 parts, each of which is L / N long, recorded as data 2-0, data 2-1, data 2-2, and data 2-3; data 3 in the send buffer of device 3 will be divided into 4 parts, each of which is L / N long, recorded as data 3-0, data 3-1, data 3-2, and data 3-3. According to the operators of the reduction operation (such as sum, maximum value, average, etc.), device 0 operates on data 0-0, data 1-0, data 2-0 and data 3-0 to obtain result data 0 with a length of L / N; device 1 operates on data 0-1, data 1-1, data 2-1 and data 3-1 to obtain result data 1 with a length of L / N; device 2 operates on data 0-2, data 1-2, data 2-2 and data 3-2 to obtain result data 2 with a length of L / N; device 3 operates on data 0-3, data 1-3, data 2-3 and data 3-3 to obtain result data 3 with a length of L / N.

[0054] The all gather steps are as follows Figure 3 As shown, for each of the N devices, each device will broadcast the result data of length L / N in its send buffer to other devices, and finally all devices will obtain the complete result data of length L. Figure 3 As shown, device 0 broadcasts result data 0 with a length of L / N to device 1, device 2 and device 3, device 1 broadcasts result data 1 with a length of L / N to device 0, device 2 and device 3, device 2 broadcasts result data 2 with a length of L / N to device 0, device 1 and device 3, device 3 broadcasts result data 3 with a length of L / N to device 0, device 1 and device 2, and finally device 0, device 1, device 2 and device 3 all obtain result data 0, result data 1, result data 2 and result data 3, which are the complete result data with a length of L.

[0055] At present, data processing operations in collective communication can use on-network computing, and network devices can perform part of the data processing operations, thereby saving the computing resources of local devices. Taking full-protocol operation as an example, the method flow of using on-network computing to implement full-protocol operation is as follows: Figure 4 and Figure 5 Still taking the full protocol operation participated by N (N=4) devices as an example, the process may include the following steps ① to ⑥.

[0056] Step ①, device 0 sends a multicast read request, which contains the address information of each destination device, such as the address information of device 1, device 2 and device 3.

[0057] Step ②: After receiving the read request, the network device multicasts it to each destination device. For example, the network device can send the read request to each destination device based on traditional multicast or multicast of the aggregation communication algorithm, that is, send the read request to device 1, device 2 and device 3 respectively.

[0058] Step ③, the destination device returns the read data, that is, device 1, device 2 and device 3 return their own read data to the network device respectively. Figure 2 and Figure 3 In the example shown, for full protocol operation, device 1 can send data 1-0 to the network device, device 2 can send data 2-0 to the network device, and device 3 can send data 3-0 to the network device.

[0059] Step ④, the network device performs a reduction operation on all returned read data through online calculation, and returns the reduced result to device 0. For example, taking the reduction operation as a sum operation as an example, the network device performs a sum operation on the read data returned by device 1, device 2, and device 3 through online calculation, and returns the sum result to device 0. Still taking the above example as an example, the network device returns the sum result of data 1-0, data 2-0, and data 3-0 to device 0.

[0060] Step ⑤, after device 0 performs a reduction operation on the received result and the local data, it issues a multicast write request. Exemplarily, device 0 performs a sum operation on the received result and the local data of device 0 to obtain the result data obtained by device 0. Still taking the above example as an example, device 0 performs a sum operation on the received sum result and the local data 0-0 of device 0 to obtain the result data 0. Then, device 0 issues a multicast write request, which includes the result data obtained by device 0 and the address information of each destination device, such as the address information of device 1, device 2 and device 3.

[0061] Step ⑥, after receiving the write request, the network device multicasts to each destination device. Exemplarily, the network device can send the write request to each destination device based on the traditional multicast or the multicast of the aggregation communication algorithm, that is, send the write request to device 1, device 2 and device 3 respectively. Device 1, device 2 and device 3 write the result data obtained by the above device 0 into their own receiving buffer according to the received write request.

[0062] Similarly, device 1, device 2 and device 3 perform operations similar to device 0, and finally device 0, device 1, device 2 and device 3 all obtain complete result data of result data 0, result data 1, result data 2 and result data 3.

[0063] Although the above scheme utilizes online computing, it is limited by the read and write instructions in network communication, resulting in the need to transmit the results of online computing back to the local device and then further reduce (i.e., step ⑤ above) to obtain the result of reduce scatter, which is then broadcast by the local device to other destination devices. Compared with the technical solution provided in this application, step ⑤ requires additional consumption of computing resources of the local device, such as GPU computing power or the need for additional local near-memory computing capabilities. At the same time, step ⑤ also leads to an increase in the overall completion delay, which will lead to performance degradation in machine learning reasoning application scenarios.

[0064] Please refer to Figure 6 , which shows a schematic diagram of a solution implementation environment provided in a possible implementation of the present application. The solution implementation environment can be implemented as a data processing system. Figure 6 As shown, the implementation environment of the solution may include: multiple processing nodes 10 and at least one network device 20.

[0065] The processing node 10 may be a device with data processing capabilities. The processing node 10 may be a GPU, a CPU, a TPU (Tensor Processing Unit), etc. A single processing node 10 may be implemented as a single device or be set in a single device, or at least two processing nodes 10 may be implemented as a single device or at least two processing nodes 10 may be set in a single device. The device implemented as or set in the processing node 10 may be a server or a terminal device, which is not limited in this application.

[0066] Optionally, the processing node 10 may be or be set in the following devices: a personal computer, a workstation, a game console, some mobile devices (such as a tablet computer, a smart phone, etc.), a vehicle-mounted terminal device, a smart home device, a smart TV, a smart robot, etc. The processing node 10 may also be or be set in the following devices: a server, a server cluster, an artificial intelligence computing cluster, a cloud computing cluster, etc., wherein the artificial intelligence computing cluster may also be referred to as an intelligent computing cluster or a smart computing cluster, which is not limited in this application.

[0067] The network device 20 is a dedicated hardware device used to connect various servers, terminal devices and other nodes to form an information communication network. The network device 20 can be a switch, a network card, a router, a bridge, a gateway and other devices.

[0068] The above-mentioned multiple processing nodes 10 can perform collective communication to complete operations such as broadcast, scatter, gather, all gather, reduce, and all reduce. In addition, at least one network device 20 can be used to implement on-line computing of data processing operations in collective communication.

[0069] Please refer to Figure 7 , which shows a flow chart of a data processing method for collective communication provided in a possible implementation of the present application. The method may include the following step 710.

[0070] Step 710: The first device sends a first request to the network device. The first request includes address information of at least one second device. The first request also includes at least one of the following: data provided by the first device, address information of at least one third device.

[0071] Correspondingly, the network device receives the first request sent by the first device.

[0072] The first device may be a processing node, which has data processing capabilities. Figure 6 , the first device may be the above Figure 6 Any processing node 10 in the data processing system shown. Exemplarily, the first device may be a processor, such as a GPU, a CPU, a TPU or the like.

[0073] Network equipment is used to provide online computing functions. Figure 6 , the network device can be the above Figure 6 Any network device 20 in the data processing system shown. Exemplarily, the network device can be a switch, a network card, a router, a bridge, a gateway, and the like.

[0074] The second device is a device for providing data used for processing, that is, the sender of data. The second device can also be called a data providing device. The address information of the second device is used by the network device to read data from the second device. In some embodiments, the address information of the second device is used to indicate the address of the second device, and different second devices have different address information. A corresponding second device can be uniquely determined by the address information. It should be noted that the at least one second device does not include the first device. In some embodiments, the address information of the second device can be understood as the sending address information of the second device, which is used to indicate the address of the sending buffer of the second device, and the sending buffer stores the data provided by the second device for participating in the processing operation.

[0075] The third device is a device for receiving processed data, that is, the receiver of the data. The third device can also be called a data receiving device. The address information of the third device is used to indicate the address of the third device. Different third devices have different address information. A corresponding third device can be uniquely determined by the address information. It should be noted that the at least one third device may include the first device or may not include the first device. In some embodiments, the address information of the third device can be understood as the receiving address information of the third device, which is used to indicate the address of the receiving buffer of the third device. The receiving buffer stores data written to the third device, such as the result data obtained after the processing operation.

[0076] Similar to the first device, the second device and the third device may also be the processing nodes introduced above.

[0077] In some embodiments, when the data involved in the processing operation includes data provided by the first device, the first request includes the data provided by the first device. That is, when the data involved in the processing operation includes data provided by the first device in addition to data provided by at least one second device, the first request sent by the first device includes the data provided by itself. In this case, the data providing device includes the first device and at least one second device. In this way, the network device can subsequently directly use the data provided by the first device to participate in the processing operation, and use on-line computing to implement the entire processing operation without consuming additional local computing resources of the first device.

[0078] In some embodiments, when the first request includes data provided by the first device, the network device caches the data provided by the first device. After receiving the first request, if the first request includes data provided by the first device, the network device caches the data provided by the first device so that the data provided by the first device can be used to participate in the processing operation later.

[0079] In some embodiments, when the data involved in the processing operation does not include data provided by the first device, the first request does not include the data provided by the first device. That is, when the data involved in the processing operation includes data provided by at least one second device respectively, and does not include data provided by the first device, the first request sent by the first device does not include the data provided by itself. In this case, the data providing device includes at least one second device.

[0080] In some embodiments, if the data processed by the network device needs to be sent to the data receiving device, the first request needs to include address information of at least one third device so that the network device can write the processed data to the third device based on the address information of each third device.

[0081] In some embodiments, the at least one third device includes at least one of the following: a first device, at least one other device other than the first device. Exemplarily, in the case where the at least one third device includes the first device, the address information of the at least one third device included in the first request includes the address information of the first device. Exemplarily, in the case where the at least one third device includes at least one other device other than the first device, the address information of the at least one third device included in the first request includes the address information of the at least one other device. Exemplarily, in the case where the at least one third device includes the first device and at least one other device other than the first device, the address information of the at least one third device included in the first request includes the address information of the first device and at least one other device. Wherein, the other device refers to a device different from the first device.

[0082] In some embodiments, if the data processed by the network device needs to be sent to the data receiving device, and the data receiving device has and only has the first device, the first request may include the address information of the data receiving device, that is, the address information of the first device; or, the first request may not include the address information of the data receiving device. For example, when the address information of the data receiving device is not included in the first request, the network device sends the processed data to the sender device of the first request, that is, the first device, by default. Optionally, the network device determines the address information of the first device according to the sender address of the first request, so as to send the processed data to the first device based on the address information of the first device.

[0083] In some embodiments, if the data processed by the network device does not need to be sent to the data receiving device, the first request may not include the address information of the third device. For example, the first request only requires the network device to process the data, but does not require the network device to feedback the processed data, such as the network device storing the processed data.

[0084] In some embodiments, the first request further includes operation information, and the operation information is used to indicate the processing operation performed on the data read from the at least one second device. Optionally, in the case where the data involved in the processing operation includes data provided by the first device, the above operation information is used to indicate the processing operation performed on the data provided by the first device and the data read from the at least one second device. In some embodiments, the above operation information can be in the form of an operator. By including the operation information in the first request, the network device can clarify the processing operation it needs to perform based on the operation information.

[0085] In some embodiments, when the processing operation is a reduction operation, the operation information is also used to indicate the type of the reduction operation. Optionally, the type of the reduction operation includes but is not limited to summing, finding the maximum value, finding the minimum value, taking the average, finding the variance, finding the standard deviation, etc., which is not limited in this application.

[0086] In some embodiments, Figure 8 As shown, the method further includes the following steps 720 and 730.

[0087] Step 720: The network device reads data from at least one second device respectively according to the address information of the at least one second device.

[0088] In some embodiments, the network device sends a second request to each second device according to the address information of at least one second device, and the second request may be a read request, and the second request is used to request to read the data provided by the second device. The second device sends the data provided by itself to the network device according to the received second request. Accordingly, the network device receives the data provided by each second device.

[0089] Step 730: The network device determines result data according to the data read from the at least one second device.

[0090] In some embodiments, the network device performs the processing operation indicated by the operation information included in the first request on the data respectively read from the at least one second device to obtain result data.

[0091] In some embodiments, when the first request includes data provided by the first device, the network device determines the result data based on the data provided by the first device and the data read from at least one second device. The network device can determine the result data in combination with the data provided by the first device cached by it and the data provided by at least one second device acquired by it. Exemplarily, the processing operation indicated by the above operation information is a reduction operation, and the type of the reduction operation is summation. In the case where the first request includes data provided by the first device, the network device performs a sum operation on the data provided by the first device and the data read from at least one second device to obtain the result data.

[0092] In some embodiments, when the first request does not include the data provided by the first device, the network device determines the result data based on the data read from the at least one second device. Exemplarily, the processing operation indicated by the above operation information is a reduction operation, and the type of the reduction operation is summation. Then, when the first request does not include the data provided by the first device, the network device performs a summation operation on the data read from the at least one second device to obtain the result data.

[0093] In some embodiments, Figure 8 As shown, the method further includes the following step 740.

[0094] Step 740: The network device writes the result data into the third device according to the address information of at least one third device.

[0095] In some embodiments, when the first request includes address information of at least one third device, the network device writes the result data into each third device according to the address information of the at least one third device.

[0096] In some embodiments, the network device sends a third request to each third device according to the address information of at least one third device, and the third request may be a write request, and the third request is used to request to write the result data. After receiving the third request, the third device is used to cache the result data carried in the third request, such as writing the result data into a receiving buffer.

[0097] In some embodiments, when the at least one third device includes the first device, the network device sends the result data to the first device. Correspondingly, the first device receives the result data sent by the network device.

[0098] Next, combine Fig. 9 A data processing method for collective communication provided in another possible implementation of the present application is introduced and described. The method may include the following steps 910 to 950.

[0099] Step 910: The first device sends a first request to the network device, where the first request includes: address information of at least one second device, data provided by the first device, and address information of at least one third device.

[0100] In this embodiment, the data involved in the processing operation includes not only the data provided by at least one second device, but also the data provided by the first device. Therefore, the first request includes not only the address information of at least one second device, but also the data provided by the first device. Furthermore, the data processed by the network device needs to be sent to the data receiving device, so the first request includes the address information of at least one third device.

[0101] Step 920: The network device caches the data provided by the first device.

[0102] Exemplarily, the network device adds the data provided by the first device to the cache of the network device itself. The network device caches the data provided by the first device so that the data provided by the first device can be used to participate in the processing operation later. It should be understood that after obtaining the result data later, the network device can clear the data provided by the first device from the cache so as to release the cache space in time.

[0103] Step 930: The network device reads data from at least one second device respectively according to the address information of the at least one second device.

[0104] For the introduction of this step, please refer to the above step 720, which will not be repeated here.

[0105] Step 940: The network device determines result data according to the data provided by the first device and the data read from at least one second device.

[0106] In some embodiments, when the first request also includes operation information, the network device performs the processing operation indicated by the operation information on the data provided by the first device and the data read from the at least one second device, and obtains result data.

[0107] In some embodiments, when the processing operation is a protocol operation, the operation information is also used to indicate the type of the protocol operation. Fig.10 As shown, the above step 940 can be replaced by the following step 942: the network device performs a protocol operation on the data provided by the first device and the data read from at least one second device according to the type of protocol operation indicated by the operation information to obtain result data.

[0108] Exemplarily, the processing operation indicated by the above operation information is a reduction operation, and the type of the reduction operation is summation, then the network device performs a sum operation on the data provided by the first device and the data read from at least one second device to obtain result data.

[0109] Exemplarily, the processing operation indicated by the above operation information is a reduction operation, and the type of the reduction operation is to find the maximum value. The network device determines the maximum value as the result data from the data provided by the first device and the data read from at least one second device respectively.

[0110] Exemplarily, the processing operation indicated by the above operation information is a reduction operation, and the type of the reduction operation is averaging. The network device averages the data provided by the first device and the data read from at least one second device, and uses the average as the result data.

[0111] Step 950: The network device writes the result data into the third device according to the address information of at least one third device.

[0112] For the introduction of this step, please refer to the above step 740, which will not be repeated here.

[0113] It should be noted that in the above method embodiments, the technical solution of the present application is only introduced and explained from the perspective of the interaction between the first device and the network device. The above steps performed by the first device can be independently implemented as a data processing method applied to collective communication on the first device side. The above steps performed by the network device can be independently implemented as a data processing method applied to collective communication on the network device side.

[0114] exist Figure 5 The related art shown uses only traditional read requests and write requests in the method flow of realizing full protocol operation by network computing. The read request includes the address information of the destination device to read data from the destination device. The write request includes the address information of the destination device and the data to be written to write the data to the above-mentioned destination device.

[0115] In the embodiment of the present application, the first request sent by the first device to the network device is different from the traditional read request and write request. In addition to the address information of at least one second device, the first request may also include the data provided by the first device and the address information of at least one third device. On the one hand, in the case where the data provided by the first device also participates in the processing operation, the first request sent by the first device includes the data provided by the first device, so that the network device can obtain all the data involved in the processing operation based on the address information of each second device and the data provided by the first device, so that the network device directly completes the processing operation to obtain the result data, and uses the network computing to realize the entire processing operation without consuming the local computing resources of the first device. On the other hand, the network device can send the result data obtained by the processing operation to the third device according to the address information of the third device included in the first request, so that when the complete process of data reading, data processing and data writing involved in the collective communication data processing process is realized, only one request interaction process is required between the first device and the network device, and multiple request interaction processes are not required between the first device and the network device, which saves the number of request interaction processes and shortens the delay.

[0116] The technical solution provided in the embodiment of the present application can be applied to but not limited to the full protocol operation in collective communication. Below, taking the technical solution provided in the embodiment of the present application and the full protocol operation implemented by online computing as an example, the corresponding method flow is introduced and explained. In the scenario of full protocol operation, we refer to the above first request as a read-and-reduce request, or a read protocol instruction. Fig.11 and Fig.12 As shown, still taking the full protocol operation in which N (N=4) devices participate as an example, and taking the first device as device 0 as an example, the process may include the following steps ① to ⑤.

[0117] Step ①, device 0 sends a multicast read protocol request, which includes the address information of at least one second device, the data provided by device 0, and the address information of at least one third device. For example, the address information of the at least one second device includes the address information of device 1, the address information of device 2, and the address information of device 3. For example, the address information of the at least one third device includes the address information of device 0, the address information of device 1, the address information of device 2, and the address information of device 3. For example, the data provided by device 0 is data 0-0.

[0118] Step ②, after receiving the read protocol request, the network device sends a read request to each second device based on the address information of at least one second device. Exemplarily, the network device can send a read request to each second device based on traditional multicast or multicast of an aggregate communication algorithm, that is, send a read request to device 1, device 2, and device 3 respectively. In addition, the network device caches the data provided by device 0.

[0119] Step ③, the second device returns the read data, that is, device 1, device 2 and device 3 return their own read data to the network device respectively. For example, for a full protocol operation, device 1 can send data 1-0 to the network device, device 2 can send data 2-0 to the network device, and device 3 can send data 3-0 to the network device.

[0120] Step ④, the network device performs a reduction operation on the data provided by device 0 and the data provided by each second device through online computing to obtain result data. For example, taking the reduction operation as a sum operation as an example, the network device performs a sum operation on data 0-0, data 1-0, data 2-0 and data 3-0 through online computing to obtain result data 0.

[0121] Step ⑤, the network device sends a write request to each third device based on the address information of at least one third device, and the write request may include the above-mentioned result data. Exemplarily, the network device may send a write request to each third device based on the traditional multicast or multicast of the aggregation communication algorithm, that is, send a write request to device 0, device 1, device 2 and device 3 respectively, and the write request includes result data 0. Device 0, device 1, device 2 and device 3 write the above-mentioned result data 0 into their own receiving buffers according to the received write request.

[0122] Similarly, device 1, device 2 and device 3 perform operations similar to device 0, and finally device 0, device 1, device 2 and device 3 all obtain complete result data of result data 0, result data 1, result data 2 and result data 3.

[0123] The above method process completely entrusts all reduction calculations to the on-line computing part of the network device, eliminating local computing resources and reducing the latency of the full reduction operation. The broadcast of the reduction result to all destination devices is used as a sign of the completion of the full reduction operation. Assuming that the one-way latency between the computing node and the network device (such as GPU and switch) is n, the full reduction operation under the related technology requires 6n time, while the time required for the technical solution of this application is a total of 4n, saving 2n. Among them, n is a value greater than 0, and the unit of n can be microseconds, milliseconds, seconds and other time units.

[0124] The following is an embodiment of the device of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the above method embodiment.

[0125] Please refer to Fig.13 , which shows a block diagram of a data processing device for collective communication provided in a possible implementation of the present application. The device has the function of implementing the method example on the first device side mentioned above, and the function can be implemented by hardware or by hardware executing corresponding software. The device can be the first device described above, or it can be set in the first device. Fig.13 As shown, the device 1300 may include: a sending module 1310.

[0126] The sending module 1310 is used to send a first request to a network device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

[0127] In some embodiments, the first request further includes operation information, where the operation information is used to indicate a processing operation performed on the data respectively read from the at least one second device.

[0128] In some embodiments, when the processing operation is a reduction operation, the operation information is further used to indicate the type of the reduction operation.

[0129] In some embodiments, when the data involved in the processing operation includes data provided by the first device, the first request includes the data provided by the first device; when the data involved in the processing operation does not include data provided by the first device, the first request does not include the data provided by the first device.

[0130] In some embodiments, the at least one third device includes at least one of the following: the first device, at least one other device other than the first device.

[0131] In some embodiments, Fig.13 As shown, the apparatus 1300 further includes: a receiving module 1320, for receiving result data sent by the network device when the at least one data receiving device includes the first device, wherein the result data is determined by the network device based on data respectively read from the at least one second device.

[0132] Please refer to Fig.14, which shows a block diagram of a data processing device for collective communication provided in another possible implementation of the present application. The device has the function of implementing the method example on the network device side described above, and the function can be implemented by hardware or by hardware executing corresponding software. The device can be the network device described above, or it can be set in the network device. Fig.14 As shown, the device 1400 may include: a receiving module 1410.

[0133] The receiving module 1410 is used to receive a first request sent by a first device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

[0134] In some embodiments, Fig.14 As shown, the apparatus 1400 further includes a processing module 1420, which is used to read data from the at least one second device respectively according to the address information of the at least one second device; and determine result data according to the data respectively read from the at least one second device.

[0135] In some embodiments, the processing module 1420 is used to determine the result data according to the data provided by the first device and the data respectively read from the at least one second device when the first request includes the data provided by the first device.

[0136] In some embodiments, Fig.14 As shown, the apparatus 1400 further includes a sending module 1430, which is used to write the result data into the third device according to the address information of the at least one third device.

[0137] In some embodiments, Fig.14 As shown, the apparatus 1400 further includes a processing module 1420, which is configured to cache the data provided by the first device when the first request includes the data provided by the first device.

[0138] In some embodiments, the first request further includes operation information, where the operation information is used to indicate a processing operation performed on the data respectively read from the at least one second device.

[0139] In some embodiments, when the processing operation is a reduction operation, the operation information is further used to indicate the type of the reduction operation.

[0140] In some embodiments, the at least one third device includes at least one of the following: the first device, at least one other device other than the first device.

[0141] One point that needs to be explained is that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0142] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0143] Please refer to Fig.15 , which shows a schematic diagram of the structure of a device 1500 provided in one embodiment of the present application. The device 1500 may be the first device or network device described above, and may be used to execute the method steps in the above embodiment. The device 1500 may include: a processor 1501, a transceiver 1502, and a memory 1503. Among them, the processor 1501 is used to implement various processing functions of the device 1500, such as implementing the functions of the above processing module, controlling sending and / or receiving, etc. The transceiver 1502 is used to implement the functions of sending and / or receiving, such as implementing the functions of the above sending module and / or receiving module.

[0144] The processor 1501 includes one or more processing cores, and the processor 1501 executes various functional applications and information processing by running software programs and modules. The processor 1501 can be a processor such as a GPU, a CPU, a TPU, etc., which is not limited in the embodiments of the present application.

[0145] The transceiver 1502 may include a receiver and a transmitter, which may be implemented as the same communication component, for example.

[0146] The memory 1503 may be connected to the processor 1501 and the transceiver 1502 .

[0147] The memory 1503 may be used to store a computer program executed by the processor 1501 , and the processor 1501 is used to execute the computer program to implement each step of the above method.

[0148] In addition, memory 1503 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, and volatile or non-volatile storage devices include but are not limited to: magnetic disks or optical disks, electrically erasable programmable read-only memory, erasable programmable read-only memory, static access memory, read-only memory, magnetic memory, flash memory, and programmable read-only memory.

[0149] For details not described in detail in the above embodiments, please refer to the introduction in the above method embodiments, which will not be repeated here.

[0150] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be executed by a processor of a first device to implement the data processing method applied to collective communication on the first device side.

[0151] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be executed by a processor of a network device to implement the data processing method applied to collective communication on the above-mentioned network device side.

[0152] Optionally, the computer readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0153] The embodiment of the present application also provides a chip, the chip includes a programmable logic circuit and / or a program instruction, and when the chip is running on the first device, it is used to implement the data processing method applied to collective communication on the first device side. Optionally, the chip can be a GPU chip, the processor introduced above is a GPU, and the GPU chip includes the GPU introduced above. Optionally, the chip can be implemented as a graphics card, and the graphics card includes the processor introduced above, such as a GPU.

[0154] An embodiment of the present application also provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a network device, it is used to implement the data processing method applied to collective communication on the above-mentioned network device side.

[0155] An embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium. The processor of the first device reads and executes the computer program from the computer-readable storage medium to implement the data processing method applied to collective communication on the above-mentioned first device side.

[0156] An embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium. The processor of the network device reads and executes the computer program from the computer-readable storage medium to implement the data processing method applied to collective communication on the above-mentioned network device side.

[0157] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

[0158] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data processing method applied to collective communication, characterized in that: The method comprises: A first device sends a first request to a network device, where the first request includes: address information of at least one second device, data provided by the first device, and address information of at least one third device; The network device reads data from the at least one second device respectively according to the address information of the at least one second device; The network device determines result data according to the data provided by the first device and the data respectively read from the at least one second device; The network device writes the result data into the at least one third device according to the address information of the at least one third device.

2. The method according to claim 1, characterized in that The first request further includes operation information, where the operation information is used to indicate a processing operation performed on the data provided by the first device and the data respectively read from the at least one second device; The network device determines result data according to the data provided by the first device and the data respectively read from the at least one second device, including: The network device performs the processing operation indicated by the operation information on the data provided by the first device and the data read from the at least one second device, to obtain the result data.

3. The method according to claim 2, characterized in that In the case where the processing operation is a specification operation, the operation information is further used to indicate the type of the specification operation; The network device performs the processing operation indicated by the operation information on the data provided by the first device and the data respectively read from the at least one second device to obtain the result data, including: The network device performs the protocol operation on the data provided by the first device and the data read from the at least one second device according to the type of the protocol operation indicated by the operation information to obtain the result data.

4. The method according to claim 1, characterized in that The network device reads data from the at least one second device respectively according to the address information of the at least one second device, including: The network device sends a second request to each of the second devices according to the address information of the at least one second device, where the second request is used to request to read data provided by the second device; The network device receives data provided by each of the second devices.

5. The method according to claim 1, characterized in that The network device writes the result data into the third device according to the address information of the at least one third device, including: The network device sends a third request to each of the third devices according to the address information of the at least one third device, wherein the third request is used to request writing of the result data; wherein the third device is used to write the result data into a receiving buffer after receiving the third request.

6. The method according to claim 1, characterized in that The method further comprises: After receiving the first request, the network device caches the data provided by the first device.

7. The method according to claim 1, characterized in that The at least one third device includes at least one of the following: the first device and at least one other device except the first device.

8. A data processing method applied to collective communication, characterized in that: The method is performed by a first device, and includes: A first request is sent to a network device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

9. The method according to claim 8, characterized in that The first request further includes operation information, where the operation information is used to indicate a processing operation performed on the data respectively read from the at least one second device.

10. The method according to claim 9, characterized in that In the case where the processing operation is a protocol operation, the operation information is further used to indicate the type of the protocol operation.

11. The method according to claim 8, characterized in that In a case where the data involved in the processing operation includes data provided by the first device, the first request includes the data provided by the first device; In a case where the data involved in the processing operation does not include the data provided by the first device, the first request does not include the data provided by the first device.

12. The method according to claim 8, characterized in that The at least one third device includes at least one of the following: the first device and at least one other device except the first device.

13. The method according to claim 8, characterized in that In a case where the at least one third device includes the first device, the method further includes: Result data sent by the network device is received, where the result data is determined by the network device according to data respectively read from the at least one second device.

14. A data processing method applied to collective communication, characterized in that: The method is performed by a network device, and the method includes: A first request is received from a first device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

15. The method according to claim 14, characterized in that After receiving the first request sent by the first device, the method further includes: Reading data from the at least one second device respectively according to the address information of the at least one second device; Result data are determined based on the data respectively read from the at least one second device.

16. The method according to claim 15, characterized in that The determining result data according to the data respectively read from the at least one second device comprises: In a case where the first request includes data provided by the first device, the result data is determined according to the data provided by the first device and data respectively read from the at least one second device.

17. The method according to claim 15, characterized in that After determining result data according to the data respectively read from the at least one second device, the method further includes: The result data is written into the at least one third device according to the address information of the at least one third device.

18. The method according to claim 14, characterized in that The method further comprises: In a case where the first request includes data provided by the first device, the data provided by the first device is cached.

19. The method according to claim 14, characterized in that The first request further includes operation information, where the operation information is used to indicate a processing operation performed on the data respectively read from the at least one second device.

20. The method according to claim 19, characterized in that In the case where the processing operation is a protocol operation, the operation information is further used to indicate the type of the protocol operation.

21. The method according to claim 14, characterized in that The at least one third device includes at least one of the following: the first device and at least one other device except the first device.

22. A data processing device for collective communication, characterized in that: The device comprises: A sending module is used to send a first request to a network device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

23. A data processing device for collective communication, characterized in that: The device comprises: A receiving module is used to receive a first request sent by a first device, wherein the first request includes address information of at least one second device, and the first request also includes at least one of the following: data provided by the first device and address information of at least one third device; wherein the address information of the second device is used by the network device to read data from the second device, and the address information of the third device is used by the network device to write data to the third device.

24. A device, characterized in that The device comprises a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method according to any one of claims 8 to 13, or to implement the method according to any one of claims 14 to 21.

25. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to be executed by a processor to implement the method according to any one of claims 8 to 13, or to implement the method according to any one of claims 14 to 21.

26. A chip, characterized in that: The chip includes a programmable logic circuit and / or program instructions, and when the chip is running, it is used to implement the method according to any one of claims 8 to 13, or to implement the method according to any one of claims 14 to 21.

27. A computer program product, characterized in that The computer program product comprises a computer program, which is loaded and executed by a processor to implement the method according to any one of claims 8 to 13, or to implement the method according to any one of claims 14 to 21.

Citation Information

Cited By

  • Data processing method and apparatus applied to collective communication, device, and storage medium

    WO2026145065A1