Data processing method, system, apparatus, device, storage medium and program product

By accelerating the chip in high-performance computing and distributed training scenarios for artificial intelligence, and utilizing register state information for real-time monitoring and incremental merging processing, the problem of low hardware utilization in binary reduction trees is solved, thereby improving the parallel processing efficiency of data aggregation and the overall computational efficiency.

CN123178102APending Publication Date: 2026-11-27HANGZHOU HUAFENG JIXIN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611698185.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In high-performance computing and distributed training scenarios for artificial intelligence, using binary reduction trees for data aggregation results in low hardware utilization, leading to low efficiency in parallel processing of multi-path data aggregation.

Method used

The accelerator chip acquires data to be aggregated through multiple input ports and stores it in registers. The register status information is updated in real time. When at least two registers contain data to be aggregated, two sets of data are selected for incremental merging to generate partial results. These partial results are then used as new data to be aggregated in iterative merging until all input port data processing is completed.

Benefits of technology

It reduces hardware idle waiting time, improves the parallel processing efficiency of multi-path data aggregation, and shortens the overall time consumption of distributed data reduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178102A_ABST
    Figure CN123178102A_ABST
Patent Text Reader

Abstract

The application provides a data processing method, system, device, storage medium and program product, and relates to the field of distributed computing. The method is applied to an acceleration chip, and the method comprises the following steps: obtaining to-be-aggregated data through a plurality of input ports of the acceleration chip, storing the to-be-aggregated data obtained by each input port into a corresponding register, and updating state information of the register; when it is determined according to the state information that to-be-aggregated data is stored in at least two registers, selecting two groups of to-be-aggregated data to perform incremental merging processing, obtaining a partial result, writing the partial result into a target register, and updating a count value in the target register; taking the partial result as new to-be-aggregated data, repeatedly performing the incremental merging processing, and when the count value is consistent with the number of the plurality of input ports, determining a reduction result according to the partial result in the target register. In this way, the hardware idle waiting period can be reduced, and the parallel processing efficiency of multi-channel data aggregation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed computing, and more particularly to a data processing method, system, apparatus, device, storage medium, and program product. Background Technology

[0002] In high-performance computing and distributed training scenarios for artificial intelligence, when multi-GPU clusters perform large-scale iterative training and scientific numerical simulations, continuous reduction processing is required. The latency of reduction processing and the throughput of the hardware directly affect the overall computing efficiency of the distributed cluster.

[0003] Currently, when using a binary reduction tree for reduction processing (i.e., data aggregation), an independent input port is configured for each GPU, and the gradient data output by each GPU is sent into the reduction tree. When all the data to be aggregated corresponding to all input ports has been received, two-level summation operations are started layer by layer to generate intermediate sum data, and finally the global reduction result is obtained by summing them up.

[0004] However, this approach tends to generate a large number of hardware idle waiting periods, resulting in low hardware utilization and low parallel processing efficiency for multi-path data aggregation. Summary of the Invention

[0005] This application provides a data processing method, system, apparatus, device, storage medium, and program product that can reduce hardware idle time caused by data waiting and improve the parallel processing efficiency of multi-path data aggregation.

[0006] In a first aspect, embodiments of this application provide a data processing method applied to an accelerator chip. The method includes: acquiring data to be aggregated through multiple input ports of the accelerator chip; storing the data to be aggregated acquired by each input port into a corresponding register and updating the status information of the register; when it is determined from the status information that at least two registers store data to be aggregated, selecting two sets of data to be aggregated for incremental merging processing to obtain partial results; writing the partial results into a target register and updating the count value in the target register; the count value is used to indicate the number of input ports that have completed incremental merging processing; using the partial results as new data to be aggregated, repeating the incremental merging processing; when the count value is consistent with the number of multiple input ports, determining the reduction result based on the partial results in the target register.

[0007] In one possible implementation, the acceleration chip includes a merging unit; when it is determined, based on status information, that at least two registers store data to be merged, two sets of data to be merged are selected for incremental merging processing to obtain partial results, including: determining, based on the status information, a set of registers storing data to be merged; selecting, based on the register set, two registers storing original data to be merged as the source register and the target register, respectively; the original data to be merged is the data to be merged obtained through each input port and has not undergone incremental merging processing; and performing cross-port incremental merging processing on the original data to be merged in the source register and the original data to be merged in the target register through the merging unit to obtain partial results.

[0008] In one possible implementation, the acceleration chip includes a merging unit; when it is determined, based on state information, that at least two registers store data to be aggregated, two sets of data to be aggregated are selected for incremental merging processing to obtain partial results, including: determining, based on state information, a set of registers storing data to be aggregated; based on the register set, selecting a register storing the original data to be aggregated as a source register, and selecting a register storing historical partial results as a target register; the historical partial results are intermediate aggregated data generated by incremental merging processing of the original data to be aggregated; and performing cross-level incremental merging processing on the original data to be aggregated in the source register and the historical partial results in the target register through the merging unit to obtain partial results.

[0009] In one possible implementation, the merging unit includes multiple sets of parallel accumulators; selecting two sets of data to be aggregated for incremental merging processing to obtain partial results includes: receiving the data to be aggregated in turn through each accumulator in the multiple sets of parallel accumulators, and performing incremental merging processing on the data to be aggregated according to a fixed pipeline rhythm to obtain multiple sets of initial partial results; after the incremental merging processing is completed, switching the state of each accumulator from the occupied state to the idle state; after performing incremental merging processing on all the data to be aggregated through the multiple sets of parallel accumulators, merging the obtained multiple sets of initial partial results to obtain partial results.

[0010] In one possible implementation, the merging unit includes an accumulator and a merging tree; two sets of data to be aggregated are selected for incremental merging processing to obtain partial results, including: continuously caching multiple sets of continuously acquired data to be aggregated; whenever the number of cached data to be aggregated reaches a preset number matching the pipeline depth of the accumulator, the multiple sets of cached data to be aggregated are batch-merged through the merging tree to obtain sum data; the current accumulated temporary storage result and sum data are incrementally merged through the accumulator to obtain a new accumulated temporary storage result; the accumulated temporary storage result is obtained based on the previously obtained sum data; the above steps are repeated until the batch merging processing of all data to be aggregated is completed to obtain partial results.

[0011] In one possible implementation, the method further includes: when multiple initial data to be aggregated are continuously acquired by the same input port, the multiple initial data to be aggregated are accumulated in the register corresponding to the input port, and the data obtained after the accumulation is determined as the data to be aggregated acquired by the input port.

[0012] In one possible implementation, the acceleration chip further includes a completion detector; the method further includes: determining the number of input ports that have completed incremental merging processing by the completion detector; when the number of input ports that have completed incremental merging processing reaches a port number threshold, outputting the currently obtained temporary partial result and generating a missing port identifier; after obtaining the target data to be aggregated from the input port corresponding to the missing port identifier, incrementally correcting the temporary partial result based on the target data to be aggregated to obtain the reduction result.

