Data processing method and device applied to distributed system, equipment and medium
By dividing the data blocks into sub-blocks in the distributed system and stably allocating them in the computing unit group, combined with the circular iterative operation, the stability problem of the data processing results in the distributed system is solved, and more accurate and stable data processing results are achieved. .
Patent Information
- Application Number
- CN202410903489.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-22
AI Technical Summary
In a distributed system, the stability of data processing results is affected by the logical differences in the data set of the computing unit group and the accumulation sequence of the ring total reduction algorithm, resulting in unstable calculation results.
By dividing the data block to be processed into multiple sub-blocks and assigning them to multiple computing unit groups, the division-mapping method of data blocks and computing unit groups is ensured to be stable, and a circular iterative operation is used to maintain the accumulation order of the intermediate processing results of the computing units unchanged. , and then determine the processing result of the data block by performing a data reduction operation on the target computing unit group.
It improves the accuracy and stability of distributed data processing, avoids differences in calculation results due to changes in the accumulation order, and ensures the consistency of data processing results.
Smart Images

Figure CN118819846A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of chip technology and distributed data processing technology, and specifically to a data processing method, device, electronic device, computer-readable storage medium and computer program product applied to a distributed system. Background Art
[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0003] With the development of artificial intelligence technology, more and more applications based on artificial intelligence technology have achieved results far exceeding traditional algorithms. Deep learning is a data-intensive and computationally intensive algorithm. In order to improve the training and reasoning speed of large-scale deep learning models, a distributed system containing multiple computing units or multiple computing unit groups can be used to perform data processing to meet computing power requirements.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a data processing method, device, electronic device, computer-readable storage medium, and computer program product applied to a distributed system.
[0006] According to one aspect of the present disclosure, there is provided a data processing method for a distributed system, wherein a plurality of computing units in the distributed system can constitute a plurality of computing unit groups, and the data to be processed includes a plurality of data blocks, and the method includes: for each data block in the plurality of data blocks, dividing the data block into a plurality of first sub-blocks respectively corresponding to the plurality of computing unit groups; based on a target computing unit group corresponding to the data block, dividing each first sub-block in the plurality of first sub-blocks into a plurality of second sub-blocks respectively corresponding to the plurality of computing units in the target computing unit group; determining a plurality of first processing results respectively output by the plurality of computing units by processing the second sub-block using the computing unit corresponding to each second sub-block; and determining a processing result of the data block by performing a data reduction operation on the plurality of first processing results using the target computing unit group.
[0007] According to another aspect of the present disclosure, there is provided a data processing device applied to a distributed system, wherein a plurality of computing units in the distributed system can constitute a plurality of computing unit groups, and the data to be processed includes a plurality of data blocks, and the device includes: a first partitioning unit, configured to partition each of the plurality of data blocks into a plurality of first sub-blocks corresponding to the plurality of computing unit groups respectively; a second partitioning unit, configured to partition each of the plurality of first sub-blocks into a plurality of second sub-blocks corresponding to the plurality of computing units in the target computing unit group based on a target computing unit group corresponding to the data block; a first processing unit, configured to determine a plurality of first processing results respectively output by the plurality of computing units by processing the second sub-block using the computing unit corresponding to each second sub-block; and a second processing unit, configured to determine a processing result of the data block by performing a data reduction operation on the plurality of first processing results using the target computing unit group.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above-mentioned data processing method.
[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above data processing method.
[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program can implement the above data processing method when executed by a processor.
[0011] According to one or more embodiments of the present disclosure, the stability of data processing results can be guaranteed, thereby improving the accuracy of distributed data processing.
[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0014] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an exemplary embodiment of the present disclosure;
[0015] Figure 2 A flow chart of a data processing method applied to a distributed system according to an exemplary embodiment of the present disclosure is shown;
[0016] Figure 3 A schematic diagram of the structure of a distributed system according to an exemplary embodiment of the present disclosure is shown;
[0017] Figure 4 A schematic diagram showing a data processing process according to an exemplary embodiment of the present disclosure;
[0018] Figure 5 A schematic diagram showing a data processing process according to an exemplary embodiment of the present disclosure;
[0019] Figure 6 A structural block diagram of a data processing device applied to a distributed system according to an exemplary embodiment of the present disclosure is shown;
[0020] Figure 7 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0021] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0022] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0023] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0024] In a distributed system, multiple computing unit groups can be used to perform data operations and collective communication operations to achieve data synchronization. In the prior art, the data to be processed is usually distributed dynamically based on the current load status, resulting in the same data being distributed to different computing unit groups in different rounds. It can be understood that when using a distributed system for data processing, various types of collective communication operations are required to achieve data synchronization and data exchange between nodes in the system. Since the data collection logic of different computing unit groups is different, it may affect the stability of the calculation results.
[0025] For example, when multiple computing units in a distributed system can form multiple computing unit groups of ring topology, each computing unit group of the ring topology can apply the ring all reduce algorithm to reduce the data results of each computing unit in the computing unit group. Since the data exchange and accumulation steps of the ring all reduce algorithm process are based on a unidirectional ring topology and accumulate the data in each computing unit in a fixed direction in sequence, different data accumulation orders (i.e., the order in which each computing unit is arranged in the ring topology) may cause differences in the accumulation results, for example, they may be affected by the rounding operation in the addition calculation, thereby affecting the stability of the data processing results.
[0026] Based on this, the present disclosure provides a data processing method. When multiple computing units in the system can constitute multiple computing unit groups, the data blocks in the data to be processed are used as the division basis, each data block is divided into multiple sub-blocks and allocated to multiple computing unit groups to ensure that the division-mapping method of the data blocks and the computing unit groups remains stable, thereby ensuring the stability of the data processing results.
[0027] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0028] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
[0029] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the data processing method to be performed.
[0030] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0031] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0032] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to send data processing requests or data to be processed. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.
[0033] Client devices 101, 102, 103, 104, 105 and / or 106 may include various categories of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various categories and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (eg, email applications), short message service (SMS) applications, and may use various communication protocols.
[0034] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0035] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0036] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0037] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0038] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
[0039] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different categories. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0040] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different categories of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0041] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.
[0042] Figure 2 A flow chart of a data processing method 200 according to an exemplary embodiment of the present disclosure is shown, wherein the multiple computing units in the distributed system can constitute multiple computing unit groups, and the data to be processed includes multiple data blocks. Figure 2 As shown, the method 200 includes:
[0043] Step S201: for each data block in the plurality of data blocks, divide the data block into a plurality of first sub-blocks respectively corresponding to the plurality of computing unit groups;
[0044] Step S202: based on the target computing unit group corresponding to the data block, divide each first sub-block of the plurality of first sub-blocks into a plurality of second sub-blocks respectively corresponding to the plurality of computing units in the target computing unit group;
[0045] Step S203, determining a plurality of first processing results respectively output by the plurality of computing units by processing the second sub-block using the computing unit corresponding to each second sub-block; and
[0046] Step S204: Determine a processing result of the data block by using the target computing unit group to perform a data reduction operation on the multiple first processing results.
[0047] By applying the above method 200, when there are multiple computing unit groups in the system, each data block can be divided into multiple first sub-blocks and allocated to multiple computing unit groups based on the data blocks in the data to be processed, so as to ensure that the division-mapping method of the data blocks and the computing unit groups remains stable, thereby ensuring the stability of the data processing results.
[0048] In some examples, the data block information in the data to be processed may be explicit, for example, the data to be processed may be a data block sequence consisting of multiple naturally disconnected data blocks. In some examples, the data to be processed may be divided into multiple data blocks before step S201, for example, the data to be processed may be divided into multiple data blocks according to a preset block size.
[0049] In some examples, the computing unit group may be a collection of multiple computing units in a distributed system that can complete a set of collective communication operations. It is understandable that the computing units included in different computing unit groups may be the same or different. For example, when the aforementioned collective communication operation is a ring full reduction operation performed based on a unidirectional ring topology, and when multiple computing units in the distributed system can form N ring topologies, the number of computing unit groups in the distributed system is 2N.
[0050] According to some embodiments, the multiple computing units in the target computing unit group form a ring topology, and in step S204, the target computing unit group is used to perform a data reduction operation on the multiple first processing results to determine the processing result of the data block, including: accumulating the first processing result of each computing unit in turn based on the arrangement order of the multiple computing units in the target computing unit group in the ring topology; and determining the processing result of the data block based on the accumulated result. Therefore, in the process of realizing collective communication based on the ring-all-reduce algorithm, the data sharding and computing power allocation method described in the application method 200 can be used to ensure that the accumulation order of the intermediate processing results of each computing unit remains unchanged, thereby ensuring the stability of the accumulated result.
[0051] According to some embodiments, the sequential accumulation of the first processing results corresponding to each computing unit based on the arrangement order of the multiple computing units in the target computing unit group in the ring topology includes: using each computing unit in the multiple computing units to perform the following steps: receiving data to be accumulated from a preceding computing unit located before the computing unit in the ring topology; determining intermediate data by performing an accumulation operation based on the data to be accumulated and the first processing result of the computing unit; and sending the intermediate data to a subsequent computing unit located after the computing unit in the ring topology, so that the subsequent computing unit can perform an accumulation operation based on the intermediate data and the first processing result of the subsequent computing unit. Thus, the data reduction operation of all computing units can be more efficiently implemented based on the ring iterative operation.
[0052] Figure 3 FIG. 3 shows a schematic diagram of the structure of a distributed system 300 according to an exemplary embodiment of the present disclosure. Figure 3 As shown, in this example, system 300 includes two processing cores (processing core 311 and processing core 312), four communication interfaces (communication interface 321, communication interface 322, communication interface 323, and communication interface 324), and eight computing units. The dotted double-way arrows in the figure show the first communication link between the processing cores, the dashed double-way arrows show the second communication link between the processing cores and the computing units, and the solid double-way arrows show the third communication link between the computing units. Figure 3 It can be seen from the multiple groups of point-to-point third communication links between the eight computing units that the eight nodes can form the following four groups of unidirectional rings that can be used to perform data accumulation operations:
[0053] One-way ring A: calculation unit 331 - calculation unit 332 - calculation unit 336 - calculation unit 335 - calculation unit 337 - calculation unit 338 - calculation unit 334 - calculation unit 333;
[0054] One-way ring B: calculation unit 333—calculation unit 334—calculation unit 338—calculation unit 337—calculation unit 335—calculation unit 336—calculation unit 332—calculation unit 331;
[0055] One-way loop C: calculation unit 331—calculation unit 335—calculation unit 338—calculation unit 336—calculation unit 337—calculation unit 333—calculation unit 332—calculation unit 334;
[0056] One-way loop D: calculation unit 334 — calculation unit 332 — calculation unit 333 — calculation unit 337 — calculation unit 336 — calculation unit 338 — calculation unit 335 — calculation unit 331 .
[0057] It can be understood that when the interconnection structure between multiple computing units has been determined, multiple unidirectional ring topologies in the system can be determined based on various existing detection tools or analysis algorithms, and then saved as explicit topology information, so that it can be directly applied when executing method 200 described in the present disclosure.
[0058] In some examples, the processing core may be a CPU (Central Processing Unit), the computing node may be a GPU (Graphics Processing Unit), the first communication link may be a QPI (Quick Path Interconnect) link, the second communication link may be a PCI (Peripheral Component Interconnect) link, and the third communication link may be a point-to-point communication link based on NVLink.
[0059] As mentioned above, conventional technology usually dynamically distributes data exchange and accumulation tasks based on the load conditions of multiple ring topologies. For example, the data to be processed in the same batch (batch size parameter batch_size is a variable parameter) can be evenly distributed to multiple ring topologies based on the data scale. In this case, when a certain accumulation operation in a data processing request A with a data scale of 8192 and a certain accumulation operation in a data processing request B with a data scale of 8192 are merged into the same batch (i.e., batch_size=2), the first 4096 data of the data processing request A may be distributed to the unidirectional ring A, that is, the node data accumulation is performed according to the node arrangement order in the unidirectional ring A, and the next 4096 data may be distributed to the unidirectional ring B, that is, the node data accumulation is performed according to the node arrangement order in the unidirectional ring B. When the accumulation operation in the data processing request A is placed in a batch (i.e., batch_size=1), the 8192 data of the data processing request A may be evenly distributed to the above four unidirectional rings, and each unidirectional ring is responsible for processing 2048 data. It can be seen that in this implementation, the accumulation order of the data elements contained in the data processing request A in the accumulation operation may change, which may lead to unstable calculation results.
[0060] In one example, when the size of the input data to be processed is 8, the data to be processed can be segmented and distributed to multiple computing unit groups for processing. When the number of computing unit groups in the distributed system is 2, the size of the first segmentation result based on the segmentation of the data to be processed is 4.
[0061] On this basis, each computing unit group can utilize multiple steps of operation to process the first segmentation result of the computing unit group. Figure 4 FIG. 1 is a schematic diagram showing a data processing process according to an exemplary embodiment of the present disclosure. Figure 4 As shown, two computing unit groups consisting of computing unit 0, computing unit 1, computing unit 2, and computing unit 3 can implement data accumulation based on circular iterative steps, and each computing unit performs transmission and accumulation for the second segmentation result of size 1 in each step. Figure 4 That is, a schematic diagram of the transmission process of the first step is shown. In this case, the cumulative result obtained by the computing unit group A is [a0+b0+c0+d0, b1+c1+d1+a1, c2+d2+a2+b2, d3+a3+b3+c3], and the cumulative result obtained by the computing unit group B is [d4+a4+b4+c4, c5+d5+a5+b5, b6+c6+d6+a6, a7+b7+c7+d7].
[0062] In this example, assuming that the length of each data processing request is 4, the input data to be processed contains 2 data processing requests (for example, data processing request query0 of computing unit 0 = [a0, a1, a2, a3], data processing request query1 = [a4, a5, a6, a7]), and the 2 data processing requests are respectively assigned to computing unit group A and computing unit group B for processing. It can be seen that the data accumulation order of computing unit group A and computing unit group B is different, which may lead to different processing results of different data processing requests.
[0063] In another example, assuming that the length of each data processing request is 2, the input data to be processed contains 4 data processing requests, and each computing unit group is responsible for processing 2 data processing requests (for example, the data processing request query0 corresponding to computing unit group A in computing unit 0 is [a0, a1,], and the data processing request query1 is [a2, a3]). It can be seen that the different starting positions of different data processing requests in the segmentation results of the same computing unit group will also lead to different data accumulation orders, which may lead to different processing results of different data processing requests.
[0064] Figure 5 FIG. 1 is a schematic diagram showing a data processing process according to an exemplary embodiment of the present disclosure. Figure 5 As shown, in this example, by applying the data segmentation and computing power allocation method described in the above method 200, the data block in the data to be processed can be used as the minimum segmentation unit. For example, when the data block size is 8 and the number of computing unit groups is 2, two first sub-blocks [a0, a1, a2, a3] and [a4, a5, a6, a7] can be obtained, and the two first sub-blocks are respectively allocated to computing unit group A and computing unit group B for processing. In this case, no matter how many data blocks are included in the data processing request, the computing power allocation method and data processing logic corresponding to each data element can remain stable.
[0065] In one example, Figure 5 The data processing process can be implemented based on the following steps:
[0066] Step S1, sequentially divide each data block into a first number (i.e., the number of computing unit groups) of first sub-blocks, and assign each first sub-block to a computing unit group for processing;
[0067] Step S2, sequentially divide each first sub-block into a second number (i.e., the number of computing units in the computing unit group) of second sub-blocks;
[0068] Step S3, traversing all data blocks in each computing unit, selecting a second sub-block from the first sub-block corresponding to the computing unit group and sending it to the subsequent computing unit in the computing unit group. It can be understood that the arrangement sequence numbers of the second sub-blocks selected by each computing unit are different from each other;
[0069] By cyclically executing the above step S3, each computing unit in each computing unit group can receive data from the previous computing unit in the computing unit group in each round, perform accumulation calculation with the corresponding data of the computing unit, and then send the accumulation result to the subsequent computing unit in the computing unit group. When the circular iteration step is completed, each computing unit in each computing unit group has the data accumulation result of all computing units in the computing unit group.
[0070] According to some embodiments, the data to be processed is obtained using a feature encoding network, and wherein the data to be processed includes a plurality of data blocks obtained using the following division operation: based on the output dimension of the feature encoding network, the data to be processed is divided into a plurality of data blocks of the same size. Thus, the above method 200 can be applied to implement feature data processing, and by determining the data blocks in the data to be processed based on the dimension of the feature encoding vector space, a fixed-size data block can be obtained more simply and efficiently, and the computational load of each computing unit group in the distributed system can be balanced, thereby improving processing efficiency.
[0071] In some examples, the data to be processed can be obtained by embedding natural language text data. By operating on the encoded data of the text data, various types of natural language processing tasks can be achieved. For example, the natural language text data can be mapped to the embedding space to obtain the semantic feature tensor, and then semantic analysis, entity extraction and other operations are performed based on this. It can be understood that the data length of the semantic feature tensor in the embedding space must be an integer multiple of the dimension of the embedding space. In this case, by dividing the data blocks of the data to be processed based on the dimension of the embedding space, the data to be processed can be simply and efficiently divided into an integer number of data blocks, and then by performing data segmentation and computing power allocation operations on the data blocks to ensure the stability of the distributed processing logic of each data block, thereby ensuring the stability of the calculation results for the data to be processed.
[0072] According to some embodiments, dividing the data to be processed into multiple data blocks of the same size based on the output dimension of the feature encoding network includes: dividing the data to be processed into multiple data blocks of the same size based on the output dimension of the feature encoding network and the data format of the data to be processed. Thus, the data volume of each data block can be accurately determined in combination with the data format, the computing load of each computing unit group in the distributed system can be balanced, and the processing efficiency can be improved.
[0073] According to one aspect of the present disclosure, a data processing device applied to a distributed system is also provided. Figure 6 FIG. 6 shows a structural block diagram of a data processing device 600 applied to a distributed system according to an exemplary embodiment of the present disclosure, wherein a plurality of computing units in the distributed system can constitute a plurality of computing unit groups, and the data to be processed includes a plurality of data blocks. Figure 6 As shown, the device 600 includes:
[0074] A first division unit 601 is configured to divide each data block of the plurality of data blocks into a plurality of first sub-blocks respectively corresponding to the plurality of computing unit groups;
[0075] A second division unit 602 is configured to divide each first sub-block of the plurality of first sub-blocks into a plurality of second sub-blocks respectively corresponding to a plurality of computing units in the target computing unit group based on the target computing unit group corresponding to the data block;
[0076] A first processing unit 603 is configured to determine a plurality of first processing results respectively output by the plurality of computing units by processing the second sub-block using a computing unit corresponding to each second sub-block; and
[0077] The second processing unit 604 is configured to determine a processing result of the data block by using the target computing unit group to perform a data reduction operation on the plurality of first processing results.
[0078] According to some embodiments, the multiple computing units in the target computing unit group form a ring topology, and the second processing unit 604 includes: an accumulation subunit, configured to accumulate the first processing result of each computing unit in sequence based on the arrangement order of the multiple computing units in the target computing unit group in the ring topology; and a determination subunit, configured to determine the processing result of the data block based on the accumulation result.
[0079] According to some embodiments, the accumulation subunit is configured to perform the following steps using each of the multiple computing units: receiving data to be accumulated from a preceding computing unit that is located before the computing unit in the ring topology; determining intermediate data by performing an accumulation operation based on the data to be accumulated and a first processing result of the computing unit; and sending the intermediate data to a subsequent computing unit that is located after the computing unit in the ring topology, so that the subsequent computing unit can perform an accumulation operation based on the intermediate data and the first processing result of the subsequent computing unit.
[0080] According to some embodiments, the data to be processed is obtained using a feature encoding network, and wherein the multiple data blocks included in the data to be processed are obtained using the following division operation: based on the output dimension of the feature encoding network, the data to be processed is divided into multiple data blocks of the same size.
[0081] According to some embodiments, the multiple data blocks included in the data to be processed are obtained using the following division operation: based on the output dimension of the feature encoding network and the data format of the data to be processed, the data to be processed is divided into multiple data blocks of the same size.
[0082] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned data processing method.
[0083] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned data processing method.
[0084] According to another aspect of the present disclosure, a computer program product is further provided, including a computer program, wherein the computer program implements the above data processing method when executed by a processor.
[0085] refer to Figure 7 , a block diagram of an electronic device 700 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0086] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0087] A plurality of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the device 700, the input unit 706 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device, and may include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 707 may be any type of device capable of presenting information, and may include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 708 may include but is not limited to a disk, an optical disk. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0088] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).
[0089] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0090] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0091] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0092] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0093] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0094] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0095] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0096] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples. Various elements in the embodiments or examples may be omitted or may be replaced by their equivalent elements. In addition, each step may be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that with the evolution of technology, many elements described herein may be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A data processing method applied to a distributed system, in, The plurality of computing units in the distributed system can constitute a plurality of computing unit groups, the data to be processed includes a plurality of data blocks, and the method includes: For each data block in the plurality of data blocks, Dividing the data block into a plurality of first sub-blocks respectively corresponding to the plurality of computing unit groups; Based on the target computing unit group corresponding to the data block, each first sub-block of the plurality of first sub-blocks is divided into a plurality of second sub-blocks respectively corresponding to the plurality of computing units in the target computing unit group; Determine a plurality of first processing results respectively output by the plurality of computing units by processing the second sub-block using the computing unit corresponding to each second sub-block; and The processing result of the data block is determined by performing a data reduction operation on the plurality of first processing results using the target computing unit group.
2. The method according to claim 1, in, The plurality of computing units in the target computing unit group form a ring topology, and determining the processing result of the data block by using the target computing unit group to perform a data reduction operation on the plurality of first processing results includes: Based on the arrangement order of the plurality of computing units in the target computing unit group in the ring topology, sequentially accumulating the first processing result of each computing unit; and The processing result of the data block is determined based on the accumulated result.
3. The method according to claim 2, in, The step of sequentially accumulating the first processing result corresponding to each computing unit based on the arrangement order of the plurality of computing units in the target computing unit group in the ring topology comprises: Each of the plurality of computing units is used to perform the following steps: receiving data to be accumulated from a preceding computing unit located before the computing unit in the ring topology; Determine intermediate data by performing an accumulation operation based on the data to be accumulated and the first processing result of the calculation unit; and The intermediate data is sent to a subsequent computing unit located after the computing unit in the ring topology, so that the subsequent computing unit can perform an accumulation operation based on the intermediate data and a first processing result of the subsequent computing unit.
4. The method according to any one of claims 1 to 3, in, The data to be processed is obtained by using a feature encoding network, and wherein the data to be processed includes a plurality of data blocks obtained by using the following division operation: based on an output dimension of the feature encoding network, the data to be processed is divided into a plurality of data blocks of the same size.
5. The method according to claim 4, in, Based on the output dimension of the feature encoding network, dividing the data to be processed into multiple data blocks of the same size includes: based on the output dimension of the feature encoding network and the data format of the data to be processed, dividing the data to be processed into multiple data blocks of the same size.
6. A data processing device for a distributed system, in, The plurality of computing units in the distributed system can constitute a plurality of computing unit groups, the data to be processed includes a plurality of data blocks, and the device includes: A first division unit is configured to divide each data block of the plurality of data blocks into a plurality of first sub-blocks respectively corresponding to the plurality of computing unit groups; A second division unit is configured to divide each first sub-block of the plurality of first sub-blocks into a plurality of second sub-blocks respectively corresponding to a plurality of computing units in the target computing unit group based on the target computing unit group corresponding to the data block; A first processing unit configured to determine a plurality of first processing results respectively output by the plurality of computing units by processing the second sub-block using a computing unit corresponding to each second sub-block; and The second processing unit is configured to determine a processing result of the data block by performing a data reduction operation on the plurality of first processing results using the target computing unit group.
7. The device according to claim 6, in, The plurality of computing units in the target computing unit group form a ring topology, and the second processing unit includes: an accumulation subunit configured to accumulate the first processing result of each computing unit in sequence based on the arrangement order of the plurality of computing units in the target computing unit group in the ring topology; and The determination subunit is configured to determine a processing result of the data block based on the accumulation result.
8. The device according to claim 7, in, The accumulation subunit is configured to use each of the plurality of computing units to perform the following steps: receiving data to be accumulated from a preceding computing unit located before the computing unit in the ring topology; Determine intermediate data by performing an accumulation operation based on the data to be accumulated and the first processing result of the calculation unit; as well as The intermediate data is sent to a subsequent computing unit located after the computing unit in the ring topology, so that the subsequent computing unit can perform an accumulation operation based on the intermediate data and a first processing result of the subsequent computing unit.
9. The device according to any one of claims 6 to 8, in, The data to be processed is obtained by using a feature encoding network, and wherein the data to be processed includes a plurality of data blocks obtained by using the following division operation: based on an output dimension of the feature encoding network, the data to be processed is divided into a plurality of data blocks of the same size.
10. The device according to claim 9, in, The multiple data blocks included in the data to be processed are obtained by using the following division operation: based on the output dimension of the feature encoding network and the data format of the data to be processed, the data to be processed is divided into multiple data blocks of the same size.
11. An electronic device, include: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to make a computer execute the method according to any one of claims 1-5.
13. A computer program product comprising a computer program, in, The computer program implements the method according to any one of claims 1 to 5 when executed by a processor.
