Data processing method and device, electronic equipment, computer readable storage medium and computer program product
By implementing parallel overlap of data exchange and computation within the computing node, the problem of difficulty in parallelizing computation and communication in distributed computing is solved, improving data processing efficiency and resource utilization, realizing pipeline overlap of data exchange and computation, and improving overall performance.
Patent Information
- Application Number
- CN202611570754.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-10
- Publication Date
- 2026-11-06
AI Technical Summary
In large model training and inference scenarios, computation and communication processes in distributed computing are difficult to execute in parallel, resulting in low data processing efficiency. In particular, when combining general matrix multiplication operators with distributed reduction operators in set communication, there are problems with low device utilization and communication efficiency.
By implementing parallel overlap of data exchange and computation within each computing node, the row data corresponding to the node is first obtained and data exchange is performed in the column dimension. Then, during the iteration process, data computation and data exchange in the next column dimension are performed simultaneously. The parallel operation of computation and communication is achieved by using direct data channels and independent communication units, ensuring the continuous operation of computing resources.
It significantly improves the overall processing efficiency and resource utilization of multi-node computing systems. By hiding the time overhead of cross-node communication, it achieves pipeline overlap between data exchange and computation, thereby improving the overall performance of data processing.
Smart Images

Figure CN123048243A_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and more particularly to a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] In large-scale model training and inference scenarios, distributed computing is a core method for processing massive amounts of data, with the combination of general matrix multiplication operators and distributed reduction operators in set communication having wide applications. In related technologies, to save storage space on computing nodes, the data matrix to be processed is typically partitioned along a specific dimension and distributed to various nodes. After each node completes its local matrix multiplication calculation, it calls the distributed reduction operator to communicate with other nodes and merge the results to output the final output. However, due to strong data dependencies, the computation and communication processes are difficult to execute in parallel, and the distributed reduction process generates a large number of element-level addition operations limited by chip performance bottlenecks. Therefore, the methods in related technologies cannot fully leverage the communication advantages of a fully interconnected network topology, resulting in low overall data processing efficiency. Summary of the Invention
[0003] This application provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product that can achieve parallel overlap of data exchange and data computation, thereby improving data processing efficiency.
[0004] The technical solution of this application embodiment is implemented as follows: This application provides a data processing method applied to a computing system containing multiple computing nodes. The method includes: Obtain the first and second data matrices to be processed; For each computing node, the first row of data corresponding to the computing node is obtained from the first data matrix, and the second row of data corresponding to the computing node is obtained from the second data matrix; Based on the second row of data, data exchange is performed with other computing nodes among the plurality of computing nodes in the first column dimension to obtain the first column of data in the second data matrix corresponding to the first column dimension; The first column dimension is determined as the current column dimension, and the following process is executed iteratively: Based on the first row data and the first column data corresponding to the current column dimension, determine the sub-result corresponding to the current column dimension; While determining the sub-result corresponding to the current column dimension, based on the second row of data, data exchange is performed with the other computing nodes for the next column dimension of the current column dimension to obtain the first column data in the second data matrix corresponding to the next column dimension, and the next column dimension is determined as the new current column dimension; When the current column dimension is the last column dimension, the target calculation result corresponding to the calculation node is generated based on the sub-results corresponding to each column dimension.
[0005] This application provides a data processing apparatus applied to a computing system comprising multiple computing nodes, the apparatus comprising: The acquisition module is used to acquire the first and second data matrices to be processed. The acquisition module is further configured to, for each computing node, acquire a first row of data corresponding to the computing node from the first data matrix and acquire a second row of data corresponding to the computing node from the second data matrix; The data exchange module is used to exchange data with other computing nodes among the plurality of computing nodes based on the second row of data, in the first column dimension, to obtain the first column of data in the second data matrix corresponding to the first column dimension; The iterative processing module is used to determine the first column dimension as the current column dimension and iteratively execute the following process: Based on the first row of data and the first column of data corresponding to the current column dimension, a sub-result corresponding to the current column dimension is determined; while determining the sub-result corresponding to the current column dimension, based on the second row of data, data exchange is performed with the other computing nodes for the next column dimension of the current column dimension to obtain the first column of data in the second data matrix corresponding to the next column dimension, and the next column dimension is determined as the new current column dimension; The generation module is used to generate the target calculation result corresponding to the calculation node based on the sub-results corresponding to each column dimension when the current column dimension is the last column dimension.
[0006] This application provides an electronic device, the electronic device comprising: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the data processing method provided in the embodiments of this application.
[0007] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the data processing method provided in this application when executed by a processor.
[0008] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the data processing method provided in this application.
[0009] The embodiments of this application have the following beneficial effects: In this embodiment of the application, a significant improvement in the performance of distributed matrix data processing is achieved through the overall design of data interaction between multiple computing nodes and local computing logic. Specifically, firstly, by retrieving the corresponding first and second rows of data from the first and second data matrices for each computing node, distributed loading of large-scale matrix data across multiple nodes is achieved, laying the data foundation for concurrent processing of the system. Subsequently, before the first iteration, data exchange is performed with other nodes based on the second row of data to obtain the first column of data, effectively completing cross-node data reorganization and providing initial column-oriented data support for the first round of local matrix operations. During the iteration execution phase, this application sets the calculation process of determining sub-results based on the current column dimension data and the communication process of exchanging data for the next column dimension based on the second row of data to be performed simultaneously. This mechanism achieves parallel overlap of data calculation tasks and data communication tasks on the time axis, enabling each computing node to obtain the data required for the next dimension in parallel while performing matrix operations in the current dimension. This integrates the time for cross-node data exchange with the local data calculation time, ensuring the continuous operation of computing resources and significantly improving time utilization. Finally, when executing the last column dimension, the target calculation result is generated based on the sub-results of each column dimension, ensuring the effective aggregation of intermediate sub-results after the multi-dimensional step-by-step iteration and ensuring the integrity of the final matrix calculation result. Therefore, the embodiments of this application significantly improve the overall processing efficiency of multi-node computing systems when processing data matrices and the comprehensive utilization rate of system resources by constructing a parallel collaborative mechanism for computing and data exchange within each computing node. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of the structure of the data processing system provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of the computing node 200 provided in the embodiments of this application; Figure 3 This is a flowchart illustrating the data processing method provided in an embodiment of this application; Figure 4 This is a schematic diagram of the process for obtaining the first row of data provided in an embodiment of this application; Figure 5 This is a flowchart illustrating the process of determining the first column of data provided in an embodiment of this application; Figure 6This is a schematic diagram of the left matrix data transformation process provided in the embodiments of this application; Figure 7 This is a first schematic diagram of the calculation and communication process provided in the embodiments of this application; Figure 8 This is a second schematic diagram of the calculation and communication process provided in the embodiments of this application; Figure 9 This is a third schematic diagram of the calculation and communication process provided in the embodiments of this application; Figure 10 This is a fourth schematic diagram of the calculation and communication process provided in the embodiments of this application; Figure 11 This is the fifth schematic diagram of the calculation and communication process provided in the embodiments of this application.
[0011] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0014] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0015] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0016] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0017] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0018] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0019] 1) Computing System: Refers to a distributed collaborative work platform composed of multiple interconnected computing entities. This platform connects various independent physical devices into a unified whole through an underlying physical network or communication topology. In the embodiments of this application, the computing system is used to coordinate and schedule ultra-large-scale data computing tasks, and can decompose macroscopic matrix multiplication tasks into fine-grained parts and distribute them to various participants in the cluster for synchronous execution.
[0020] 2) Computing Node: A computing node is an independent execution unit in a computing system that undertakes specific computational and communication tasks. Examples include a standalone physical server, a graphics processing unit (GPU), or a dedicated tensor computing accelerator card. Each computing node possesses independent computing resources, local memory, and a dedicated communication unit. During operation, the computing node is responsible for storing locally allocated data, autonomously executing local computational instructions, and engaging in high-bandwidth data exchange with other computing nodes.
[0021] 3) Matrix: A matrix is a data structure composed of a large amount of data arranged in a two-dimensional grid of rows and columns. In large-scale scientific computing or deep learning scenarios, matrices are often used to carry massive amounts of input features, neural network weights, and the final computational output results. To accommodate the needs of parallel processing by multiple computing nodes, a matrix can be physically divided into multiple smaller data blocks along the row or column directions, thus scattering them across different computing nodes.
[0022] 4) Element: Refers to the basic data carrier that constitutes a matrix, row data, or column data. An element can refer to a specific scalar value that directly participates in the underlying dot product operation, or it can refer to a local data slice that a computing node extracts from the row or column it is responsible for, used for cross-node transmission.
[0023] In large language model training and inference scenarios, distributed computing is typically used for data processing, often involving the combined application of the General Matrix Multiplication (GEMM) operator and the Reduce Scatter operator in set communication. In related technologies, to save storage space on computing nodes, the data matrix is usually partitioned along a K-dimensional plane. Specifically, assuming the first data matrix has dimensions (M, K) and the second data matrix has dimensions (K, N), after partitioning along the K-dimensional plane to obtain k, the system distributes the data evenly across the nodes. At this point, any computing node obtains the first data matrix with dimensions (M, k) and the second data matrix with dimensions (k, N) and performs local multiplication. Subsequently, if it is desired to distribute the calculated output along the M-dimensional plane across the computing nodes, the Reduce Scatter operator in set communication needs to be invoked, allowing nodes to reduce and distribute the final result by pulling or pushing data.
[0024] However, the aforementioned technologies have significant technical shortcomings in practical applications: On the one hand, due to the strict data dependencies, the computation and communication processes of computing nodes are difficult to execute in parallel. This problem is particularly prominent when GEMM operators are combined with distributed reduction operators, resulting in low equipment utilization. On the other hand, when performing reduction processing, distributed reduction operators inevitably generate a large number of element-wise addition operations. Existing chips generally suffer from weak computational performance when handling such element-wise addition operations, which seriously affects overall computational efficiency. Furthermore, in a single-machine system with a fully interconnected network structure, bandwidth can only be fully utilized when nodes simultaneously exchange data. Existing serial execution and reduction modes cannot fully leverage the characteristics of the fully interconnected network topology, resulting in low communication efficiency.
[0025] To address the aforementioned problems, embodiments of this application provide a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, capable of achieving parallel overlap of data exchange and data computation, thereby improving data processing efficiency. The following describes exemplary applications of the electronic device provided in this application. The electronic device provided in this application can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smart speakers, smartwatches, smart TVs, and in-vehicle terminals, or it can be implemented as a server. The following will describe exemplary applications when the electronic device is implemented as a server.
[0026] See Figure 1 , Figure 1 This is a schematic diagram of the structure of the data processing system provided in an embodiment of this application. For example... Figure 1As shown, the computing system 400 is used to collaboratively complete distributed data processing tasks, and its internal components include multiple computing nodes 200 ( Figure 1 The example shown includes computing nodes 200-1, 200-2, 200-3, and 200-4. Within the computing system 400, a direct data connection channel 300 is established between any two computing nodes 200. It should be noted that the aforementioned direct data connection channel 300 can be implemented through a Remote Direct Memory Access (RDMA) network; alternatively, when the multiple computing nodes 200 are implemented as multiple processors or acceleration chips within the same physical device, the direct data connection channel 300 can also be a high-speed interconnect bus within the device. This application does not specifically limit this.
[0027] Each computing node 200 in the computing system 400 is connected to its corresponding database, such as Figure 1 As shown, compute node 200-1 is connected to database 100-1, compute node 200-2 is connected to database 100-2, compute node 200-3 is connected to database 100-3, and compute node 200-4 is connected to database 100-4. These databases are used to store the first and second data matrices to be processed, and can also be used to store data generated during data processing, such as the first row of data, the second row of data, the first column of data, sub-results, and the target calculation result. These databases can be multiple storage devices independent of each compute node (e.g., ...). Figure 1 (As shown), it can also be a distributed storage medium deployed locally on each of the 200 computing nodes.
[0028] In practical applications, taking any computing node 200 as an example, this computing node 200 obtains the first row of data and the second row of data allocated to it from the first data matrix and the second data matrix stored in its corresponding database (e.g., computing node 200-1 obtains data from database 100-1). During the distributed computing process, the computing node 200 performs data computation tasks locally based on the currently obtained data; on the other hand, based on the aforementioned second row of data, the computing node 200 exchanges data for the next column dimension with other computing nodes through the aforementioned direct data connection channel 300. Since the data computation process for the current data and the data exchange process for the next column dimension are executed in parallel, the system can effectively hide the time overhead caused by cross-node communication, realize the pipeline overlap of data exchange and data computation, and thus significantly improve the data processing efficiency of the entire data processing system.
[0029] As previously stated, the method of this application is applied to a computing system comprising multiple computing nodes 200. Taking a specific implementation of a computing node 200 in the computing system as a server (i.e., the electronic device performing data processing is a server) as an example, see [link to relevant documentation]. Figure 2 , Figure 2 This is a schematic diagram of the structure of a computing node 200 provided in an embodiment of this application, wherein a schematic diagram of the structure of any computing node in a computing system is illustrated by way of example. Figure 2 The illustrated computing node 200 includes at least one processor 210, memory 230, and at least one network interface 220. The various components in the computing node 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 240.
[0030] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0031] The memory 230 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 230 may optionally include one or more storage devices physically located away from the processor 210.
[0032] The memory 230 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 230 described in this application embodiment is intended to include any suitable type of memory.
[0033] In some embodiments, memory 230 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0034] Operating system 231 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; The network communication module 232 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, WiFi, and Universal Serial Bus (USB).
[0035] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 A data processing device 233 stored in memory 230 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: an acquisition module 2331, a data exchange module 2332, an iterative processing module 2333, and a generation module 2334. These modules are logically connected and can therefore be arbitrarily combined or further divided according to the functions they implement. The functions of each module will be described below.
[0036] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0037] The data processing method provided in the embodiments of this application will be described below. As mentioned above, the electronic device implementing the data processing method of the embodiments of this application can be a terminal, a server, or a combination of both. The data processing method provided in the embodiments of this application will be described below with reference to exemplary applications and implementations of the server provided in the embodiments of this application. Therefore, the executing entity of each step will not be repeated below.
[0038] See Figure 3 , Figure 3 This is a flowchart illustrating the data processing method provided in the embodiments of this application, which will be combined with... Figure 3 The steps shown are explained.
[0039] In step 101, the first data matrix and the second data matrix to be processed are obtained.
[0040] Here, the first data matrix to be processed refers to the left operand matrix involved in the operation, and the second data matrix to be processed refers to the right operand matrix involved in the operation. The first and second data matrices to be processed can be obtained by reading local memory or receiving external input.
[0041] In step 102, for each computing node, the first row of data corresponding to the computing node is obtained from the first data matrix, and the second row of data corresponding to the computing node is obtained from the second data matrix.
[0042] Here, each computing node refers to an independent hardware processing unit in the distributed architecture responsible for handling a portion of the computing tasks. The first row of data refers to the set of row vectors in the first data matrix, which are then divided along the row direction and allocated to a specific computing node. The second row of data refers to the set of row vectors in the second data matrix, which are then divided along the row direction and allocated to a specific computing node. The original massive matrix data is distributed to various independent nodes according to a preset partitioning strategy, allowing each node to independently obtain the first and second rows of data it is responsible for processing. For example, with four computing nodes, the first data matrix containing 40 rows can be evenly partitioned, allowing each node to obtain 10 rows of data.
[0043] In some embodiments, see Figure 4 The step 102, "obtaining the first row of data corresponding to the computing node from the first data matrix," can be achieved through steps 1021 to 1024, including: In step 1021, the second column of data allocated to the computing node is obtained from the first data matrix.
[0044] Here, the second column of data refers to the set of column vectors that are partitioned along the column direction and allocated to the current computing node during the initial allocation phase of the first data matrix. The current computing node can directly read the pre-allocated second column of data belonging to itself from the local storage medium to prepare for the subsequent reconstruction of the complete row data. For example, if the first ten columns of the data module in the first data matrix are allocated to computing node A during the initial allocation phase, then this data module is the second column of data corresponding to computing node A.
[0045] In step 1022, the element located in the first row dimension of the second column of data is determined as the first element.
[0046] Here, the first row dimension refers to the range of row indices that the current computing node is responsible for processing in the final data allocation result. The first element refers to the local data block in the second column whose row index falls within the range of the first row dimension. The relevant data belonging to the first row dimension that the current computing node is responsible for is selected from the obtained second column data. Then, this local data that does not require cross-node communication is extracted as the first element. For example, if computing node A is responsible for processing the first 10 rows of the matrix, then the cross data block belonging to the first 10 rows in the second column data is determined as the first element.
[0047] In step 1023, the second element corresponding to the first row dimension is received from other computing nodes.
[0048] Here, "other computing nodes" refers to all nodes participating in distributed computation other than the node currently performing the operation. The second element refers to the data block stored locally on other nodes, whose row index belongs to the first row dimension of the current computing node. The current computing node receives data fragments from other nodes in the network, belonging to the first row dimension, to fill in any missing rows. For example, the current computing node receives supplementary data blocks belonging to the first ten rows of the first data matrix, routed and sent by the other three computing nodes respectively, and uniformly identifies them as the second element.
[0049] In some embodiments, while receiving the second element corresponding to the first row dimension sent by other computing nodes, the method further includes: In the second column of data, all elements other than the first element are identified as other elements; for each other element, the target row dimension corresponding to the other element is determined; from the other computing nodes, the target computing node corresponding to the target row dimension is determined, and the other elements are sent to the target computing node.
[0050] Here, "other elements" refers to data blocks in the second column whose row indices do not fall within the processing scope of the current compute node. The target row dimension refers to the correct row index range to which these other elements actually belong, and the target compute node refers to a specific node in the network topology designated to process that target row dimension. While receiving external data, the current compute node parses its own second column of data, extracting other elements that are not within its responsibility. Using a pre-defined mapping algorithm, it determines the target compute node to which these other elements should belong and then sends them out through the network channel. For example, suppose the current compute node is responsible for processing rows 1 to 10 of the first data matrix, but its locally held second column contains data blocks belonging to rows 11 to 20. The current compute node extracts these data blocks outside its responsibility as "other elements," determines their target row dimension to be "rows 11 to 20," finds the target compute node responsible for that dimension according to a pre-defined allocation rule, and then sends these other elements to that target compute node.
[0051] In this embodiment, a highly symmetrical data distribution mechanism is constructed by actively sending other elements to the corresponding target computing nodes while receiving the second element. During the process of collecting the data fragments required by the computing nodes, they simultaneously clean up and distribute the non-responsible dimension data they hold locally, enabling fully parallel processing of data reception and transmission operations. Furthermore, by clearly defining the target row dimension corresponding to each other element and accurately routing it to the target computing node, redundant transmission of invalid data is effectively avoided. This bidirectional parallel design fully leverages the throughput potential of the communication channel, ensuring the balance of data convergence and dispersal among multiple nodes, thereby significantly improving the overall communication efficiency of matrix data reassembly among various computing nodes.
[0052] In step 1024, the first row of data is determined based on the first element and the second element.
[0053] Here, the first element reserved locally and all the second elements collected through network communication are concatenated and merged according to the column sequence of the original matrix, so as to completely reconstruct the first row of data required for data processing in the local storage space of the current node.
[0054] In this embodiment, when determining the first row of data, the computing node employs a mechanism combining local data reuse with on-demand reception of missing data. Specifically, the computing node does not need to download the complete row of data; instead, it directly extracts the useful portion (i.e., the first element) from the existing second column of data locally, while only receiving its own missing data (i.e., the second element). Finally, the locally extracted first element is merged with the externally received second element to reconstruct the complete first row of data. This approach avoids the repeated transmission of complete row data, reduces network bandwidth pressure, and thus significantly accelerates the data construction speed of the computing node.
[0055] See also Figure 3 In step 103, based on the second row of data, data exchange is performed with other computing nodes in the first column dimension to obtain the first column of data in the second data matrix corresponding to the first column dimension.
[0056] Here, the first column dimension refers to the index of the first iteration position of the second data matrix along the column direction. The first column data refers to the complete column vector data corresponding to this dimension. During this process, the current computing node uses its stored second row data to exchange data with other computing nodes. Each computing node transfers data slices belonging to the first column dimension to each other according to predetermined rules. Through multicast or full interconnection exchange methods, the current computing node can aggregate the local data distributed across various computing nodes, thereby reconstructing the complete first column data.
[0057] In some embodiments, see Figure 5 The step 103, "based on the second row of data, exchange data with other computing nodes in the first column dimension to obtain the first column data in the second data matrix corresponding to the first column dimension," can be implemented through steps 1031 to 1033, including: In step 1031, the element located in the first column dimension of the second row of data is determined as the third element, and the third element is sent to other computing nodes.
[0058] Here, the third element refers to the data segment within the first column dimension range of the second row of data held by the current computing node. The current computing node extracts the data block belonging to the first column dimension range from its exclusively owned second row of data and uses it as the third element. Subsequently, the current computing node broadcasts or transmits this third element to other computing nodes.
[0059] In step 1032, the fourth element corresponding to the first column dimension is received from each of the other computing nodes.
[0060] Here, the fourth element refers to the data segment extracted by other computing nodes from their respective second row of data, which also belongs to the first column dimension range. The current computing node continuously receives data packets transmitted by other computing nodes and extracts multiple fourth elements belonging to the first column dimension range from them.
[0061] In step 1033, the first column of data is determined based on the third and fourth elements.
[0062] Here, the current computing node vertically aligns and concatenates its own generated third element with all the fourth elements received from other computing nodes. This concatenation process strictly follows the row index sequence of each element in the original second data matrix. In this way, the current computing node accurately concatenates the complete first column of data in its local memory. For example, the current computing node places its own third element at the beginning and appends multiple incoming fourth elements sequentially to the end, thus combining them into a complete column vector.
[0063] In this embodiment, computing nodes do not need to acquire the entire second data matrix; they only need to precisely extract the third element from their own second row of data and share it externally, while simultaneously collecting the fourth element shared by other computing nodes. Through fine-grained data exchange between computing nodes and local ordered concatenation, a smooth dimensional transformation from local row slices to global column slices is achieved. This embodiment precisely controls the amount of communication data in a single interaction, avoiding instantaneous network congestion and thus ensuring efficient bandwidth utilization of the distributed cluster when acquiring specific column data.
[0064] See also Figure 3 In step 104, the first column dimension is determined as the current column dimension, and the following process is executed iteratively: based on the first row data and the first column data corresponding to the current column dimension, the sub-result corresponding to the current column dimension is determined; while determining the sub-result corresponding to the current column dimension, based on the second row data, the data of the next column dimension of the current column dimension is exchanged with other computing nodes to obtain the first column data corresponding to the next column dimension in the second data matrix, and the next column dimension is determined as the new current column dimension.
[0065] Here, the current column dimension refers to the index of the working column being processed during column-direction iteration. Iterative execution refers to repeatedly running a specific sequence of computation and communication instructions until a termination condition is met. A sub-result refers to a partial output value obtained through local computation within a specific current column dimension's loop cycle. The next column dimension refers to the column index immediately following the current column dimension in the global column sequence. The new current column dimension is the column index used to guide the next round of operations after the state update is completed. During processing, the compute node first determines the initial first column dimension as the current column dimension to start the loop. Within the loop, the compute node uses the first row of data and performs mathematical operations on the first column data corresponding to the current column dimension to solve for the corresponding sub-result. Within the same time window of executing the current column dimension operation, the compute node extracts data fragments belonging to the next column dimension from the local second row of data in parallel for network interaction. Through this background communication, the compute node can seamlessly reassemble the first column data required for the next column dimension. After both communication and computation are completed, the compute node determines the next column dimension as the new current column dimension and repeats the same processing procedure.
[0066] In some embodiments, the first row of data includes multiple fifth elements, and the first column of data includes multiple sixth elements, and the number of fifth elements is equal to the number of sixth elements; the step 104, "determining the sub-result corresponding to the current column dimension based on the first row and first column of data corresponding to the current column dimension," can be implemented through the following process, including: Perform a dot product on the multiple fifth elements included in the first row of data and the multiple sixth elements included in the first column of data to obtain a sub-result.
[0067] Here, the fifth element refers to the most basic numerical unit constituting the first row of data, and the sixth element refers to the most basic numerical unit constituting the first column of data. Dot product processing refers to the standard mathematical operation of multiplying corresponding elements in two vectors of equal length and then summing all the products. First, the computation node checks the length of the first row and first column of data to ensure that the number of fifth and sixth elements they contain is equal. Then, it extracts the fifth and sixth elements at corresponding positions, performs multiplication, and sums all the resulting products to output the numerical sub-result for that dimension.
[0068] This application provides a distributed matrix multiplication micro-numerical computation logic within a single computing node. While ensuring alignment between row and column data dimensions, it enables continuous and seamless precise expansion of vector inner product operations in the underlying hardware, effectively eliminating the overhead of data padding or zero-padding. By deeply applying dot product processing, it fully leverages the computing power of the high-density tensor cores or multiply-accumulate arrays within the computing chip. This intensive multiply-accumulate mechanism ensures high throughput in local matrix computations, significantly improving the computational efficiency of the computing node in solving the current column dimension sub-result.
[0069] In some embodiments, a direct data channel is established between any two computing nodes in the computing system; the step 104, "while determining the sub-result corresponding to the current column dimension, exchanging data for the next column dimension with other computing nodes based on the second row of data," can be implemented through the following process, including: While determining the sub-results corresponding to the current column dimension, the computing node uses the communication unit within the computing node and the direct data channel to exchange data with other computing nodes for the next column dimension based on the second row of data.
[0070] Here, the communication unit refers to an independent hardware network module integrated within the compute node, dedicated to handling network packet transmission and reception and underlying protocol parsing. The direct data link refers to a point-to-point high-bandwidth communication link established between any two compute nodes within a distributed cluster via an underlying physical medium. In this process, the compute node delegates data transmission tasks to the dedicated communication unit. Therefore, while the compute unit performs computations, the communication unit can utilize the direct data link for high-speed transmission. This approach does not preempt core computation cycles or memory access bandwidth, and can independently and efficiently complete the prefetching and cross-node exchange of the next column of dimension data.
[0071] In this embodiment, by utilizing direct data channels and independent communication units, precise parallelism between computation and communication is achieved, solving the technical problem of the inability to parallelize computation and communication in distributed training. The direct data channels effectively avoid the routing and forwarding delays found in traditional switching networks, granting extremely high data transmission determinism between any two points. Through an asynchronous design where communication and computation units are completely decoupled, the computation pipeline of the current column dimension and the communication pipeline of the next column dimension achieve spatiotemporal overlap. This hardware-software collaborative mechanism minimizes the time overhead of cross-node data migration, ensuring full-load operation of computing units and significantly improving the overall throughput of multi-computing node clusters.
[0072] In step 105, when the current column dimension is the last column dimension, the target calculation result corresponding to the calculation node is generated based on the sub-results corresponding to each column dimension.
[0073] Here, the last column dimension refers to the computational boundary and loop termination condition defined along the column direction in the second data matrix. The target computation result refers to the final result data output by the computation node after completing the computation task. During operation, the computation node monitors the progress of the status pointer in real time. When it confirms that the current column dimension has reached the last column dimension, it will trigger a termination signal. Subsequently, the computation node will summarize all the sub-results accumulated in the previous loop cycles of each current column dimension and finally synthesize them into the target computation result corresponding to that computation node.
[0074] In some embodiments, the step 105 of "generating the target calculation result corresponding to the calculation node based on the sub-results corresponding to each column dimension" can be implemented through the following process, including: For each column dimension, determine the position information of the column dimension in the target calculation result; based on the position information, concatenate the sub-results corresponding to each column dimension to obtain the target calculation result.
[0075] Here, location information refers to the precise coordinates or offset address that each sub-result should occupy within the data structure of the target computation result. The concatenation process refers to the memory operation of assembling multiple isolated data blocks into a continuous data carrier according to a pre-defined spatial correspondence. Specifically, the computation node parses the column label coordinates corresponding to the sub-results generated in each iteration. Based on these address coordinates, all sub-results are arranged, aligned, and concatenated in a contiguous memory space to form the target computation result.
[0076] In this embodiment, a rigorous reconstruction criterion is provided for the data merging stage by directionally concatenating the sub-results corresponding to each column dimension based on location information. During the iterative computation phase, the computing nodes pre-bind the corresponding location information for the sub-results of each column dimension, eliminating the risk of memory data disorder that may be caused by asynchronous execution. Subsequent concatenation processing does not require time-consuming global reordering algorithms; instead, it directly performs underlying memory address mapping and data copying based on the predetermined positions. This data assembly mechanism based on precise coordinates reduces the logical operation overhead of the computing nodes in the post-processing stage, while improving the reconstruction efficiency of the sub-results.
[0077] In this embodiment of the application, a significant improvement in the performance of distributed matrix data processing is achieved through the overall design of data interaction between multiple computing nodes and local computing logic. Specifically, firstly, by retrieving the corresponding first and second rows of data from the first and second data matrices for each computing node, distributed loading of large-scale matrix data across multiple nodes is achieved, laying the data foundation for concurrent processing of the system. Subsequently, before the first iteration, data exchange is performed with other nodes based on the second row of data to obtain the first column of data, effectively completing cross-node data reorganization and providing initial column-oriented data support for the first round of local matrix operations. During the iteration execution phase, this application sets the calculation process of determining sub-results based on the current column dimension data and the communication process of exchanging data for the next column dimension based on the second row of data to be performed simultaneously. This mechanism achieves parallel overlap of data calculation tasks and data communication tasks on the time axis, enabling each computing node to obtain the data required for the next dimension in parallel while performing matrix operations in the current dimension. This integrates the time for cross-node data exchange with the local data calculation time, ensuring the continuous operation of computing resources and significantly improving time utilization. Finally, when executing the last column dimension, the target calculation result is generated based on the sub-results of each column dimension, ensuring the effective aggregation of intermediate sub-results after the multi-dimensional step-by-step iteration and ensuring the integrity of the final matrix calculation result. Therefore, the embodiments of this application significantly improve the overall processing efficiency of multi-node computing systems when processing data matrices and the comprehensive utilization rate of system resources by constructing a parallel collaborative mechanism for computing and data exchange within each computing node.
[0078] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0079] In a terminal-server interaction architecture with a full mesh network topology, there is a direct connection between any two computing nodes (corresponding to the direct data channel in other embodiments). When the computing node has sufficient storage space, it can obtain the complete left matrix (corresponding to the first data matrix in other embodiments) and right matrix (corresponding to the second data matrix in other embodiments) and directly output the complete result. However, in large model scenarios, since the left and right matrices are usually large, the input / output must be split. For example, the left matrix can be split by columns, and the right matrix by rows.
[0080] Significant communication and computational bottlenecks exist in the partitioning calculation process of related technologies. Assume there are four computation nodes. Each node receives 1 / 4 column of data from the left matrix (corresponding to the second column in other embodiments; for example, when the left matrix is M×K, the data size is M×K / 4) and 1 / 4 row of data from the right matrix (corresponding to the second row in other embodiments; for example, when the right matrix is K×N, the data size is K / 4×N). The desired result is to be distributed row-wise to each computation node. In reality, after receiving the corresponding data, each computation node calculates an output matrix of size M×N. To obtain a mathematically equivalent result to the multiplication of the complete matrix, the outputs of all computation nodes must be accumulated. To ensure accumulation precision, related technologies store the outputs of each computation node as single-precision floating-point numbers (32-bit floating point, fp32) and transmit them with high precision between computation nodes. When a computation node receives the outputs of the other three computation nodes (corresponding to the other computation nodes in other embodiments), it then performs element-wise accumulation. This not only leads to high bandwidth consumption for single-precision floating-point numbers, but also introduces time-consuming element-by-element operations.
[0081] To avoid the aforementioned high-bandwidth transmission and element-by-element operation calls, this application proposes a data processing scheme that deeply integrates communication and computation, based on the characteristics of a full mesh network structure. Specifically, this embodiment achieves a fusion of general matrix multiplication and reduce-scatter operations. In this scheme, even if the left and right matrices in the computation process are low-precision tensors such as half-precision floating-point numbers (16-bit floating point, fp16) or brain floating-point numbers (bf16), there is no need to introduce single-precision floating-point numbers (fp32) for data transmission, and element-by-element addition operations are eliminated. This method supports synchronous data exchange between any two computing nodes, enabling the computation and communication processes to be executed in parallel. Furthermore, these processes are mathematically equivalent, with no precision loss issues, thus fully utilizing the advantages of the network structure and significantly improving communication efficiency. Based on this, this application's embodiment designs the following scheme: Assume that this embodiment contains four computing nodes (computing nodes 1 to 4). The four computing nodes form a full mesh topology, with direct connections between any two nodes to enable direct data interaction. The following section will use computing node 1 as an example to illustrate its data processing procedure in detail.
[0082] First, adjust the left matrix to be split by row, that is, transform the 1 / 4 column data of the left matrix assigned to computing node 1 into the 1 / 4 row data of the left matrix.
[0083] See Figure 6 , Figure 6 This is a schematic diagram of the left matrix data transformation process provided in the embodiments of this application.
[0084] like Figure 6 As shown, data 61 is the column data in the left matrix assigned to computing node 1 (corresponding to the second column data in other embodiments), and data 62 is the row data obtained by computing node 1 after data exchange (corresponding to the first row data in other embodiments). Computing node 1 first divides data 61 into four equal parts, obtaining elements 611, 612, 613, and 614. Element 611 (corresponding to the first element in other embodiments) is copied and stored locally. Next, element 612 is sent to computing node 2, while simultaneously receiving element 621 sent by computing node 2; element 613 is sent to computing node 3, while simultaneously receiving element 622 sent by computing node 3; element 614 is sent to computing node 4, while simultaneously receiving element 623 sent by computing node 4; then, elements 611, 621, 622, and 623 are combined to obtain data 62.
[0085] Next, the right matrix is processed so that each computing node gradually acquires the complete right matrix data required for computation. Each computing node sends a portion of its own data (i.e., 1 / 4 row of data, corresponding to the second row of data in other embodiments) and receives data sent by the other three computing nodes (corresponding to the data exchange of the first column dimension in other embodiments, obtaining the first column of data). Therefore, data is being sent and received between any two computing nodes (corresponding to computing nodes in other embodiments).
[0086] The computation and communication process here consists of the following steps, with communication taking the lead.
[0087] In step 1, the first step of communication is performed.
[0088] See Figure 7 , Figure 7 This is a first schematic diagram of the calculation and communication process provided in the embodiments of this application.
[0089] like Figure 7As shown, data 71 is the row data in the right matrix assigned to computing node 1 (corresponding to the second row data in other embodiments), and data 72 is the column data obtained by computing node 1 after data exchange (corresponding to the first column data in other embodiments). Computing node 1 first divides data 71 into four equal parts, obtaining elements 711, 712, 713, and 714. Then, element 711 (corresponding to the third element in other embodiments) is sent to other computing nodes (including computing nodes 2, 3, and 4), while simultaneously receiving element 721 sent by computing node 2, element 722 sent by computing node 3, and element 723 sent by computing node 4. Finally, elements 711, 721, 722, and 723 are combined to obtain data 72.
[0090] In step 2, the first step of calculation and the second step of communication are performed simultaneously (corresponding to the data exchange of the next column dimension while determining the sub-result corresponding to the current column dimension in other embodiments), and the two processes overlap and overlay each other.
[0091] See Figure 8 , Figure 8 This is a second schematic diagram of the calculation and communication process provided in the embodiments of this application.
[0092] like Figure 8 As shown, 62 represents the data in row 1 / 4 of the left matrix obtained by computing node 1 (corresponding to the first row of data in other embodiments). In the first step of the calculation, by performing matrix multiplication on data 62 and data 72 obtained in step 1, the output result 81 corresponding to the current step (corresponding to the sub-result corresponding to the current column dimension in other embodiments) can be obtained.
[0093] Meanwhile, in the second step of the communication process, computing node 1 sends element 712 to other computing nodes (including computing nodes 2, 3, and 4), and simultaneously receives element 821 from computing node 2, element 822 from computing node 3, and element 823 from computing node 4. Finally, it combines the local element 712, the received elements 821, 822, and 823 to obtain data 82, which is then used for the next stage of computation.
[0094] In step 3, the second step of computation and the third step of communication are performed simultaneously, with the two processes overlapping and overshadowing each other.
[0095] See Figure 9 , Figure 9 This is a third schematic diagram of the calculation and communication process provided in the embodiments of this application.
[0096] like Figure 9As shown, in the second step of the calculation, by performing matrix multiplication on data 62 and data 82 obtained in step 2, the output result 91 corresponding to the current step can be obtained.
[0097] Simultaneously, in the third step of the communication process, computing node 1 sends its locally stored element 713 to other computing nodes (including computing nodes 2, 3, and 4), while receiving element 921 from computing node 2, element 922 from computing node 3, and element 923 from computing node 4. Finally, it combines the local element 713, the received elements 921, 922, and 923 to obtain data 92, which is then used for the next stage of computation.
[0098] In step 4, the third step of computation and the fourth step of communication are performed simultaneously, with the two processes overlapping and overshadowing each other.
[0099] See Figure 10 , Figure 10 This is a fourth schematic diagram of the calculation and communication process provided in the embodiments of this application.
[0100] like Figure 10 As shown, in the third step of the calculation, by performing matrix multiplication on data 62 and data 92 obtained in step 3, the output result 1001 corresponding to the current step can be obtained.
[0101] Simultaneously, in the fourth step of the communication process, computing node 1 sends its last locally retained element 714 to the other computing nodes (including computing nodes 2, 3, and 4), while receiving element 10021 from computing node 2, element 10022 from computing node 3, and element 10023 from computing node 4. Finally, the local element 714, the received elements 10021, 10022, and 10023 are combined to obtain the last 1 / 4 column of data 1002 in the right matrix, for use in the final stage of calculation.
[0102] In step 5, the communication process ends, and the final step of the calculation (i.e., the fourth step of the calculation) is performed.
[0103] See Figure 11 , Figure 11 This is the fifth schematic diagram of the calculation and communication process provided in the embodiments of this application.
[0104] like Figure 11 As shown, in the fourth step of the calculation, by performing matrix multiplication on data 62 and the last 1 / 4 column of data 1002 obtained in step 4, the output result 111 corresponding to the current step can be obtained.
[0105] Upon completion of step 5, the output results obtained from the above steps are concatenated to generate the complete output result corresponding to the computation node (corresponding to the target computation result in other embodiments). The above process is executed iteratively on each computation node, eliminating element-wise addition and data transmission with a precision higher than that of the left and right matrices.
[0106] It should be noted that the above process is described in detail using only four computing nodes as an example. The data processing method provided in this application embodiment is also applicable to cluster scenarios with more hardware devices. For example, in a terminal and server interaction architecture containing eight accelerator cards (i.e., eight computing nodes), when performing general matrix multiplication and calling reduction spread: initially, each accelerator card holds 1 / 8 column data of the left matrix (first data matrix) and 1 / 8 row data of the right matrix (second data matrix). First, through all-to-all communication, the 1 / 8 column data of the left matrix held by each accelerator card is converted into the corresponding row data. Subsequently, the calculation and all-to-all communication processes are each divided into eight steps and executed in parallel, with the communication process always leading the calculation process by one step, overlapping and masking each other. Finally, the corresponding target calculation result (i.e., 1 / 8 row data of the output result) will be obtained on each accelerator card. This process can also completely avoid the high bandwidth transmission of single-precision floating-point numbers and element-by-element addition operations, greatly improving communication efficiency while ensuring accuracy.
[0107] The data processing method and interaction architecture provided in this application can bring the following beneficial technical effects: (1) Achieve deep overlap of general computing and significantly shorten running time: By achieving mutual overlap between communication process and computing process, the overall time consumption of the interactive architecture in the process of performing general matrix multiplication and reduction dissemination fusion is effectively shortened, and the hardware computing performance of each computing node is maximized.
[0108] (2) Leveraging the advantages of mesh topology to maximize interaction efficiency: It fully utilizes the characteristics of the full mesh network topology between computing nodes to perform matrix multiplication calculations in parallel while transmitting data. This mechanism ensures that the direct data links between any two computing nodes are in a fully loaded concurrent state, realizing the synchronous and efficient utilization of global data links and significantly improving the overall computing and communication interaction efficiency.
[0109] (3) Eliminate redundant operation overhead and ensure zero precision loss in calculation: The element-by-element addition operation in traditional communication operators is completely eliminated at the algorithm level, which effectively avoids the high bandwidth data transmission requirements of single-precision floating-point numbers; at the same time, the fusion calculation process is strictly equivalent in mathematical logic, and without introducing any precision problems under the premise of reducing transmission and calculation overhead, the accuracy of the calculation results is guaranteed.
[0110] The following description continues to illustrate the exemplary structure of the data processing device 233 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the data processing device 233 of the memory 230 may include: The acquisition module 2331 is used to acquire the first data matrix and the second data matrix to be processed; The acquisition module 2331 is further configured to, for each computing node, acquire the first row of data corresponding to the computing node from the first data matrix and acquire the second row of data corresponding to the computing node from the second data matrix; Data exchange module 2332 is used to exchange data with other computing nodes among the plurality of computing nodes based on the second row of data, in the first column dimension, to obtain the first column of data in the second data matrix corresponding to the first column dimension; The iterative processing module 2333 is used to determine the first column dimension as the current column dimension and iteratively execute the following process: Based on the first row of data and the first column of data corresponding to the current column dimension, a sub-result corresponding to the current column dimension is determined; while determining the sub-result corresponding to the current column dimension, based on the second row of data, data exchange is performed with the other computing nodes for the next column dimension of the current column dimension to obtain the first column of data in the second data matrix corresponding to the next column dimension, and the next column dimension is determined as the new current column dimension; The generation module 2334 is used to generate the target calculation result corresponding to the calculation node based on the sub-results corresponding to each column dimension when the current column dimension is the last column dimension.
[0111] In some embodiments, the acquisition module 2331 is further configured to acquire a second column of data allocated to the computing node from the first data matrix; determine the element in the second column of data located in the first row dimension as the first element; receive the second element corresponding to the first row dimension sent by the other computing node; and determine the first row of data based on the first element and the second element.
[0112] In some embodiments, while receiving the second element corresponding to the first row dimension sent by the other computing nodes, the data exchange module 2332 is further configured to determine the elements other than the first element in the second column data as other elements; for each other element, determine the target row dimension corresponding to the other element; determine the target computing node corresponding to the target row dimension from the other computing nodes, and send the other element to the target computing node.
[0113] In some embodiments, the data exchange module 2332 is further configured to determine the element located in the first column dimension of the second row of data as the third element and send the third element to the other computing nodes; receive the fourth element corresponding to the first column dimension sent by each of the other computing nodes; and determine the first column of data based on the third element and the fourth element.
[0114] In some embodiments, the first row of data includes a plurality of fifth elements, the first column of data includes a plurality of sixth elements, and the number of the fifth elements is equal to the number of the sixth elements; the iterative processing module 2333 is further configured to perform dot product processing on the plurality of fifth elements included in the first row of data and the plurality of sixth elements included in the first column of data to obtain the sub-result.
[0115] In some embodiments, a direct data channel is established between any two computing nodes in the computing system; the iterative processing module 2333 is further configured to, while determining the sub-result corresponding to the current column dimension, exchange data with the other computing nodes based on the second row data through the communication unit within the computing node and using the direct data channel for the next column dimension of the current column dimension.
[0116] In some embodiments, the generation module 2334 is further configured to determine the position information of each column dimension in the target calculation result; and based on the position information, to perform concatenation processing on the sub-results corresponding to each column dimension to obtain the target calculation result.
[0117] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the data processing method described in this application.
[0118] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the data processing method provided in this application. For example, ... Figure 3 The data processing method is shown.
[0119] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0120] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0121] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be part of a file of other programs or data, such as in one or more scripts stored in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files storing one or more modules, subroutines, or code sections).
[0122] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0123] In summary, the embodiments of this application effectively reduce communication overhead and improve computing efficiency by rationally scheduling and coordinating data interaction and local computing logic among multiple computing nodes, thereby achieving a significant improvement in the performance of distributed matrix data processing. Specifically, firstly, by retrieving the corresponding first and second rows of data from the first and second data matrices for each computing node, distributed loading of large-scale matrix data across multiple nodes is achieved, laying the data foundation for concurrent processing of the system. Subsequently, before the first iteration, data exchange is performed with other nodes based on the second row of data to obtain the first column of data, effectively completing cross-node data reorganization and providing initial column-oriented data support for the first round of local matrix operations. During the iteration execution phase, this application sets the calculation process of determining sub-results based on the current column dimension data and the communication process of exchanging data for the next column dimension based on the second row of data to be performed simultaneously. This mechanism achieves parallel overlap of data calculation tasks and data communication tasks on the time axis, enabling each computing node to obtain the data required for the next dimension in parallel while performing matrix operations in the current dimension. This integrates the time for cross-node data exchange with the local data calculation time, ensuring the continuous operation of computing resources and significantly improving time utilization. Finally, when executing the last column dimension, the target calculation result is generated based on the sub-results of each column dimension, ensuring the effective aggregation of intermediate sub-results after the multi-dimensional step-by-step iteration and ensuring the integrity of the final matrix calculation result. Therefore, the embodiments of this application significantly improve the overall processing efficiency of multi-node computing systems when processing data matrices and the comprehensive utilization rate of system resources by constructing a parallel collaborative mechanism for computing and data exchange within each computing node.
[0124] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A data processing method, applied to a computing system containing multiple computing nodes, characterized in that, The method includes: Obtain the first and second data matrices to be processed; For each computing node, the first row of data corresponding to the computing node is obtained from the first data matrix, and the second row of data corresponding to the computing node is obtained from the second data matrix; Based on the second row of data, data exchange is performed with other computing nodes among the plurality of computing nodes in the first column dimension to obtain the first column of data in the second data matrix corresponding to the first column dimension; The first column dimension is determined as the current column dimension, and the following process is executed iteratively: Based on the first row data and the first column data corresponding to the current column dimension, determine the sub-result corresponding to the current column dimension; While determining the sub-result corresponding to the current column dimension, based on the second row of data, data exchange is performed with the other computing nodes for the next column dimension of the current column dimension to obtain the first column data in the second data matrix corresponding to the next column dimension, and the next column dimension is determined as the new current column dimension; When the current column dimension is the last column dimension, the target calculation result corresponding to the calculation node is generated based on the sub-results corresponding to each column dimension.
2. The method according to claim 1, characterized in that, The step of obtaining the first row of data corresponding to the computing node from the first data matrix includes: Obtain the second column of data allocated to the computing node from the first data matrix; In the second column of data, the element located in the first row dimension is determined as the first element; Receive the second element corresponding to the first row dimension sent by the other computing nodes; Based on the first element and the second element, the first row of data is determined.
3. The method according to claim 2, characterized in that, While receiving the second element corresponding to the first row dimension sent by the other computing nodes, the method further includes: In the second column of data, elements other than the first element are identified as other elements; For each of the other elements, determine the target row dimension corresponding to the other element; From the other computing nodes, determine the target computing node corresponding to the target row dimension, and send the other elements to the target computing node.
4. The method according to claim 1, characterized in that, The step of exchanging data in the first column dimension with other computing nodes among the plurality of computing nodes based on the second row data to obtain the first column data in the second data matrix corresponding to the first column dimension includes: The element located in the first column dimension of the second row of data is identified as the third element, and the third element is sent to the other computing nodes; Receive the fourth element corresponding to the first column dimension sent by each of the other computing nodes; The first column of data is determined based on the third element and the fourth element.
5. The method according to claim 1, characterized in that, The first row of data includes multiple fifth elements, and the first column of data includes multiple sixth elements, and the number of the fifth elements is equal to the number of the sixth elements; The step of determining the sub-result corresponding to the current column dimension based on the first row data and the first column data corresponding to the current column dimension includes: The sub-result is obtained by performing a dot product on the multiple fifth elements included in the first row of data and the multiple sixth elements included in the first column of data.
6. The method according to claim 1, characterized in that, A direct data channel is established between any two computing nodes in the computing system; The step of determining the sub-result corresponding to the current column dimension, and exchanging data with the other computing nodes for the next column dimension based on the second row of data, includes: While determining the sub-result corresponding to the current column dimension, the computing node uses the communication unit within the computing node and the direct data channel to exchange data with other computing nodes for the next column dimension of the current column dimension based on the second row of data.
7. The method according to claim 1, characterized in that, The process of generating the target calculation result corresponding to the calculation node based on the sub-results corresponding to each column dimension includes: For each column dimension, determine the position information of the column dimension in the target calculation result; Based on the location information, the sub-results corresponding to each column dimension are concatenated to obtain the target calculation result.
8. A data processing apparatus, applied to a computing system comprising multiple computing nodes, characterized in that, The device includes: The acquisition module is used to acquire the first and second data matrices to be processed. The acquisition module is further configured to, for each computing node, acquire a first row of data corresponding to the computing node from the first data matrix and acquire a second row of data corresponding to the computing node from the second data matrix; The data exchange module is used to exchange data with other computing nodes among the plurality of computing nodes based on the second row of data, in the first column dimension, to obtain the first column of data in the second data matrix corresponding to the first column dimension; The iterative processing module is used to determine the first column dimension as the current column dimension and iteratively execute the following process: Based on the first row of data and the first column of data corresponding to the current column dimension, a sub-result corresponding to the current column dimension is determined; while determining the sub-result corresponding to the current column dimension, based on the second row of data, data exchange is performed with the other computing nodes for the next column dimension of the current column dimension to obtain the first column of data in the second data matrix corresponding to the next column dimension, and the next column dimension is determined as the new current column dimension; The generation module is used to generate the target calculation result corresponding to the calculation node based on the sub-results corresponding to each column dimension when the current column dimension is the last column dimension.
9. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method described in any one of claims 1 to 7.
11. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method according to any one of claims 1 to 7.