[0013] Secondly, embodiments of this application provide a data processing system, which includes multiple graphics processing units (GPUs) and an acceleration chip. The GPUs generate data to be aggregated. The acceleration chip includes multiple input ports, multiple sets of registers, a merging unit, and a completion detector. Each input port corresponds one-to-one with a register. The acceleration chip acquires the data to be aggregated through the multiple input ports. The multiple sets of registers store the data to be aggregated for each corresponding input port and maintain the register's status information. The merging unit selects two sets of data to be aggregated and performs incremental merging processing to generate partial results when at least two registers contain data to be aggregated. It writes the partial results into a target register and updates the count value in the target register. The count value indicates the number of input ports that have completed incremental merging processing. The completion detector, connected to the multiple sets of registers and the merging unit, determines the reduction result based on the partial results in the target register when the count value matches the number of input ports. The acceleration chip also outputs the reduction result.

[0014] Thirdly, embodiments of this application provide a data processing apparatus, comprising: an acquisition module, configured to acquire data to be aggregated through multiple input ports of an accelerator chip, store the data to be aggregated acquired by each input port into a corresponding register, and update the status information of the register; a processing module, configured to, when it is determined from the status information that at least two registers store data to be aggregated, select two sets of data to be aggregated for incremental merging processing to obtain partial results, write the partial results into a target register, and update the count value in the target register; the count value is used to indicate the number of input ports that have completed incremental merging processing; the processing module is further configured to, as the partial results, perform incremental merging processing repeatedly, and when the count value is consistent with the number of multiple input ports, determine the reduction result based on the partial results in the target register.

[0015] Fourthly, embodiments of this application provide a data processing apparatus, including: a memory and a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the method provided above.

[0016] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided above.

[0017] Sixthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the methods provided above.

[0018] The data processing method, system, apparatus, device, storage medium, and program product provided in this application receive data to be aggregated through multiple input ports of an accelerator chip, and independently cache each data stream into its corresponding register and update the register status information in real time. When at least two registers are detected to be ready, two sets of data are selected for incremental merging to obtain partial results. The count value of the target register is used to record the number of input ports that have been processed, and partial results are iteratively used as new data to be aggregated to continuously participate in the merging until all input port data is processed and the final reduction result is output. This can reduce hardware idle waiting cycles, improve the efficiency of parallel processing of multi-path data aggregation, and shorten the overall time of distributed data reduction. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0020] Figure 1 A schematic diagram of the data flow of a 4-input binary reduction tree provided in this application;

[0021] Figure 2 A flowchart illustrating the data processing method provided in this application;

[0022] Figure 3 A schematic diagram of the architecture of multiple alternating accumulators provided in this application;

[0023] Figure 4 A schematic diagram of the batch pre-merging architecture provided in this application;

[0024] Figure 5 A schematic diagram of the protocol device architecture provided for this application;

[0025] Figure 6 A schematic diagram of the data processing apparatus provided in this application;

[0026] Figure 7 A schematic diagram of the data processing device provided in this application.

[0027] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0028] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.

[0029] In distributed training and high-performance computing scenarios for artificial intelligence, multi-GPU clusters frequently need to perform large-scale data reduction processing to complete gradient summarization and numerical statistical calculations. Currently, binary reduction tree architectures are mostly used in this scenario to perform data reduction operations.

[0030] Figure 1 A schematic diagram of the data flow of the 4-input binary reduction tree provided in this application.

[0031] like Figure 1 As shown, GPU a, GPU b, GPU c, and GPU d output gradient data respectively; the gradient data of GPU a and GPU b are input into the first layer summation operation to obtain gradient sum 1, and the gradient data of GPU c and GPU d are input into the first layer summation operation to obtain gradient sum 2; gradient sum 1 and gradient sum 2 are then input into the second layer summation operation, and the final aggregated result is output.

[0032] In actual operation, the chip's data bus width is typically 512 bits. For 32-bit gradient data, 16 data elements can be transmitted in parallel within a single clock cycle. Based on this hardware transmission characteristic, the aforementioned binary reduction tree can achieve data reduction operations for two different objectives.

[0033] The first type of reduction operation is cross-GPU element-wise reduction, which corresponds to... Figure 1 The basic logic of the 4-input binary reduction tree is shown. The objective of the operation is to independently sum the data at the same position in the gradient vectors output by the four GPUs, respectively.

[0034] During each clock cycle, the four GPUs will simultaneously output a set of 16-dimensional gradient vectors. The vector format output by the four GPUs is as follows:

[0035] GPU vector a: [a0, a1, a2, ..., a15];

[0036] GPU b vector: [b0, b1, b2, ..., b15];

[0037] GPU c vector: [c0, c1, c2, ..., c15];

[0038] GPU d vector: [d0, d1, d2, ..., d15];

[0039] The vector contains 16 data positions, each corresponding to an independent computation path. Each path carries a 4-input binary reduction tree, and the 16 paths complete the computation simultaneously in parallel.

[0040] Taking the 0th computation path corresponding to the 0th data position of the vector as an example, the 0th data a0 in the GPU a vector and the 0th data b0 in the GPU b vector are input into an adder to obtain S0_0; then the 0th data c0 in the GPU c vector and the 0th data d0 in the GPU d vector are input into another adder to obtain S0_1; finally, S0_0 and S0_1 are summed to obtain the global aggregation result S[0] of the 0th position of the vector.

[0041] The data in the first to 15th positions of the vector will be processed synchronously through the remaining 15 computation paths, with the same summation logic, to obtain the aggregation results S[1] to S

[15] at the corresponding positions. After all the paths are completed, the complete aggregation vector [S0, S1, S2, ..., S15] can be output synchronously in the same clock cycle.

[0042] The second type of reduction operation is the reduction within a single GPU vector. This operation is still based on the input binary reduction tree, but the operation objective has changed. Instead of cross-GPU operation, it accumulates all elements within the single GPU output vector to obtain a single scalar result.

[0043] Taking a gradient vector of length 1024 as an example, due to the bus width limitation, only 16 vector elements can be sent to the 4-input binary reduction tree in a single clock cycle. The complete vector needs to be split into 64 segments and sent to the 4-input binary reduction tree in 64 clock cycles. The 4-input binary reduction tree is set with 4 levels of addition for summing data within a single segment of the vector.

[0044] The logic for segmented input and segmented intermediate result output for each clock cycle is as follows:

[0045] First clock cycle: Input segment elements S0~S15, perform 4-level binary reduction tree operations, and output the intermediate segment result Q0;

[0046] The second clock cycle: Input segment elements S16~S31, perform a 4-level binary reduction tree operation, and output the intermediate segment result Q1;

[0047] The third clock cycle: Input segment elements S32~S47, perform a 4-level binary reduction tree operation, and output the intermediate segment result Q2;

[0048] ...

[0049] The sixty-fourth clock cycle: Input segment elements S1008~S1023, perform a 4-level binary reduction tree operation, and output the intermediate segment result Q63.

[0050] After processing all segmented data over 64 clock cycles, 64 intermediate segment results will be obtained. At this point, the backend accumulator needs to receive all intermediate segment results and iteratively accumulate them to obtain the final scalar. The iterative accumulation process is as follows:

[0051] Sum=0

[0052] Sum = Sum + Q0

[0053] Sum = Sum + Q1

[0054] Sum = Sum + Q2

[0055] ...

[0056] Sum = Sum + Q63

[0057] After the iterative accumulation is completed, a unique scalar Sum is output, which is the sum of all elements of the complete 1024-dimensional gradient vector.

