Data processing method and apparatus applied to collective communication, device, and storage medium
By sending a request containing address and data to network devices in aggregated communication, the problem of not being able to fully utilize on-network computing in existing technologies is solved, achieving efficient data processing and reduced latency.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- MOORE THREADS TECH CO LTD
- Filing Date
- 2025-12-19
- Publication Date
- 2026-07-09
AI Technical Summary
In existing technologies, data processing operations in aggregated communication cannot fully utilize on-network computing, leading to increased consumption of local device computing resources and increased latency.
By sending a request containing address information and data to the network device through the first device, the network device can directly process all the data, realizing the complete process of data reading, processing and writing, and reducing the number of request interactions between devices.
It enables full data processing for on-network computing, saves computing resources on local devices, reduces latency, and improves the efficiency of aggregated communication.
Smart Images

Figure CN2025143991_09072026_PF_FP_ABST
Abstract
Description
Data processing methods, apparatus, equipment and storage media applied to aggregated communication
[0001] This application claims priority to Chinese Patent Application No. 202411997253.0, filed on December 31, 2024, entitled "Data Processing Method, Apparatus, Device and Storage Medium for Collective Communication", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of data processing technology, and in particular to a data processing method, apparatus, device and storage medium for aggregated communication. Background Technology
[0003] Collective communication is an important concept in parallel computing, used for data exchange and synchronization between multiple processes. Collective communication involves coordination between multiple processes to perform operations such as broadcasting, scattering, gathering, all gathering, reducing, and all reducing.
[0004] In-Network computing is a technology that accelerates data processing and communication by utilizing network devices (such as switches and network interface cards) for computation. It breaks through the limitations of traditional computing architectures by offloading some computational tasks from the host CPU (Central Processing Unit) and GPU (Graphics Processing Unit) to network devices, thereby improving the overall performance of the system.
[0005] Currently, data processing operations in aggregated communications can utilize on-network computing, with network devices performing some of the data processing operations, thus saving computing resources on local devices. However, it is still not possible to utilize on-network computing to have network devices perform all data processing operations, and this process involves multiple data interactions between local and network devices, resulting in significant latency. Summary of the Invention
[0006] This application provides a data processing method, apparatus, device, and storage medium for aggregated communication. The technical solutions provided by this application include the following aspects.
[0007] According to one aspect of the embodiments of this application, a data processing method for aggregated communication is provided, the method comprising:
[0008] The first device sends a first request to the network device, the first request including: address information of at least one second device, data provided by the first device, and address information of at least one third device;
[0009] The network device reads data from the at least one second device according to the address information of the at least one second device;
[0010] The network device determines the result data based on the data provided by the first device and the data read from the at least one second device.
[0011] The network device writes the result data into the third device based on the address information of the at least one third device.
[0012] According to one aspect of the embodiments of this application, a data processing method for aggregated communication is provided, the method being executed by a first device, the method comprising:
[0013] A first request is sent to a 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 and address information of at least one third device. 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.
[0014] According to one aspect of the embodiments of this application, a data processing method for aggregated communication is provided, the method being executed by a network device, the method comprising:
[0015] The network device receives a first request sent by a first device, the first request including address information of at least one second device, and the first request further including 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.
[0016] According to one aspect of the embodiments of this application, a data processing apparatus for aggregated communication is provided, the apparatus comprising:
[0017] A sending module is configured to send a first request to a network device. The first request includes address information of at least one second device, and the first request further includes at least one of the following: data provided by the first device, and address information of at least one third device. 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.
[0018] According to one aspect of the embodiments of this application, a data processing apparatus for aggregated communication is provided, the apparatus comprising:
[0019] A receiving module is configured to receive a first request sent by a first device, the first request including address information of at least one second device, and the first request further including 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.
[0020] According to one aspect of the embodiments of this application, an apparatus is provided, the apparatus including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the data processing method for aggregated communication executed by the first device described above, or to implement the data processing method for aggregated communication executed by the network device described above.
[0021] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, the storage medium storing a computer program, the computer program being executed by a processor to implement the data processing method for aggregated communication executed by the first device, or to implement the data processing method for aggregated communication executed by the network device.
[0022] According to one aspect of the embodiments of this application, a chip is provided, the chip including programmable logic circuits and / or program instructions, which, when the chip is running, are used to implement the data processing method for aggregated communication executed by the first device, or to implement the data processing method for aggregated communication executed by the network device.
[0023] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program, the computer program being loaded and executed by a processor to implement the data processing method for aggregated communication executed by the first device described above, or to implement the data processing method for aggregated communication executed by the network device described above.
[0024] The technical solution provided in this application can bring the following beneficial effects:
[0025] In this embodiment, the first request sent by the first device to the network device differs from traditional read and write requests. This first request includes not only the address information of at least one second device, but also data provided by the first device and the address information of at least one third device. On one hand, when the data provided by the first device also participates in the processing operation, the first request, by including this data, allows the network device to 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. This allows the network device to directly complete the processing operation and obtain the result data, utilizing on-network computing to achieve the entire processing operation without consuming additional local computing resources of the first device. On the other hand, the network device can send the result data obtained from the processing operation to the third device based on the address information of the third device included in the first request. This means that when implementing the complete process of data reading, data processing, and data writing involved in the aggregated communication data processing, only one request interaction is needed between the first device and the network device, eliminating the need for multiple request interactions and reducing latency. Attached Figure Description
[0026] Figure 1 illustrates a schematic diagram of a full reduction operation;
[0027] Figure 2 illustrates, for example, a schematic diagram of the reduction divergence step in a full reduction operation;
[0028] Figure 3 illustrates a schematic diagram of the full collection step in a full reduction operation;
[0029] Figure 4 is a schematic diagram of the related technology using on-network computing to achieve full reduction operation;
[0030] Figure 5 is a flowchart of the relevant technology for implementing full reduction operation using on-network computing;
[0031] Figure 6 is a schematic diagram of the implementation environment of a possible implementation of this application;
[0032] Figure 7 is a flowchart of a data processing method for set communication provided in one possible implementation of this application;
[0033] Figure 8 is a flowchart of a data processing method for set communication provided in another possible implementation of this application;
[0034] Figure 9 is a flowchart of a data processing method for set communication provided in another possible implementation of this application;
[0035] Figure 10 is a flowchart of a data processing method for set communication provided in another possible implementation of this application;
[0036] Figure 11 is a schematic diagram of the full reduction operation implemented by on-network computing in this application;
[0037] Figure 12 is a flowchart of the full reduction operation implemented by on-net computing in this application;
[0038] Figure 13 is a block diagram of a data processing apparatus for collective communication provided in one possible implementation of this application;
[0039] Figure 14 is a block diagram of a data processing apparatus for collective communication provided in another possible implementation of this application;
[0040] Figure 15 is a schematic diagram of the device provided in one possible implementation of this application. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0042] Before introducing and explaining the technical solution of this application, some processing operations in the collective communication will be introduced and explained first.
[0043] In aggregated communication, each device is typically controlled by a different process, and the process number is called the rank.
[0044] Collective communication involves coordination among multiple processes to perform operations such as broadcasting, scattering, gathering, all gathering, reducing, and all reducing. It should be understood that "reduction" can also be written as "reduction," and both express the same meaning.
[0045] A broadcast operation is an operation that broadcasts data from one process to other processes. The process that sends the broadcast operation is usually called the root process. After the operation is completed, all other processes receive the data from the root process.
[0046] The divergence operation involves the root process dividing the data evenly, distributing each portion to different processes. It's important to note that during the divergence operation, other processes only receive a portion of the data from the root process.
[0047] The collection operation gathers data from different processes into the root process, and ultimately the root process receives data from all other processes.
[0048] The full collection operation gathers data from different processes into all processes, so that all processes eventually have access to the data from all other processes.
[0049] The reduction operation involves obtaining a set of data from each process, performing operations such as summation, finding the maximum value, and averaging on the data from all processes, and finally converging the results of the operations onto the root process.
[0050] A full reduction operation distributes the result data obtained from the reduction operation to all other processes; it is essentially a combination of reduction and broadcast operations.
[0051] Figure 1 illustrates a schematic diagram of a full reduction operation. In a full reduction operation involving N devices, initially, each of the N devices' sendbuffers contains a data array, denoted as sendbuff0[], sendbuff1[], ..., sendbuff(N-1)[], with an array length of L. After the full reduction operation, the data arrays in all devices are processed to ensure that all N devices obtain the same result data, which is recorded in the receive buffer (recvbuffer), also with a length of L. For example, when the operation is addition, recvbuff[i] = sum(sendbuff_k[i]), where k = 0, 1, ..., N-1, and i = 0, 1, ..., L-1.
[0052] In Figure 1, taking N=4 as an example, the data array sendbuff0[] in the transmit buffer of device 0 is denoted as data 0, the data array sendbuff1[] in the transmit buffer of device 1 is denoted as data 1, the data array sendbuff2[] in the transmit buffer of device 2 is denoted as data 2, and the data array sendbuff3[] in the transmit buffer of device 3 is denoted as data 3. After the full reduction operation is completed, the receive buffers of devices 0, 1, 2, and 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.
[0053] To improve the performance of full reduction operations on hardware, the full reduction operation is typically split and completed on N devices, each handling L / N of the data. This can be considered as breaking down the full reduction operation into two steps: reduce scatter and all gather.
[0054] The reduce scatter process is shown in Figure 2. For each of the N devices, the data in each device's transmit buffer is divided into N parts, resulting in each device receiving 1 / N of the data in its receive buffer. Assume that in Figure 2, the N devices are device 0, device 1, device 2, and device 3, and their corresponding processes are rank0, rank1, rank2, and rank3, respectively. Data 0 in the transmit buffer of device 0 will be divided into 4 parts, each with a length of L / N, denoted as data 0-0, data 0-1, data 0-2, and data 0-3; Data 1 in the transmit buffer of device 1 will be divided into 4 parts, each with a length of L / N, denoted as data 1-0, data 1-1, data 1-2, and data 1-3; Data 2 in the transmit buffer of device 2 will be divided into 4 parts, each with a length of L / N, denoted as data 2-0, data 2-1, data 2-2, and data 2-3; Data 3 in the transmit buffer of device 3 will be divided into 4 parts, each with a length of L / N, denoted as data 3-0, data 3-1, data 3-2, and data 3-3. Based on the reduction operation operators (such as summation, finding the maximum value, averaging, etc.), device 0 processes 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 processes 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 processes data 0-2, data 1-2, data 2-2, and data 3-2 to obtain result data 2 with a length of L / N; and device 3 processes data 0-3, data 1-3, data 2-3, and data 3-3 to obtain result data 3 with a length of L / N.
[0055] The all-gather process is shown in Figure 3. For each of the N devices, each device broadcasts the result data of length L / N from its send buffer to the other devices. Ultimately, all devices obtain the complete result data of length L. As shown in Figure 3, device 0 broadcasts result data 0 of length L / N to devices 1, 2, and 3; device 1 broadcasts result data 1 of length L / N to devices 0, 2, and 3; device 2 broadcasts result data 2 of length L / N to devices 0, 1, and 3; and device 3 broadcasts result data 3 of length L / N to devices 0, 1, 2, and 2. Finally, devices 0, 1, 2, and 3 all obtain the complete result data of length L, consisting of result data 0, result data 1, result data 2, and result data 3.
[0056] Currently, data processing operations in aggregated communications can utilize on-network computing, allowing network devices to perform some of the data processing operations, thereby saving computing resources on local devices. Taking a full reduction operation as an example, the flowchart of the method for implementing a full reduction operation using on-network computing is shown in Figures 4 and 5. Still taking a full reduction operation involving N (N=4) devices as an example, the process can include the following steps ① to ⑥.
[0057] 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.
[0058] Step 2: 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 separately based on traditional multicast or aggregation communication algorithm, that is, send the read request to device 1, device 2 and device 3 respectively.
[0059] Step 3: The destination device returns the read data, meaning that devices 1, 2, and 3 each return their respective read data to the network device. Referring to the examples shown in Figures 2 and 3 above, for a full reduction 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.
[0060] Step 4: The network device performs a reduction operation on all returned read data using network computing and returns the reduced result to device 0. For example, taking a summation operation as the reduction operation, the network device performs a summation operation on the read data returned by devices 1, 2, and 3 using network computing and returns the summation result to device 0. Still using the above example, the network device returns the summation result of data 1-0, data 2-0, and data 3-0 to device 0.
[0061] Step 5: Device 0 performs a reduction operation on the received result and its local data, and then issues a multicast write request. For example, Device 0 sums the received result with its local data to obtain the result data received by Device 0. Continuing with the above example, Device 0 sums the received sum with its local data 0-0 to obtain the result data 0. Then, Device 0 issues a multicast write request containing the result data received by Device 0 and the address information of each destination device, such as the address information of Device 1, Device 2, and Device 3.
[0062] Step 6: After receiving the write request, the network device multicasts it to each destination device. For example, the network device can use traditional multicast or aggregation communication algorithms to send the write request to each destination device separately, i.e., to device 1, device 2, and device 3 respectively. Device 1, device 2, and device 3, based on the received write request, write the result data obtained by device 0 into their own receive buffers.
[0063] Similarly, devices 1, 2, and 3 perform operations similar to those of device 0, and ultimately all devices 0, 1, 2, and 3 obtain the complete result data: result data 0, result data 1, result data 2, and result data 3.
[0064] While the above scheme utilizes on-network computing, it is limited by read / write commands in network communication. This means the on-network computing results need to be transmitted back to the local device for further reduction (i.e., step ⑤ above) to obtain the reduce scatter result, which is then broadcast by the local device to other destination devices. Compared to the technical solution provided in this application, step ⑤ requires additional computing resources from the local device, such as GPU computing power or additional near-memory computing capabilities. Furthermore, step ⑤ increases the overall latency, leading to performance degradation in machine learning inference applications.
[0065] Please refer to Figure 6, which illustrates a schematic diagram of the implementation environment provided in one possible implementation of this application. This implementation environment can be implemented as a data processing system. As shown in Figure 6, the implementation environment may include: multiple processing nodes 10 and at least one network device 20.
[0066] Processing node 10 can be a device with data processing capabilities. Processing node 10 can be a GPU, CPU, TPU (Tensor Processing Unit), etc. A single processing node 10 can be implemented as a device independently or set up independently within a device, or at least two processing nodes 10 can be implemented together as a device or set up in a device. The device implemented as or set up by the aforementioned processing node 10 can be a server or a terminal device; this application does not limit this.
[0067] Optionally, the processing node 10 can be or be located in the following devices: personal computers, workstations, game consoles, some mobile devices (such as tablets, smartphones, etc.), in-vehicle terminal devices, smart home devices, smart TVs, smart robots, etc. The processing node 10 can also be or be located in the following devices: servers, server clusters, artificial intelligence computing clusters, cloud computing clusters, etc., where artificial intelligence computing clusters can also be simply referred to as intelligent computing clusters or smart computing clusters, and this application does not limit this.
[0068] Network device 20 is a dedicated hardware device used to connect various servers, terminal devices, and other nodes to form an information communication network. Network device 20 can be a switch, network interface card (NIC), router, bridge, gateway, or other similar devices.
[0069] The aforementioned processing nodes 10 can engage in collective communication to perform operations such as broadcasting, scattering, gathering, all gathering, reducing, and all reducing. Furthermore, at least one network device 20 can be used to perform on-network computation of the data processing operations during collective communication.
[0070] Please refer to Figure 7, which shows a flowchart of a data processing method for aggregate communication provided in one possible implementation of this application. The method may include the following step 710.
[0071] 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 and also includes at least one of the following: data provided by the first device and address information of at least one third device.
[0072] Accordingly, the network device receives the first request sent by the first device.
[0073] The first device can be a processing node with data processing capabilities. Referring to Figure 6, the first device can be any processing node 10 in the data processing system shown in Figure 6. For example, the first device can be a processor, such as a GPU, CPU, TPU, or other processor.
[0074] Network devices are used to provide on-network computing capabilities. Referring to Figure 6, the network device can be any network device 20 in the data processing system shown in Figure 6. For example, the network device can be a switch, network interface card (NIC), router, bridge, gateway, or other similar device.
[0075] The second device is used to provide the data used in processing, i.e., the data sender. 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; different second devices have different address information, and a corresponding second device can be uniquely identified through the address information. It should be noted that the above-mentioned 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, used to indicate the address of the sending buffer of the second device, which stores the data provided by the second device for participating in the processing operation.
[0076] The third device is used to receive the processed data; that is, the data receiver. The third device can also be called a data receiving device. The address information of the third device indicates its address. Different third devices have different address information, which uniquely identifies a corresponding third device. It should be noted that the aforementioned at least one third device may 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, 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 processing.
[0077] Similar to the first device, the second and third devices can also be the processing nodes described above.
[0078] 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 at least one second device, as well as data provided by the first device, the first request sent by the first device includes the data it provides. In this case, the data providing devices include the first device and at least one second device. Thus, the network device can subsequently directly use the data provided by the first device to participate in the processing operation, utilizing on-network computing to complete the entire processing operation without consuming additional local computing resources of the first device.
[0079] In some embodiments, if 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 it can be used subsequently in processing operations.
[0080] In some embodiments, if the data involved in the processing operation does not include data provided by the first device, the first request does not include data provided by the first device. That is, if the data involved in the processing operation includes data provided by at least one second device, and the data provided by the first device is not included, the first request sent by the first device will not include data provided by the first device itself. In this case, the data providing device includes at least one second device.
[0081] 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 the 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.
[0082] In some embodiments, the at least one third device includes at least one of the following: a first device, and at least one other device besides the first device. For example, when 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. For example, when the at least one third device includes at least one other device besides the first device, the address information of the at least one third device included in the first request includes the address information of at least one other device. For example, when the at least one third device includes both the first device and at least one other device besides the first device, the address information of the at least one third device included in the first request includes the address information of both the first device and at least one other device. Here, "other device" refers to a device different from the first device.
[0083] In some embodiments, if the data processed by the network device needs to be sent to a data receiving device, and the data receiving device is only the first device, then the first request may include the address information of the data receiving device, i.e., include the address information of the first device; alternatively, the first request may not include the address information of the data receiving device. For example, if the address information of the data receiving device is not included in the first request, the network device will by default send the processed data to the sending device of the first request, i.e., the first device. Optionally, the network device determines the address information of the first device based on the sending address of the first request, and sends the processed data to the first device based on the address information of the first device.
[0084] In some embodiments, if the data processed by the network device does not need to be sent to the data receiving device, the address information of the third device may not be included in the first request. For example, the first request only requires the network device to process the data, but does not require the network device to return the processed data, such as storing the processed data.
[0085] In some embodiments, the first request further includes operation information, which indicates processing operations to be performed on data read from at least one second device. Optionally, when the data involved in the processing operation includes data provided by the first device, the operation information indicates processing operations to be performed on both the data provided by the first device and the data read from at least one second device. In some embodiments, the operation information may be in the form of operators. By including operation information in the first request, the network device can determine the processing operations it needs to perform based on the operation information.
[0086] In some embodiments, when the processing operation is a reduction operation, the operation information is also used to indicate the type of reduction operation. Optionally, the type of reduction operation includes, but is not limited to, operations such as summation, finding the maximum value, finding the minimum value, averaging, calculating the variance, and calculating the standard deviation, etc., and this application does not limit this.
[0087] In some embodiments, as shown in FIG8, the method further includes steps 720 and 730.
[0088] Step 720: The network device reads data from at least one second device according to the address information of at least one second device.
[0089] In some embodiments, the network device sends a second request to each of the at least one second device based on the address information of the second device. This second request may be a read request, used to request the reading of data provided by the second device. The second device then sends its own data to the network device based on the received second request. Correspondingly, the network device receives the data provided by each of the second devices.
[0090] Step 730: The network device determines the result data based on the data read from at least one second device.
[0091] In some embodiments, the network device performs the processing operation indicated by the operation information included in the first request on data read from at least one second device, and obtains result data.
[0092] 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 data read from at least one second device. The network device may combine its cached data provided by the first device with the data it has acquired from at least one second device to determine the result data. For example, if 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 includes data provided by the first device, the network device performs a summation operation on the data provided by the first device and the data read from at least one second device to obtain the result data.
[0093] In some embodiments, if the first request does not include data provided by the first device, the network device determines the result data based on data read from at least one second device. For example, if the processing operation indicated by the above operation information is a reduction operation, and the type of the reduction operation is summation, then if the first request does not include data provided by the first device, the network device performs a summation operation on the data read from at least one second device to obtain the result data.
[0094] In some embodiments, as shown in FIG8, the method further includes the following step 740.
[0095] Step 740: The network device writes the result data to the third device based on the address information of at least one third device.
[0096] In some embodiments, where the first request includes address information of at least one third device, the network device writes the result data to each third device based on the address information of at least one third device.
[0097] In some embodiments, the network device sends a third request to each of the at least one third device based on the address information of the third device. This third request may be a write request, used to request the writing of result data. Upon receiving the third request, the third device caches the result data carried in the third request, such as writing the result data into a receive buffer.
[0098] In some embodiments, where at least one third device includes the first device, the network device sends the result data to the first device. Accordingly, the first device receives the result data sent by the network device.
[0099] The data processing method for aggregate communication provided in another possible implementation of this application will be described below with reference to Figure 9. This method may include the following steps 910-950.
[0100] Step 910: The first device sends a first request to the network device. 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.
[0101] In this embodiment, the data involved in the processing operation includes not only data provided by at least one second device, but also 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, since the data processed by the network device needs to be sent to the data receiving device, the first request includes the address information of at least one third device.
[0102] Step 920: The network device caches the data provided by the first device.
[0103] For example, the network device adds the data provided by the first device to its own cache. The network device caches this data so that it can use it in subsequent processing operations. It should be understood that after obtaining the result data, the network device can remove the data provided by the first device from the cache to release cache space promptly.
[0104] Step 930: The network device reads data from at least one second device according to the address information of at least one second device.
[0105] For details on this step, please refer to step 720 above; it will not be repeated here.
[0106] Step 940: 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.
[0107] In some embodiments, where the first request further 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 at least one second device, respectively, to obtain result data.
[0108] In some embodiments, when the processing operation is a reduction operation, the operation information is also used to indicate the type of reduction operation. Accordingly, as shown in FIG10, the above step 940 can be replaced by the following step 942: the network device performs a reduction operation on the data provided by the first device and the data read from at least one second device respectively, according to the type of reduction operation indicated by the operation information, to obtain the result data.
[0109] For example, if 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 summation operation on the data provided by the first device and the data read from at least one second device to obtain the result data.
[0110] For example, if 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, then 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.
[0111] For example, if the processing operation indicated by the above operation information is a reduction operation and the type of the reduction operation is averaging, then the network device calculates the average of 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.
[0112] Step 950: The network device writes the result data to the third device based on the address information of at least one third device.
[0113] For details on this step, please refer to step 740 above; it will not be repeated here.
[0114] It should be noted that in the above method embodiments, the technical solution of this application has only been described from the perspective of the interaction between the first device and the network device. The steps performed by the first device described above can be implemented independently as a data processing method for aggregated communication on the first device side. The steps performed by the network device described above can be implemented independently as a data processing method for aggregated communication on the network device side.
[0115] In the process flow of the related technology using on-network computing to achieve full reduction operation, as shown in Figure 5, only traditional read and write requests are used. A read request includes the address information of the destination device to read data from the destination device. A write request includes the address information of the destination device and the data to be written to the destination device.
[0116] In this embodiment, the first request sent by the first device to the network device differs from traditional read and write requests. This first request includes not only the address information of at least one second device, but also data provided by the first device and the address information of at least one third device. On one hand, when the data provided by the first device also participates in the processing operation, the first request, by including this data, allows the network device to 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. This allows the network device to directly complete the processing operation and obtain the result data, utilizing on-network computing to achieve the entire processing operation without consuming additional local computing resources of the first device. On the other hand, the network device can send the result data obtained from the processing operation to the third device based on the address information of the third device included in the first request. This means that when implementing the complete process of data reading, data processing, and data writing involved in the aggregated communication data processing, only one request interaction is needed between the first device and the network device, eliminating the need for multiple request interactions and reducing latency.
[0117] The technical solutions provided in this application can be applied to, but are not limited to, full reduction operations in aggregated communications. Below, we will describe the corresponding method flow using the technical solutions provided in this application to implement a full reduction operation via on-network computing. In the scenario of a full reduction operation, we refer to the aforementioned first request as a read-and-reduce request, or a read-and-reduce instruction. As shown in Figures 11 and 12, taking a full reduction operation involving N (N=4) devices as an example, and taking device 0 as the first device, the process may include the following steps ① to ⑤.
[0118] Step ①: Device 0 sends a multicast read reduction request. This read reduction request 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, Device 2, and Device 3. Similarly, the address information of the at least one third device includes the address information of Device 0, Device 1, Device 2, and Device 3. For example, the data provided by Device 0 is data 0-0.
[0119] Step ②: After receiving the read reduction request, the network device sends read requests to each of the at least one second device based on the address information of the second device. For example, the network device can send read requests to each of the second devices based on traditional multicast or aggregation communication algorithms, i.e., send read requests to device 1, device 2, and device 3 respectively. Furthermore, the network device caches the data provided by device 0.
[0120] Step ③: The second device returns the read data, that is, device 1, device 2, and device 3 each return their respective read data to the network device. For example, for a full reduction 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.
[0121] Step 4: The network device performs a reduction operation on the data provided by device 0 and the data provided by each of the second devices through network computing to obtain the result data. For example, taking the reduction operation as a summation operation, the network device performs a summation operation on data 0-0, data 1-0, data 2-0, and data 3-0 through network computing to obtain the result data 0.
[0122] Step 5: The network device sends write requests to each of the at least one third device based on the address information of the third device. These write requests may include the aforementioned result data. For example, the network device can send write requests to each of the third devices based on traditional multicast or aggregation communication algorithms, i.e., to device 0, device 1, device 2, and device 3 respectively. Each write request includes result data 0. Devices 0, 1, 2, and 3 write the result data 0 into their respective receive buffers according to the received write requests.
[0123] Similarly, devices 1, 2, and 3 perform operations similar to those of device 0, and ultimately all devices 0, 1, 2, and 3 obtain the complete result data: result data 0, result data 1, result data 2, and result data 3.
[0124] The above method delegates all reduction computations entirely to the on-network computing portion of the network device, saving local computing resources and reducing the latency of the full reduction operation. The completion of the full reduction operation is marked by the broadcast of the reduction result to all destination devices. Assuming the one-way latency between the computing node and the network device (such as a GPU and a switch) is n, the full reduction operation under related technologies requires 6n time, while the time required using the proposed solution is only 4n, saving 2n. Here, n is a value greater than 0, and the unit of n can be microseconds, milliseconds, seconds, or other time units.
[0125] The following are embodiments of the device of this application. For details not disclosed in the embodiments of the device of this application, please refer to the method embodiments above.
[0126] Please refer to Figure 13, which shows a block diagram of a data processing apparatus for aggregated communication provided in one possible implementation of this application. This apparatus has the functionality to implement the method example described above on the first device side; the functionality can be implemented in hardware or by hardware executing corresponding software. This apparatus can be the first device described above, or it can be disposed within the first device. As shown in Figure 13, the apparatus 1300 may include: a transmitting module 1310.
[0127] The sending module 1310 is configured to send a first request to a network device. The first request includes address information of at least one second device, and the first request further includes at least one of the following: data provided by the first device, and address information of at least one third device. 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.
[0128] In some embodiments, the first request further includes operation information for indicating processing operations to be performed on data read from the at least one second device.
[0129] 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.
[0130] In some embodiments, if 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; if 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.
[0131] In some embodiments, the at least one third device includes at least one of the following: the first device, and at least one other device besides the first device.
[0132] In some embodiments, as shown in FIG13, the apparatus 1300 further includes a receiving module 1320, configured to receive result data sent by the network device when the at least one data receiving device includes the first device, the result data being determined by the network device based on data read from the at least one second device respectively.
[0133] Please refer to Figure 14, which shows a block diagram of a data processing apparatus for aggregated communication provided in another possible implementation of this application. This apparatus has the functionality to implement the method example described above on the network device side; this functionality can be implemented in hardware or by hardware executing corresponding software. This apparatus can be the network device described above, or it can be located within a network device. As shown in Figure 14, the apparatus 1400 may include: a receiving module 1410.
[0134] The receiving module 1410 is configured to receive a first request sent by a first device, the first request including address information of at least one second device, and the first request further including 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.
[0135] In some embodiments, as shown in FIG14, the device 1400 further includes a processing module 1420, configured 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 read from the at least one second device respectively.
[0136] In some embodiments, the processing module 1420 is configured to determine the result data based on the data provided by the first device and data read from the at least one second device, when the first request includes data provided by the first device.
[0137] In some embodiments, as shown in FIG14, the device 1400 further includes a sending module 1430 for writing the result data into the third device according to the address information of the at least one third device.
[0138] In some embodiments, as shown in FIG14, the device 1400 further includes a processing module 1420 for caching data provided by the first device when the first request includes data provided by the first device.
[0139] In some embodiments, the first request further includes operation information for indicating processing operations to be performed on data read from the at least one second device.
[0140] 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.
[0141] In some embodiments, the at least one third device includes at least one of the following: the first device, and at least one other device besides the first device.
[0142] It should be noted that the device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above 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.
[0143] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0144] Please refer to Figure 15, which shows a schematic diagram of the structure of a device 1500 provided in one embodiment of this application. The device 1500 may be the first device or network device described above, and can be used to execute the method steps in the above embodiments. The device 1500 may include: a processor 1501, a transceiver 1502, and a memory 1503. The processor 1501 is used to implement various processing functions of the device 1500, such as implementing the functions of the aforementioned processing modules, controlling transmission and / or reception, etc. The transceiver 1502 is used to implement transmission and / or reception functions, such as implementing the functions of the aforementioned transmission module and / or reception module.
[0145] The processor 1501 includes one or more processing cores. The processor 1501 executes various functional applications and information processing by running software programs and modules. The processor 1501 can be a GPU, CPU, TPU, or other processor; this application embodiment does not limit the specific processor to these types.
[0146] Transceiver 1502 may include a receiver and a transmitter, for example, the receiver and transmitter may be implemented as the same communication component.
[0147] The memory 1503 can be connected to the processor 1501 and the transceiver 1502.
[0148] The memory 1503 can be used to store a computer program executed by the processor 1501, which is used to execute the computer program to implement the various steps of the above method.
[0149] Furthermore, the memory 1503 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, including but not limited to: magnetic disks or optical disks, electrically erasable programmable read-only memory, erasable programmable read-only memory, static on-demand memory, read-only memory, magnetic memory, flash memory, and programmable read-only memory.
[0150] For details not described in the above embodiments, please refer to the descriptions in the above method embodiments, which will not be repeated here.
[0151] This application also provides a computer-readable storage medium storing a computer program, which is executed by a processor of a first device to implement the data processing method applied to aggregated communication on the first device side.
[0152] This application also provides a computer-readable storage medium storing a computer program that is executed by a processor of a network device to implement the aforementioned data processing method for aggregated communication on the network device side.
[0153] Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0154] This application also provides a chip, which includes programmable logic circuits and / or program instructions. When the chip runs on a first device, it is used to implement the data processing method applied to aggregated communication on the first device side. Optionally, the chip may be a GPU chip, where the processor described above is a GPU, and the GPU chip includes the GPU described above. Optionally, the chip may be implemented as a graphics card, where the graphics card includes the processor described above, such as a GPU.
[0155] This application also provides a chip, which includes programmable logic circuits and / or program instructions. When the chip is run on a network device, it is used to implement the above-mentioned data processing method for aggregated communication on the network device side.
[0156] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of a first device reads and executes the computer program from the computer-readable storage medium to implement the data processing method applied to aggregated communication on the first device side.
[0157] This application also provides a computer program product, which includes a computer program 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 above-described data processing method for aggregated communication on the network device side.
[0158] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.
[0159] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data processing method for aggregated communication, the method comprising: The first device sends a first request to the network device, the first request including: 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 according to the address information of the at least one second device; The network device determines the result data based on the data provided by the first device and the data read from the at least one second device. The network device writes the result data into the third device based on the address information of the at least one third device.
2. The method according to claim 1, wherein, The first request also includes operation information, which indicates processing operations performed on data provided by the first device and data read from the at least one second device. The network device determines the result data based on the data provided by the first device and the data 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, respectively, to obtain the result data.
3. The method according to claim 2, wherein, In the case that the processing operation is a reduction operation, the operation information is also used to indicate the type of the reduction operation; 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, respectively, to obtain the result data, including: The network device performs the reduction 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 reduction operation indicated by the operation information, to obtain the result data.
4. The method according to any one of claims 1 to 3, wherein, The network device reads data from the at least one second device according to the address information of the at least one second device, including: The network device sends a second request to each of the at least one second device based on the address information of the second device. 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 any one of claims 1 to 4, wherein, The network device writes the result data into the third device based on the address information of the at least one third device, including: The network device sends a third request to each of the at least one third device based on the address information of the third device. The third request is used to request the writing of the result data. The third device is used to write the result data into a receive buffer after receiving the third request.
6. The method according to any one of claims 1 to 5, wherein, The method further includes: After receiving the first request, the network device caches the data provided by the first device.
7. The method according to any one of claims 1 to 6, wherein, The at least one third device includes at least one of the following: the first device, and at least one other device besides the first device.
8. A data processing method for aggregated communication, the method being executed by a first device, the method comprising: A first request is sent to a 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 and address information of at least one third device. 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, wherein, The first request also includes operation information, which indicates processing operations to be performed on data read from the at least one second device.
10. The method according to claim 9, wherein, In the case that the processing operation is a reduction operation, the operation information is also used to indicate the type of the reduction operation.
11. The method according to any one of claims 8 to 10, wherein, If the data involved in the processing operation includes data provided by the first device, the first request includes data provided by the first device; If 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 any one of claims 8 to 11, wherein, The at least one third device includes at least one of the following: the first device, and at least one other device besides the first device.
13. The method according to any one of claims 8 to 12, wherein, When the at least one third device includes the first device, the method further includes: The network device receives result data sent by the network device, the result data being determined by the network device based on data read from the at least one second device.
14. A data processing method applied to aggregated communication, the method being executed by a network device, the method comprising: The network device receives a first request sent by a first device, the first request including address information of at least one second device, and the first request further including 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, wherein, After receiving the first request sent by the first device, the method further includes: Data is read from the at least one second device according to the address information of the at least one second device; The result data is determined based on the data read from the at least one second device.
16. The method according to claim 15, wherein, The step of determining the result data based on data read from the at least one second device includes: If the first request includes data provided by the first device, the resulting data is determined based on the data provided by the first device and the data read from the at least one second device.
17. The method according to claim 15 or 16, wherein, After determining the result data based on the data read from the at least one second device, the method further includes: The result data is written to the third device based on the address information of the at least one third device.
18. The method according to any one of claims 14 to 17, wherein, The method further includes: If the first request includes data provided by the first device, the data provided by the first device is cached.
19. The method according to any one of claims 14 to 18, wherein, The first request also includes operation information, which indicates processing operations to be performed on data read from the at least one second device.
20. The method according to claim 19, wherein, In the case that the processing operation is a reduction operation, the operation information is also used to indicate the type of the reduction operation.
21. The method according to any one of claims 14 to 20, wherein, The at least one third device includes at least one of the following: the first device, and at least one other device besides the first device.
22. A data processing apparatus for use in aggregated communication, the apparatus comprising: A sending module is configured to send a first request to a network device. The first request includes address information of at least one second device, and the first request further includes at least one of the following: data provided by the first device, and address information of at least one third device. 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 apparatus for use in aggregated communication, the apparatus comprising: A receiving module is configured to receive a first request sent by a first device, the first request including address information of at least one second device, and the first request further including 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. An apparatus comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the method of any one of claims 8 to 13, or to implement the method of any one of claims 14 to 21.
25. A computer-readable storage medium storing a computer program for execution by a processor to implement the method of any one of claims 8 to 13, or to implement the method of any one of claims 14 to 21.
26. A chip comprising programmable logic circuitry and / or program instructions, which, when the chip is executed, are configured to implement the method as claimed in any one of claims 8 to 13, or to implement the method as claimed in any one of claims 14 to 21.
27. A computer program product comprising a computer program loaded by a processor and executed to implement the method of any one of claims 8 to 13, or to implement the method of any one of claims 14 to 21.