[0058] However, the above scheme requires waiting for all the gradient vector data from the four GPUs to be ready before the batch parallel aggregation operation can be started. This synchronous blocking mechanism has extremely high requirements for the consistency of data arrival time of each GPU. If there is a delay in the data arrival of a single GPU, the entire reduction operation process will be suspended and wait, generating a large number of hardware idle cycles. This not only causes the chip's computing resources to be idle and wasted, but also significantly reduces the parallel processing efficiency of multi-path data aggregation.

[0059] In view of this, this application provides a data processing method applied to an accelerator chip. The accelerator chip independently caches data from each input port and monitors the data readiness status of each input port in real time. Based on this, it is not necessary to wait for all input port data to be ready; incremental merging operations can be initiated as soon as data from any input port becomes ready. Simultaneously, this method employs an aggregation approach that iteratively reuses partial results. Partial results obtained from each operation are reused as data to be merged, and the data is progressively iterated and aggregated through a gradual streaming merging mode, ultimately achieving complete reduction processing of all input port data.

[0060] Compared to traditional synchronous blocking schemes that require all input port data to be fully ready before initiating merging operations, this method enables asynchronous operations where data is merged as soon as it is ready. This effectively reduces hardware idleness issues caused by out-of-order arrival of data from multiple pathways and significantly reduces invalid waiting periods. Furthermore, this method continuously utilizes hardware resources for computation through incremental iterative merging throughout the process, further reducing hardware idle waste during the data waiting phase of traditional schemes and effectively improving the parallel processing capability and overall computational efficiency of multi-path data aggregation.

[0061] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0062] Figure 2 A flowchart illustrating the data processing method provided in this application. The method includes the following steps:

[0063] S201. Acquire the data to be aggregated through multiple input ports of the acceleration chip, store the data to be aggregated obtained from each input port into the corresponding register, and update the status information of the register.

[0064] The acceleration chip serves as the execution carrier for this data processing method, and it has multiple input ports and corresponding registers for each input port inside the chip.

[0065] The input ports are used to acquire the data to be aggregated. It can be understood that different input ports correspond to different data channels, and the data to be aggregated received by each input port is written to its respective register after entering the acceleration chip.

[0066] The data to be aggregated is the input data that participates in the reduction process. For example, it can be gradient slicing in distributed training, vector elements in high-performance computing, or numerical blocks of the same dimension in cross-node aggregation tasks.

[0067] Registers are used to temporarily store data that has arrived at each input port but has not yet been denoted. In addition to storing the data itself, each register is also associated with status information. The status information indicates whether valid data has been written to the register.

[0068] For example, the register may include four fields: valid bit, data element, accumulator, and merge count. The valid bit indicates whether the register currently stores valid data to be aggregated; the data element buffers 16 32-bit data elements transmitted in a single clock cycle; the accumulator continuously accumulates data arriving at the same location from the same input port over multiple consecutive clock cycles; and the merge count indicates the number of ports that have completed incremental merging processing.

[0069] When the data to be aggregated arrives at the corresponding input port with each clock cycle, the acceleration chip can perform a write operation to write the data to be aggregated into the corresponding register and simultaneously set the valid bit to mark the register data as valid and eligible for merging. When at least two registers are detected as valid, the merging unit performs a read-merge operation, reading the data to be aggregated from the two valid registers in parallel and performing a reduction operation. Finally, it writes the generated partial result back to the target register, realizing progressive streaming data aggregation.

[0070] In addition, each input port is configured with an independent Arrival Detector to monitor the data arrival status of the corresponding input port in real time. The Arrival Detector is configured with multiple sets of monitoring signals, such as valid data (datavalid), data payload, element index (element id), arrival time (arrival time), and port number (port id).

[0071] The valid data signal has a bit width of, for example, 1 bit, used to determine whether valid data has arrived at the input port in the current clock cycle. The data payload signal has a bit width of, for example, 512 bits, used to carry 16 32-bit elements of data to be aggregated in a single cycle. The element index signal has a bit width of, for example, 8 bits, used to identify the vector position corresponding to the current payload data. The arrival timestamp signal has a bit width of, for example, 8 bits, used to sort out out-of-order data and support input port data timeout anomaly detection. The port number signal has a bit width of, for example, 3 bits, used to uniquely identify the current input port.

[0072] Meanwhile, the detector's built-in port status register continuously maintains and updates the real-time operating status of the corresponding input ports, specifically including four status types. These include: Port Idle State, indicating that the current port has no data input and is in an idle state waiting for data reception; Data Reception Completed State, indicating that the port data has successfully arrived and been stored in the corresponding register, awaiting participation in the merging operation; Data Merging Completed State, indicating that all the data to be aggregated for the current port has participated in incremental merging and been summarized into the partial results; and Data Timeout State, indicating that no valid data has been detected arriving at the port within a preset period, which will automatically trigger a hardware exception handling mechanism to reduce the overall operation stall problem caused by missing data from a single port.

[0073] S202. When it is determined from the status information that at least two registers contain data to be aggregated, select two sets of data to be aggregated for incremental merging processing to obtain partial results. Write the partial results into the target register and update the count value in the target register. The count value is used to indicate the number of input ports that have completed incremental merging processing.

[0074] An incremental merge process is initiated when at least two registers contain data to be merged. The incremental merge process is used to progressively combine two sets of data into a partial result. The partial result is the intermediate aggregated data obtained after this round of merging.

[0075] The destination register receives this portion of the result and continues to store the current aggregation state after it is written. A count value is stored in association with the destination register to indicate how many input ports' data have been aggregated for this portion of the result; for example, it could be the merge count mentioned above.

[0076] In practice, for updating the count value, the count value in the target register can be updated according to the number of input ports corresponding to the data participating in this round of incremental merging processing. Based on this, the count value is used to record how many input ports' data has been aggregated in the current target register.

[0077] The destination register can be written back to one of the two registers involved in the merging process, while clearing the other register and updating its status to invalid; alternatively, it can be written to a specially configured result register, and then both source registers can be invalidated. After the write-back is complete, the destination register is remarked as valid, indicating that it contains new data to be aggregated, i.e., the current partial result.

[0078] In one possible implementation, the acceleration chip includes a merging unit. When it is determined, based on state information, that at least two registers store data to be merged, two sets of data to be merged are selected for incremental merging processing to obtain partial results. This includes: determining, based on state information, a set of registers storing data to be merged; selecting, based on the register set, two registers storing original data to be merged as the source register and the target register, respectively; the original data to be merged is the data to be merged obtained through each input port and has not undergone incremental merging processing; and performing cross-port incremental merging processing on the original data to be merged in the source register and the original data to be merged in the target register through the merging unit to obtain partial results.

[0079] Specifically, after the acceleration chip receives the data to be aggregated from multiple input ports, it first writes the data corresponding to each input port into the corresponding register and updates the status information of each register synchronously. When the status information indicates that at least two registers already contain the data to be aggregated, based on this, the valid registers are selected to form a register set. Then, two registers that still maintain their original state are selected from the register set, one of which is determined as the source register and the other as the target register.

[0080] Subsequently, the merging unit directly reads the original data to be merged from the two registers, performs cross-port incremental merging according to the preset reduction operator, and writes part of the results back to the target register.

[0081] For example, taking the four-input port acceleration chip specification scenario as an example, in the initial state, the partial state registers (PSRs) corresponding to the four ports: PSR_0, PSR_1, PSR_2, and PSR_3 are all empty and do not store any data to be aggregated.

[0082] When the data from GPU a arrives at the corresponding input port first, the acceleration chip writes the original set of data to be aggregated into PSR_0 and marks the valid bits of PSR_0 as valid. At this time, there is only a single set of valid register data and no matching merge object. The data processing system enters a waiting state.

[0083] When the data from GPU b arrives, the acceleration chip writes the corresponding original data to be aggregated into PSR_1 and marks it as valid. After the merging unit detects that both PSR_0 and PSR_1 store valid original data to be aggregated, it immediately selects the two sets of registers as the target register and the source register, respectively, and performs a cross-port incremental merge operation. It adds the two sets of original data to be aggregated to obtain a partial result, writes this partial result back to PSR_0, clears the valid state of PSR_1, updates the merge count of PSR_0, and completes the incremental merge processing of the two sets of original data.

[0084] When GPU d data arrives first and GPU c data has not yet arrived, the merging unit waits for GPU c data to arrive. Once it detects that both PSR_2 and PSR_3 contain valid data, it performs cross-port incremental merging again, writing back a portion of the calculated result to PSR_2, clearing the valid state of PSR_3, and updating the merge count of PSR_2 to 2. At this point, both PSR_0 and PSR_2 store the intermediate results of the merged data. The merging unit then performs the final merge operation on both, outputting the global reduction result corresponding to the four GPU data streams. After the operation is complete, it resets the status of all registers.

[0085] It should be noted that, in practical applications, the merging unit can be implemented using a dedicated arithmetic logic array or an on-chip programmable reduction unit; in practical applications, other models of this component can also be selected, and this application embodiment does not specifically limit this.

[0086] In this way, the merging unit can still initiate cross-port incremental merging processing in a timely manner based on the register state when the inputs are asynchronous. Some results can be quickly written back to the target register and continue to participate in subsequent reduction, thereby improving the utilization efficiency of registers and computing paths, and shortening the processing latency of multiple data to be aggregated to form the final reduction result.

[0087] In one possible implementation, the acceleration chip includes a merging unit. When it is determined, based on state information, that at least two registers store data to be aggregated, two sets of data to be aggregated are selected for incremental merging processing to obtain partial results. This includes: determining, based on state information, a set of registers storing data to be aggregated; selecting, based on the register set, a register storing the original data to be aggregated as the source register, and selecting, based on the register set, a register storing historical partial results as the target register; the historical partial results are intermediate aggregated data generated by incremental merging of the original data to be aggregated; and performing cross-level incremental merging processing on the original data to be aggregated in the source register and the historical partial results in the target register through the merging unit to obtain partial results.

[0088] Specifically, after receiving data to be aggregated from multiple input ports, the acceleration chip writes it into the corresponding registers and updates the status information of each register synchronously. When the status information indicates that at least two registers contain data to be aggregated, the registers containing the original data to be aggregated and some historical results are first selected, and then the source register and target register are determined according to register hierarchy, arrival order, or preset calling strategy.

[0089] After reading the data from the source register and the target register, the merging unit performs cross-level incremental merging processing, directly reducing the original data to be merged and the historical partial results to the new partial results, and then writing the partial results back to the target register.

[0090] It is understandable that the historical results, as reusable intermediate states, directly complete cross-level reduction with the subsequent arriving original data to be aggregated within the merging unit, thereby continuously advancing the data state in the register to a higher level and ultimately forming the reduction result.

[0091] For example, taking the four-input port reduction scenario as an example, after the data from GPU a and GPU b arrive first, complete the incremental merging process, and are written to PSR_0 for temporary storage, PSR_0 contains the merged historical results.

[0092] At this point, GPU d data arrives first, while GPU c data has not yet arrived. PSR_3 contains brand new original data to be aggregated. The merging unit supports a cross-level incremental merging mechanism based on the additive associative law. It does not need to wait for adjacent port data to be completed. It directly selects PSR_0, which stores historical partial results, as the target register and PSR_3, which stores the original data to be aggregated, as the source register. It performs a cross-level incremental merging operation, aggregating the original data to be aggregated with the existing historical partial results to generate a new partial result and writing it back to PSR_0.

[0093] After the subsequent GPU c data arrives and is written to PSR_2, incremental merging is performed again based on the effective register set. Finally, the global reduction operation of all four-port data is completed through multiple rounds of cross-level iterative merging, the final reduction result is output and the state of all registers is reset.

[0094] In this way, data arriving at different times can be continuously merged inside the chip, reducing register idle time and waiting time, improving the utilization rate of the merging unit, and reducing the impact of asynchronous multi-input on the overall aggregation latency.

[0095] In one possible implementation, the merging unit includes multiple sets of parallel accumulators; two sets of data to be aggregated are selected for incremental merging processing to obtain partial results, including: receiving the data to be aggregated in turn through each accumulator in the multiple sets of parallel accumulators, and performing incremental merging processing on the data to be aggregated according to a fixed pipeline rhythm to obtain multiple sets of initial partial results; after the incremental merging processing is completed, the state of each accumulator is switched from occupied state to idle state; after the incremental merging processing is performed on all the data to be aggregated through the multiple sets of parallel accumulators, the obtained multiple sets of initial partial results are merged to obtain partial results.

[0096] Specifically, the data to be aggregated can be sent to the polling call logic through the input port. The polling call logic selects an available accumulator based on the status flags of each accumulator and writes the corresponding data into the input register of that accumulator.

[0097] After receiving the data to be aggregated, the accumulator performs incremental merging processing through an internal addition chain or pipeline cascade unit, and outputs the initial partial result. When the current round of computation ends, the accumulator's state is switched from occupied to idle, allowing it to continue receiving subsequent data to be aggregated.

[0098] After all the data to be aggregated has been incrementally merged in the parallel accumulator, multiple initial partial results are merged again to form the partial results required for this round of aggregation.

[0099] like Figure 3 The diagram shows a multi-round-robin accumulator architecture. This architecture includes a reduction tree 1, a round-robin controller, multiple parallel accumulators, and a merging tree 1.

[0100] The reduction tree 1 is used to perform segmented reduction processing on the batch input vector data, and continuously outputs a set of intermediate results to be aggregated in each clock cycle. The round-robin controller is used to collect and monitor the working status of each accumulator in real time, and dynamically allocate each set of intermediate results to be aggregated output by the reduction tree 1 according to the round-robin calling rules to achieve load balancing.

[0101] The multiple parallel accumulators include accumulator 0, accumulator 1, accumulator 2, and accumulator 3, which can independently perform pipelined accumulation operations to obtain multiple sets of initial partial results.

[0102] Merging Tree 1 is used to receive multiple sets of initial partial results output by accumulator 0, accumulator 1, accumulator 2, and accumulator 3, and to merge and aggregate these multiple sets of initial partial results step by step, finally outputting partial results.

[0103] For example, the accumulation operation of floating-point 32-bit (Float 32, FP32) format data includes four levels of operation steps: alignment, mantissa addition, normalization, and rounding, forming an addition pipeline with a depth of 4. A single complete accumulation operation requires 4 clock cycles and can only receive a new set of input data every 4 clock cycles.

[0104] In this architecture, reduction tree 1 can stably output a set of intermediate results to be aggregated every clock cycle, resulting in a 4:1 throughput mismatch between reduction tree 1 and a single accumulator. The single accumulator cannot consume the intermediate results to be aggregated at high speed from reduction tree 1 in a timely manner, which will generate a large number of pipeline idle waiting cycles, severely restricting the overall reduction throughput performance.

[0105] Based on this, this embodiment configures multiple sets of parallel accumulators with the same depth as the addition pipeline, i.e., four sets of operation units are set up simultaneously: accumulator 0, accumulator 1, accumulator 2, and accumulator 3. A rotation controller is also provided for the above-mentioned polling and calling logic, which controls the working state of all parallel accumulators and the data allocation sequence of intermediate results to be aggregated in real time, realizing the alternating operation of multiple accumulators. Each set of accumulators uniformly follows a fixed state transition mechanism, sequentially flowing to: idle state, busy state, operation completed state, and idle state, achieving cyclic reuse.

[0106] The specific rotation call process is as follows: In the first clock cycle, reduction tree 1 outputs the first set of intermediate results P0 to be aggregated. The rotation controller selects accumulator 0 (acc_0) which is in an idle state to receive the data of this set. Accumulator 0 enters the busy state and starts the pipeline accumulation operation that takes 4 clock cycles. In the second clock cycle, reduction tree 1 outputs the second set of intermediate results P1 to be aggregated. The rotation controller calls accumulator 1 (acc_1) to receive the data of this set and starts the pipeline operation. In the third clock cycle, reduction tree 1 outputs the third set of intermediate results P2 to be aggregated. The rotation controller calls accumulator 2 (acc_2) to receive the data of this set and starts the pipeline operation. In the fourth clock cycle, reduction tree 1 outputs the fourth set of intermediate results P3 to be aggregated. The rotation controller calls accumulator 3 (acc_3) to receive the data of this set and starts the pipeline operation.

[0107] In the fifth clock cycle, accumulator 0 (acc_0) completes 4 cycles of pipelined computation and automatically switches from busy to idle state. The rotation controller then reallocates the fifth set of intermediate results P4 currently output by reduction tree 1 to accumulator 0 (acc_0). This cycle repeats, with accumulator 0 receiving intermediate results P0, P4, P8, etc., at fixed intervals, while accumulator 1 receives P1, P5, P9, etc., waiting for aggregation intermediate results. Accumulators 2 and 3 follow the same rotation rule, enabling uninterrupted consumption of the intermediate data to be aggregated output by reduction tree 1 in each clock cycle, completely eliminating pipeline waiting overhead caused by the single accumulator architecture.

[0108] Once all intermediate results to be aggregated from reduction tree 1 are fed into the corresponding parallel accumulators and the pipelined incremental operation is completed, accumulators 0, 1, 2, and 3 will each store a set of independent initial partial results. At this point, the four sets of initial partial results are finally merged and aggregated using the architecture's merging tree 1, summarizing multiple independent initial partial results into a global partial result. This merging tree 1 is a two-level operational architecture; each level of addition operation requires 4 clock cycles, and the overall final merging process takes an additional 8 clock cycles.

[0109] Taking a large-scale data aggregation scenario containing 64 sets of intermediate results to be aggregated as an example, the overall processing latency using a traditional single accumulator architecture is 256 clock cycles. However, by using the multi-set rotating accumulator architecture of this embodiment, the overall processing latency can be compressed to 72 clock cycles, significantly reducing the end-to-end latency of data reduction.

[0110] In terms of hardware overhead, this embodiment only requires the addition of three sets of FP32 accumulator registers, a merging tree 1 for merging the final results, and a round-robin controller, resulting in extremely low incremental hardware overhead. Under 8nm chip process conditions, the overall additional hardware area is only about 0.003mm², which can significantly improve the overall computational efficiency of data aggregation without increasing hardware costs.

[0111] In this way, the merging unit can maintain continuous processing when multiple data to be aggregated arrive, reduce the idle time of the accumulator, and enable the parallel accumulation resources to maintain stable throughput under pipeline cycle time constraints, thereby completing the segmented generation and summarization of partial results.

[0112] In one possible implementation, the merging unit includes an accumulator and a merging tree; two sets of data to be aggregated are selected for incremental merging processing to obtain partial results, including: continuously caching multiple sets of continuously acquired data to be aggregated; whenever the number of cached data to be aggregated reaches a preset number matching the pipeline depth of the accumulator, the multiple sets of cached data to be aggregated are batch-merged through the merging tree to obtain sum data; the current accumulated temporary result and sum data are incrementally merged through the accumulator to obtain a new accumulated temporary result; the accumulated temporary result is obtained based on the previously obtained sum data; the above steps are repeated until the batch merging processing of all data to be aggregated is completed to obtain partial results.

[0113] Specifically, the cache unit can be composed of a register group or an on-chip buffer, used to store data to be aggregated in the order of arrival; the merging tree can adopt a K (the number of accumulator groups or the number of batch merged inputs corresponding to the pipeline depth) input tree structure, composed of several levels of parallel addition nodes, to perform hierarchical merging of data that reaches a preset number, and send the final output as the sum data into the accumulator.

[0114] The accumulator can be constructed from a multi-stage pipelined adder circuit, with its inputs connected to the output of the merge tree and its outputs written back to the accumulator register to store intermediate accumulated values ​​across batches. This structure enables caching, tree merging, and accumulation updates to work collaboratively on-chip, transforming continuously arriving data into batch-wise, continuously accumulating intermediate results.

[0115] When this structure operates, it first caches the continuously arriving data to be aggregated. When the cache size reaches a preset amount matching the pipeline depth, the merge tree immediately performs a reduction operation on the batch of data and outputs the sum. Subsequently, the accumulator merges this sum with the current accumulated temporary result to form a new accumulated temporary result, which continues to serve as the input for the next batch of processing. This process is repeated until all the data to be aggregated has been batch-merged, ultimately yielding a partial result.

[0116] like Figure 4 The diagram shows a batch pre-merging architecture, which consists of a reduction tree 2, a batch cache module, a merging tree 2, and an accumulator 4.

[0117] The reduction tree 2 maintains a step-by-step output characteristic, continuously outputting a set of intermediate results to be aggregated each clock cycle. The batch caching module continuously caches multiple sets of intermediate results to be aggregated output by the reduction tree 2, achieving temporary storage and ordered output of multi-step data. The merging tree 2 performs a one-time batch reduction and merging of the multiple sets of intermediate results to be aggregated temporarily stored in the batch caching module, outputting multiple sets of sum data. The accumulator 4 only needs to receive the multiple sets of sum data output by the merging tree 2 to complete cross-batch iterative accumulation.

[0118] For example, a single complete accumulation operation for accumulator 4 requires 4 clock cycles and only supports receiving a set of valid inputs every 4 clock cycles. The architecture sets the number of caches to K=4, that is, after caching 4 clock cycles of intermediate results to be aggregated from the output of reduction tree 2, it starts another pre-merging operation of merging tree 2 and accumulation operation of accumulator 4.

[0119] During the first to fourth clock cycles, reduction tree 2 sequentially outputs the intermediate results to be aggregated, P0, P1, P2, and P3, one clock cycle at a time. These four sets of intermediate results are simultaneously stored in the batch cache module for temporary storage. When the amount of cached data reaches the preset threshold of four sets, merging tree 2 immediately starts the batch reduction operation, summing the four data streams P0, P1, P2, and P3 at once, and outputting the first batch sum data SP0. Subsequently, accumulator 4 performs an accumulation update operation to complete the calculation process of acc = acc + SP0.

[0120] Similarly, during the 5th to 8th clock cycles, reduction tree 2 continuously outputs four new sets of intermediate results to be aggregated: P4, P5, P6, and P7. These are then stored in the batch cache module to complete the 4-cycle data caching. The batch sum SP1 is obtained by summing through merging tree 2, and accumulator 4 iteratively completes the cross-batch accumulation processing of acc = acc + SP1. This cache pre-merging logic is repeated cyclically to complete the batch reduction and accumulation operations of all intermediate results to be aggregated in batches until all data is processed, and the final complete partial result is output.

[0121] By adopting this structure, the data stream that was originally fed into the accumulator step by step is optimized to be fed into the accumulator in batches every 4 steps, so that the input frequency of the accumulator is perfectly matched with its own 4-step pipeline delay. The accumulation frequency is reduced by 4 times compared with the traditional solution, thus solving the throughput mismatch problem.

[0122] In terms of hardware overhead, this architecture only requires the addition of a merging tree 2, a batch cache module for data caching, and an accumulator 4, resulting in a streamlined hardware structure. Under 8nm chip process conditions, the overall increase in hardware area is only about 0.002mm², with low hardware overhead. It can stably match pipeline timing with minimal hardware cost increase, improving the continuity of reduction processing and resource utilization.

[0123] In this way, the merge tree can handle batch merging tasks, and the accumulator can be used for continuous accumulation across batches. The two are matched collaboratively according to pipeline depth, so that intermediate data can be transformed into partial results in a timely manner and the input pressure of the accumulator can be reduced, thereby improving the continuity of reduction processing and resource utilization.

[0124] S203. Take a portion of the results as new data to be aggregated and repeat the incremental merging process. When the count value is consistent with the number of multiple input ports, determine the reduction result based on the portion of the results in the target register.

[0125] It is understandable that some results, after being written to the target register, are not terminated and output, but continue to be stored in the target register as new data to be aggregated, and participate in incremental merging processing again with other data to be aggregated or other partial results that arrive later.

[0126] In other words, the data stored in the target register has the same eligibility to be called as the original input data, except that an additional count value is recorded in the accompanying information to indicate the number of input ports that have been merged.

[0127] The reduction result is the final output after merging the data to be aggregated from all input ports, and is determined by the portion of the result ultimately retained in the target register.

[0128] Specifically, after each round of incremental merging, the status information of all registers is used to determine whether at least two registers still contain valid data. If so, two sets of data to be aggregated are selected again to perform the next round of incremental merging. If only one register contains part of the result and its count value has not yet reached the total number of input ports, the register is kept in a valid waiting state, and the determination is triggered again after new input port data is written.

[0129] Thus, the entire processing flow constitutes an iterative reduction process: the data arriving first forms an initial partial result, and the data arriving later continues to be merged with the already formed partial results until the data from all input ports are counted into the same target register. When the count value equals the number of multiple input ports, it means that the partial result in the target register has included all input ports. At this point, the partial result is determined as the reduction result and output to the subsequent computing unit, on-chip cache, or external interface. If a vector reduction form is used, the reduction result is a vector with the same dimension as the input; if a scalar reduction form is used, the reduction result is a single aggregated value.

[0130] For the count value, the base count corresponding to the original data to be aggregated initially written to each input port register can be set to 1, indicating that the data in the register comes from an input port; subsequently, for each incremental merge, the new target register count value is determined by accumulating the count value based on the number of input ports corresponding to the data participating in the merge.

[0131] Taking four input ports as an example, if the data from the first and third input ports arrive first, they can be merged to obtain a partial result with a count value of 2. When the data from the second input port arrives, it is merged with this partial result to obtain a new partial result with a count value of 3. When the data from the fourth input port arrives, merging continues to obtain the final partial result with a count value of 4. At this point, it is consistent with the total number of input ports, and can be directly determined as the reduction result.

[0132] In one possible implementation, the method further includes: when multiple initial data to be aggregated are continuously acquired by the same input port, the multiple initial data to be aggregated are accumulated in the register corresponding to the input port, and the data obtained after the accumulation is determined as the data to be aggregated acquired by the input port.

[0133] Specifically, multiple initial data to be aggregated from the same input port are sequentially entered into the register corresponding to that input port. The register first writes the first initial data to be aggregated as the initial cumulative value. Subsequently, whenever the same input port is detected to have new initial data to be aggregated, the register performs a calculation on the new data and the current cumulative value and writes back the updated result.

[0134] This process can be accomplished by an adder working in conjunction with a register. The adder's input is connected to the current value of the register and the newly arrived data. The addition result is written back to the register, thus ensuring that the register always stores the cumulative result corresponding to the current input port. This cumulative result is identified as the data to be aggregated obtained from that input port and continues to participate in subsequent cross-port incremental merging processing.

[0135] In this way, multiple raw data arriving consecutively at the same input port can first form a single cumulative result within the terminal before being sent to the subsequent protocol link, thereby reducing the amount of data received by the subsequent merging unit.

[0136] In one possible implementation, the accelerator chip further includes a completion detector; the method further includes: determining the number of input ports that have completed incremental merging processing by the completion detector; when the number of input ports that have completed incremental merging processing reaches a port number threshold, outputting the currently obtained temporary partial result and generating a missing port identifier; after obtaining the target data to be aggregated from the input port corresponding to the missing port identifier, incrementally correcting the temporary partial result based on the target data to be aggregated to obtain the reduction result.

[0137] Specifically, the completion detector is connected to the completion flag bits corresponding to multiple input ports. After each input port completes an incremental merge, it writes the completion status to the completion detector, which then updates the count of completed input ports based on this status.

[0138] When the count reaches a preset threshold, the acceleration chip sends out the aggregated value in the current register as a temporary partial result, and at the same time generates a missing port identifier and retains it in the missing port table so that subsequent data that has not reached the input port can be associated.

[0139] Once the data from the corresponding input port arrives, the target data to be aggregated is retrieved based on the missing port identifier. This data is then used to supplement the temporary results or perform similar reduction corrections to obtain a reduction result consistent with that when all inputs are present.

[0140] For example, the completion detector can support three modes: normal completion, timed completion, and speculative completion.

[0141] Normal completion mode means that when the completion detector detects that the data from all input ports has successfully arrived and participated in the merging operation, and the sum of the merging counts of all ports equals the total number of ports, the current round of reduction operation can be determined to be completely completed, and the final reduction result is output.

[0142] The timeout completion mode means that if, within the preset timeout threshold range of the acceleration chip, data from some ports is consistently missing and cannot participate in the merging operation, the completion detector will determine that the current round of data reception has timed out and actively trigger the timeout processing flow, effectively reducing the overall protocol process blockage and hardware resource idleness caused by missing data from individual ports.

[0143] The speculative completion mode refers to the process where, when the completion detector detects that data from N-1 out of N input ports has arrived and the merging operation has been completed, a temporary partial result of the current aggregation can be output in advance, and the unique identifier of any missing ports that are not yet ready can be recorded and marked simultaneously. After the data from the corresponding missing input ports arrives, the architecture can accurately retrieve the corresponding target data to be aggregated based on the preset missing port identifiers. This data is then used to incrementally supplement and reduce the output temporary partial result, ultimately iteratively obtaining the reduced result.

[0144] In this way, by pre-determining the number of input ports that meet the output conditions through the detector, partial results can be output in advance, and incremental correction can be performed after the missing data arrives. This eliminates the need for the reduction process to wait for all inputs to be synchronized. Since the temporary partial results and missing port information are preserved, subsequent corrections can be directly based on the completed intermediate results, and the final output reduction result is consistent with the full synchronized aggregation result.

[0145] Therefore, this application provides a data processing method applied to an accelerator chip. This method acquires data to be aggregated through multiple input ports of the accelerator chip, stores the data to be aggregated from each input port into corresponding registers, and updates the register status information in real time. Based on the register status, it adaptively selects ready data to be aggregated for incremental merging processing, obtains partial results, and synchronously updates the count value of the number of merging ports. By iteratively reusing partial results, it continuously completes incremental merging at each level until the count value matches the total number of input ports, at which point the final reduction result is output, realizing fully automatic iterative reduction and aggregation of multi-port data. In this way, the arrival time sequence of multiple data streams can be dynamically matched, continuously utilizing hardware computing resources for incremental merging, effectively reducing hardware idle waiting cycles, avoiding pipeline idle waste, and significantly improving the parallel processing efficiency and overall throughput performance of multi-path data aggregation.

[0146] Figure 5 A schematic diagram of the protocol device architecture provided for this application.

[0147] like Figure 5 As shown, the architecture includes GPU 0, GPU 1, GPU 2, GPU 3, arrival detector 0, arrival detector 1, arrival detector 2, arrival detector 3, register 0, register 1, register 2, register 3, completion detector, and merging unit.

[0148] Specifically, GPU 0, GPU 1, GPU 2, and GPU 3 output data to be aggregated, respectively. The data to be aggregated output by GPU 0 is sent to arrival detector 0, the data to be aggregated output by GPU 1 is sent to arrival detector 1, the data to be aggregated output by GPU 2 is sent to arrival detector 2, and the data to be aggregated output by GPU 3 is sent to arrival detector 3.

[0149] Arrival detector 0 is used to receive the data to be aggregated output by GPU 0 and transfer the data to be aggregated to register 0; arrival detector 1 is used to receive the data to be aggregated output by GPU 1 and transfer the data to be aggregated to register 1; arrival detector 2 is used to receive the data to be aggregated output by GPU 2 and transfer the data to be aggregated to register 2; arrival detector 3 is used to receive the data to be aggregated output by GPU 3 and transfer the data to be aggregated to register 3.

[0150] Registers 0, 1, 2, and 3 output intermediate results to be aggregated based on the internally cached data to be aggregated and transmit them to the merging unit; on the other hand, they report their own data storage status to the completion detector.

[0151] The detector receives status information reported by registers 0, 1, 2, and 3, determines the progress of the protocol task based on the status information, and outputs control signals to accumulators 0, 1, 2, and 3 in the merging unit.

[0152] It should be understood that the control signal output by the completion detector is used to trigger the normal completion mode, timeout completion mode, and speculative completion mode.

[0153] The merging unit includes a round-robin controller, accumulator 0, accumulator 1, accumulator 2, accumulator 3, and merging tree 1. The round-robin controller receives the intermediate results to be aggregated from the register group and distributes them to accumulator 0, accumulator 1, accumulator 2, and accumulator 3 according to the round-robin calling rules. Accumulator 0, accumulator 1, accumulator 2, and accumulator 3 independently perform pipelined accumulation operations and output the initial partial results.

[0154] Merging Tree 1 receives the initial partial results output by accumulator 0, accumulator 1, accumulator 2, and accumulator 3, merges and aggregates the multiple initial partial results level by level, and finally outputs the partial results.

[0155] This application also provides a data processing system, which includes multiple GPUs and an acceleration chip. The multiple GPUs are used to generate data to be aggregated. The acceleration chip includes multiple input ports, multiple sets of registers, a merging unit, and a completion detector. Each input port corresponds one-to-one with a register. The acceleration chip is used to acquire the data to be aggregated through the multiple input ports. The multiple sets of registers are used to store the data to be aggregated corresponding to the input ports and maintain the register's status information. The merging unit is used to select two sets of data to be aggregated and perform incremental merging processing when at least two registers are detected to store data to be aggregated, generating partial results, writing the partial results to a target register, and updating the count value in the target register. The count value indicates the number of input ports that have completed incremental merging processing. The completion detector, connected to the multiple sets of registers and the merging unit, is used to determine the reduction result based on the partial results in the target register when the count value matches the number of multiple input ports. The acceleration chip is also used to output the reduction result.

[0156] Figure 6 A schematic diagram of the data processing apparatus provided in this application is shown below. Figure 6 As shown, the data processing device 60 provided in this embodiment includes:

[0157] The acquisition module 601 is used to acquire the data to be aggregated through multiple input ports of the acceleration chip, store the data to be aggregated acquired by each input port into the corresponding register, and update the status information of the register.

[0158] The processing module 602 is used to select two sets of data to be aggregated for incremental merging processing when it is determined from the status information that at least two registers store data to be aggregated, obtain partial results, write the partial results to the target register, and update the count value in the target register; the count value is used to indicate the number of input ports that have completed incremental merging processing.

[0159] The processing module 602 is also used to treat a portion of the results as new data to be aggregated and repeatedly perform incremental merging processing. When the count value is consistent with the number of multiple input ports, the reduction result is determined based on the portion of the results in the target register.

[0160] In one possible implementation, the acceleration chip includes a merging unit;

[0161] The processing module 602 is also used to determine the set of registers storing the data to be aggregated based on the status information;

[0162] The processing module 602 is also used to select two registers storing the original data to be aggregated as the source register and the target register, respectively, based on the register set; the original data to be aggregated is the data to be aggregated obtained through each input port and has not undergone incremental merging processing;

[0163] The processing module 602 is also used to perform cross-port incremental merging processing on the original data to be merged in the source register and the original data to be merged in the target register through the merging unit to obtain partial results.

[0164] In one possible implementation, the acceleration chip includes a merging unit;

[0165] The processing module 602 is also used to determine the set of registers storing the data to be aggregated based on the status information;

[0166] The processing module 602 is also used to select, based on the register set, the register storing the original data to be aggregated as the source register, and the register storing the historical partial results as the target register; the historical partial results are the intermediate aggregated data generated by incremental merging of the original data to be aggregated.

[0167] The processing module 602 is also used to perform cross-level incremental merging processing on the original data to be aggregated in the source register and the historical partial results in the target register through the merging unit to obtain partial results.

[0168] In one possible implementation, the merging unit comprises multiple sets of parallel accumulators;

[0169] The processing module 602 is also used to receive the data to be aggregated in turn through each accumulator in multiple sets of parallel accumulators, and perform incremental merging processing on the data to be aggregated according to a fixed pipeline rhythm to obtain multiple sets of initial partial results;

[0170] The processing module 602 is also used to switch the state of each accumulator from occupied state to idle state after the incremental merging process is completed;

[0171] The processing module 602 is also used to merge the multiple initial partial results obtained after performing incremental merging processing on all the data to be aggregated through multiple sets of parallel accumulators, so as to obtain partial results.

[0172] In one possible implementation, the merging unit includes an accumulator and a merging tree;

[0173] The processing module 602 is also used to continuously cache multiple sets of continuously acquired data to be aggregated. Whenever the number of cached data to be aggregated reaches a preset number that matches the depth of the accumulator pipeline, the multiple sets of cached data to be aggregated are batch merged through the merging tree to obtain the aggregated data.

[0174] Processing module 602 is also used to perform incremental merging processing on the current accumulated temporary result and the data through an accumulator to obtain a new accumulated temporary result; the accumulated temporary result is obtained based on the previously obtained data.

[0175] The processing module 602 is also used to repeat the above steps until all the data to be aggregated is batch merged and partial results are obtained.

[0176] In one possible implementation, the acquisition module 601 is further configured to, when the same input port continuously acquires multiple initial data to be aggregated, perform cumulative processing on the multiple initial data to be aggregated in the register corresponding to the input port, and determine the data obtained after cumulative processing as the data to be aggregated acquired by the input port.

[0177] In one possible implementation, the acceleration chip also includes a completion detector;

[0178] Processing module 602 is also used to determine the number of input ports that have completed incremental merging processing by using a completion detector;

[0179] The processing module 602 is also used to output the currently obtained temporary partial result and generate a missing port identifier when the number of input ports that have completed incremental merging processing reaches the port number threshold.

[0180] The processing module 602 is also used to perform incremental correction on the temporary partial results based on the target data to be aggregated after obtaining the target data to be aggregated from the input port corresponding to the missing port identifier, so as to obtain the reduction result.

[0181] Figure 7 A schematic diagram of the data processing device provided in this application. Figure 7 As shown, the data processing device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the data processing device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.

[0182] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described data processing method.

[0183] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0184] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0185] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0186] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0187] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0188] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0189] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0190] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0191] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0192] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0193] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0194] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0195] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0196] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A data processing method, characterized in that, Applied to an acceleration chip, the method includes: The data to be aggregated is acquired through multiple input ports of the acceleration chip, the data to be aggregated acquired by each input port is stored in the corresponding register, and the status information of the register is updated. When it is determined, based on the status information, that at least two registers contain data to be aggregated, two sets of data to be aggregated are selected for incremental merging processing to obtain partial results. The partial results are written into the target register, and the count value in the target register is updated. The count value is used to indicate the number of input ports that have completed incremental merging processing. The partial results are used as new data to be aggregated, and incremental merging is repeated. When the count value is consistent with the number of the multiple input ports, the reduction result is determined based on the partial results in the target register.

2. The data processing method according to claim 1, characterized in that, The acceleration chip includes a merging unit; When it is determined, based on the status information, that at least two registers contain data to be aggregated, two sets of data to be aggregated are selected for incremental merging processing to obtain partial results, including: Based on the status information, determine the set of registers storing the data to be aggregated; Based on the set of registers, two registers storing the original data to be aggregated are selected as the source register and the target register, respectively; the original data to be aggregated is the data obtained through each input port and has not undergone incremental merging processing. The merging unit performs cross-port incremental merging processing on the original data to be merged in the source register and the original data to be merged in the target register to obtain the partial result.

3. The method according to claim 1, characterized in that, The acceleration chip includes a merging unit; When it is determined, based on the status information, that at least two registers contain data to be aggregated, two sets of data to be aggregated are selected for incremental merging processing to obtain partial results, including: Based on the status information, determine the set of registers storing the data to be aggregated; Based on the set of registers, the register storing the original data to be aggregated is selected as the source register, and the register storing the historical partial results is selected as the target register; the historical partial results are the intermediate aggregated data generated by incremental merging of the original data to be aggregated. The merging unit performs cross-level incremental merging processing on the original data to be aggregated in the source register and the historical partial results in the target register to obtain the partial results.

4. The method according to claim 2 or 3, characterized in that, The merging unit includes multiple sets of parallel accumulators; The process of selecting two sets of data to be aggregated and performing incremental merging yields partial results, including: The data to be aggregated is received by each accumulator in the multiple sets of parallel accumulators in turn, and incremental merging processing is performed on the data to be aggregated according to a fixed pipeline rhythm to obtain multiple sets of initial partial results; After the incremental merging process is completed, the state of each accumulator is switched from occupied to idle. After performing incremental merging processing on all the data to be aggregated through the multiple sets of parallel accumulators, the obtained initial partial results are merged to obtain the partial results.

5. The method according to claim 2 or 3, characterized in that, The merging unit includes an accumulator and a merging tree; The process of selecting two sets of data to be aggregated and performing incremental merging yields partial results, including: Multiple sets of continuously acquired data to be aggregated are continuously cached. Whenever the number of cached data to be aggregated reaches a preset number that matches the pipeline depth of the accumulator, the multiple sets of cached data to be aggregated are batch merged through the merging tree to obtain the aggregated data. The accumulator incrementally merges the current accumulated temporary result and the sum data to obtain a new accumulated temporary result; the accumulated temporary result is based on the previously obtained sum data. Repeat the above steps until all the data to be aggregated has been batch merged, and the partial results are obtained.

6. The method according to any one of claims 1 to 3, characterized in that, The method further includes: When multiple initial data to be aggregated are continuously acquired by the same input port, the multiple initial data to be aggregated are accumulated in the register corresponding to the input port, and the data obtained after the accumulation process is determined as the data to be aggregated acquired by the input port.

7. The method according to any one of claims 1 to 3, characterized in that, The acceleration chip also includes a completion detector; The method further includes: The number of input ports that have completed incremental merging processing is determined by the completion detector. When the number of input ports that have completed incremental merging processing reaches the port number threshold, output the currently obtained temporary partial result and generate a missing port identifier; After obtaining the target data to be aggregated from the input port corresponding to the missing port identifier, the temporary partial result is incrementally corrected based on the target data to be aggregated to obtain the reduction result.

8. A data processing system, characterized in that, The system includes multiple graphics processing units (GPUs) and acceleration chips; the multiple GPUs are used to generate data to be aggregated. The acceleration chip includes multiple input ports, multiple sets of registers, a merging unit, and a completion detector; wherein, the input ports and registers are in one-to-one correspondence. The acceleration chip is used to acquire the data to be aggregated through the multiple input ports; The multiple sets of registers are used to store the data to be aggregated at the corresponding input ports and to maintain the status information of the registers; The merging unit is used to select two sets of data to be merged when it detects that at least two registers store data to be merged, perform incremental merging processing on them, generate partial results, write the partial results into a target register, and update the count value in the target register; the count value is used to indicate the number of input ports that have completed incremental merging processing. The completion detector, connected to the multiple sets of registers and the merging unit, is used to determine the reduction result based on a portion of the result in the target register when the count value matches the number of the multiple input ports. The acceleration chip is also used to output the reduction result.

9. A data processing apparatus, characterized in that, include: The acquisition module is used to acquire data to be aggregated through multiple input ports of the acceleration chip, store the data to be aggregated acquired by each input port into the corresponding register, and update the status information of the register. The processing module is configured to, when determining, based on the status information, that at least two registers contain data to be aggregated, select two sets of data to be aggregated for incremental merging processing, obtain partial results, write the partial results into a target register, and update the count value in the target register; the count value is used to indicate the number of input ports that have completed incremental merging processing. The processing module is further configured to treat the partial results as new data to be aggregated and repeatedly perform incremental merging processing. When the count value is consistent with the number of the multiple input ports, the reduction result is determined based on the partial results in the target register.

10. A data processing device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.

12. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.