Data processing device and method, electronic equipment and storage medium

By utilizing the forward and backward processing synchronization mechanism between the first computing unit and the second computing unit in the data processing device, the problem of difficulty in parallel operation of the matrix computing unit and the general computing unit is solved, and the processing of the artificial intelligence chip is improved. efficiency.

CN118607601APending Publication Date: 2024-09-06KUNLUNXIN TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410823080.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

In the dynamic graph mode, it is difficult for the matrix computing unit and the general computing unit to run efficiently in parallel, resulting in low processing efficiency of the artificial intelligence chip.

Method used

By providing a data processing device, the first computing unit is used to perform forward processing on the first currently to-be-processed data, and the results are provided to the second computing unit, so that the second computing unit can simultaneously perform backward processing, thereby realizing a matrix computing unit. Efficient parallelism with general-purpose computing units.

Benefits of technology

Make full use of the computing resources of different computing units to improve data processing efficiency, achieve efficient parallelization of matrix computing units and general computing units, and improve the processing efficiency of artificial intelligence chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607601A
    Figure CN118607601A
Patent Text Reader

Abstract

The invention provides a data processing device, and relates to the technical field of artificial intelligence, in particular to the technical field of chips and the technical field of deep learning frameworks. According to the specific implementation scheme, a first calculation unit is configured to perform first current forward processing on first current to-be-processed data to obtain a first current processing result, and the first current to-be-processed data corresponds to target input sub-data in multiple input sub-data of input data; the second calculation unit is configured to perform second current forward processing on second current to-be-processed data synchronously with the first current forward processing to obtain a second current processing result, and the second current to-be-processed data corresponds to input sub-data except the target input sub-data in the multiple input sub-data; and providing the second current processing result to the first calculation unit. The invention further provides a data processing method, electronic equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of chip technology and the field of deep learning framework technology. More specifically, the present disclosure provides a data processing device, method, electronic device and storage medium. Background Art

[0002] With the development of artificial intelligence technology, artificial intelligence chips can include different computing units. Different computing units can include matrix computing units and general computing units. Summary of the invention

[0003] The present disclosure provides a data processing apparatus, method, device and storage medium.

[0004] According to one aspect of the present disclosure, a data processing device is provided, which includes: a first computing unit, configured to: perform a first current forward processing on a first current data to be processed to obtain a first current processing result, wherein the first current data to be processed corresponds to a target input sub-data among multiple input sub-data of the input data; a second computing unit, configured to: perform a second current forward processing on a second current data to be processed synchronously with the first current forward processing to obtain a second current processing result, wherein the second current data to be processed corresponds to input sub-data other than the target input sub-data among the multiple input sub-data; and provide the second current processing result to the first computing unit so that: synchronously with the second computing unit performing a second subsequent forward processing on a second subsequent data to be processed of the second current data to be processed, the first computing unit performs a first subsequent forward processing on a first subsequent data to be processed of the first current data to be processed, the second subsequent data to be processed being determined based on the first current processing result, and the first subsequent processing being determined based on the second current processing result.

[0005] According to another aspect of the present disclosure, a data processing method is provided, the method comprising: using a first computing unit to perform a first current forward processing on a first current data to be processed to obtain a first current processing result, wherein the first current data to be processed corresponds to a target input sub-data among multiple input sub-data of the input data; using a second computing unit to perform a second current forward processing on a second current data to be processed synchronously with the first current forward processing to obtain a second current processing result, wherein the second current data to be processed corresponds to input sub-data other than the target input sub-data among the multiple input sub-data; using the second computing unit to provide the second current processing result to the first computing unit, so that: synchronously with the second computing unit performing a second subsequent forward processing on a second subsequent data to be processed of the second current data to be processed, the first computing unit performs a first subsequent forward processing on a first subsequent data of the first current data to be processed, the second subsequent data to be processed being determined based on the first current processing result, and the first subsequent data to be processed being determined based on the second current processing result.

[0006] According to another aspect of the present disclosure, an electronic device is provided, including the data processing device provided by the present disclosure.

[0007] 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 execute the method provided according to the present disclosure.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.

[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided according to the present disclosure is implemented.

[0010] 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

[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0012] Figure 1 is a schematic diagram of a deep learning model according to an embodiment of the present disclosure;

[0013] Figure 2is a schematic block diagram of a data processing device according to an embodiment of the present disclosure;

[0014] Figure 3 is a schematic diagram of forward processing of a data processing device according to an embodiment of the present disclosure;

[0015] Figure 4 is a schematic diagram of reverse processing of a data processing device according to an embodiment of the present disclosure;

[0016] Figure 5 is a flow chart of a data processing method according to an embodiment of the present disclosure;

[0017] Figure 6 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure; and

[0018] Figure 7 is a block diagram of an electronic device to which a data processing method can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] 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 and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0020] Artificial intelligence chips can be graphics processing units (GPUs), neural network processing units (NPUs), Kunlun cores and other chips. Artificial intelligence chips can include different computing units. Different computing units can include matrix computing units and general computing units. Matrix computing units can efficiently perform multiplication and accumulation operations. General computing units can perform operations such as addition, subtraction, and multiplication of vectors. General computing units can also be called vector computing units. For example, a matrix computing unit can be a tensor computing unit (tensor core). The general computing unit can be a computing unit based on the Compute Unified Device Architecture (CUDA).

[0021] Multiple different computing units can realize the reasoning of deep learning models. Figure 1 The model is described below.

[0022] Figure 1 is a schematic diagram of a deep learning model according to an embodiment of the present disclosure.

[0023] like Figure 1As shown, the model M100 may include an attention module Att100 and a feedforward module FFN100. The attention module Att100 may include a first normalization operator op1201, a first communication operator op1202, a conversion operator op111, a first rotation position encoding operator op1203, a second rotation position encoding operator op1204, an attention fusion operator op112, a first fully connected operator op113, a second communication operator op1205, and a first fusion operator op1206. The first normalization operator op1201 may, for example, implement root mean square normalization (Root Mean Square layer Normalization, RMS-Norm). The first communication operator op1202 may implement an all-gather operation. The conversion operator op111 may determine the query feature (Q), the key feature (K), and the value feature (V) according to the query matrix (Wq), the key matrix (Wk), and the value matrix (Wv). The first rotation position encoding operator op1203 can perform rotation position encoding on the query feature to obtain the query encoding feature. The second rotation position encoding operator op1204 can perform rotation position encoding on the key feature to obtain the key encoding feature. The attention fusion operator op112 can implement attention fusion based on the query encoding feature, the key encoding feature and the value feature. The first full connection operator op113 can implement full connection processing. The second communication operator op1205 can, for example, implement a reduce scatter operation. The first fusion operator op1206 can, for example, add the input data and the output of the second communication operator op1205. It can be understood that the first normalization operator op1201 can also implement various normalization operations such as layer normalization. The first communication operator op1202 and the second communication operator op1206 can also implement other communications (such as all-reduce operations). The first fusion operator op1205 can also implement various fusion operations such as splicing and multiplication.

[0024] The feed-forward module FFN100 can be constructed based on a feed-forward neural network (FFN). The feed-forward module FFN100 may include a second normalization operator op1207, a third communication operator op1208, a second fully connected operator op114, an activation operator op1209, a third fully connected operator op115, a fourth communication operator op1210, and a second fusion operator op1211. The second normalization operator op1207 can, for example, implement root mean square normalization. The third communication operator op1208 can implement a full collection operation. The second fully connected operator op114 can implement a fully connected process. The activation operator op1209 can implement an activation operation based on an activation function. The activation function can, for example, be a swish gated linear unit (swiglu) function. The fourth communication operator op1210 can, for example, implement a dispersed reduction operation. The second fusion operator op1211 can, for example, add the output of the first fusion operator op1205 and the output of the second communication operator op1210. It can be understood that the second normalization operator op1207 can also implement various normalization operations such as layer normalization. The third communication operator op1208 and the fourth communication operator op1210 can also implement other communications. The second fusion operator op1211 can also implement various fusion operations such as splicing and multiplication. The activation function of the activation operator op1209 can also be other activation functions.

[0025] The above-mentioned general computing unit can be used to perform operations corresponding to the first normalization operator op1201, the first communication operator op1202, the first rotation position encoding operator op1203, the second rotation position encoding operator op1204, the second communication operator op1205, the first fusion operator op1206, the second normalization operator op1207, the third communication operator op1208, the activation operator op1209, the fourth communication operator op1210 and the second fusion operator op1211. The above-mentioned matrix computing unit can be used to perform operations corresponding to the conversion operator op111, the attention fusion operator op112, the first fully connected operator op113, the second fully connected operator op114, and the third fully connected operator op115.

[0026] In some embodiments, the reasoning of the deep learning model can be realized based on the dynamic graph mode or the static graph mode. However, in the dynamic graph mode, it is difficult for computing units of different structures to reason in parallel efficiently, resulting in low processing efficiency of the artificial intelligence chip. Figure 1 As shown, the matrix calculation unit needs to wait for the general computing unit to complete the operation corresponding to the first communication operator OP1202 before it can execute the operation corresponding to the first fully connected operator OP111. It is difficult for the matrix calculation unit and the general computing unit to run in parallel efficiently.

[0027] Therefore, in order to achieve efficient parallelism between the matrix computing unit and the general computing unit, the present disclosure provides a data processing device, which will be described below.

[0028] Figure 2 is a schematic block diagram of a data processing device according to an embodiment of the present disclosure.

[0029] like Figure 2 As shown, the apparatus 200 may include a first computing unit 210 and a second computing unit 220 .

[0030] The first computing unit 210 may be configured to perform a first current forward processing on the first current data to be processed to obtain a first current processing result.

[0031] In an embodiment of the present disclosure, the first current data to be processed may correspond to target input sub-data among multiple input sub-data of the input data. For example, the input data may be a matrix of M×N×K. Based on at least one of M and N, the input data may be split. The split operation may be performed by the data handling unit, or by the first computing unit 210, the second computing unit 220 or other computing units, which is not limited by the present disclosure. The first current data to be processed may be an intermediate result corresponding to the target input data.

[0032] In the embodiment of the present disclosure, there may be one or more first computing units 210. Multiple first computing units may process the same first current data to be processed, or may respectively process different first current data to be processed.

[0033] In the embodiment of the present disclosure, the first current forward processing may correspond to one or more operators of the deep learning model. For example, the first current forward processing may correspond to the above-mentioned conversion operator op111, or may correspond to the attention fusion operator op112 and the first fully connected operator op113.

[0034] The first computing unit 210 may also be configured to provide the first current processing result to the second computing unit 220 .

[0035] The second calculation unit 220 may be configured to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result.

[0036] In the embodiment of the present disclosure, the second current data to be processed may correspond to the input sub-data other than the target input sub-data among the plurality of input sub-data, and the second current data to be processed may be an intermediate result corresponding to the input sub-data.

[0037] In the embodiment of the present disclosure, there may be one or more second computing units. The multiple second computing units may process the same second current data to be processed, or may respectively process multiple different second current data to be processed.

[0038] In the embodiment of the present disclosure, the second current forward processing may correspond to one or more operators of the deep learning model. For example, the second current forward processing may correspond to the first normalization operator op1201 described above, or may correspond to the first rotation position encoding operator op1203 and the second rotation position encoding operator op1204. For example, synchronously with the operation of executing the conversion operator op111, the second computing unit 120 may execute the operations of the first normalization operator op1201 and the first communication operator op1202.

[0039] The second computing unit 220 may also be configured to provide the second current processing result to the first computing unit 210. Thus, synchronously with the second computing unit 220 performing the second subsequent forward processing on the second current data to be processed, the first computing unit 110 may perform the first subsequent forward processing on the first current data to be processed.

[0040] In the embodiment of the present disclosure, the second subsequent data to be processed is determined according to the first current processing result. For example, the second subsequent data to be processed can be determined according to the result obtained by performing the operation corresponding to the conversion operator op111. The second subsequent data to be processed can correspond to the target input sub-data. Based on the second subsequent data to be processed, the second calculation unit 220 can perform operations corresponding to the first rotation position encoding operator op1203 and the second rotation position encoding operator op1204.

[0041] In the embodiment of the present disclosure, the first subsequent data to be processed is determined according to the second current processing result. For example, the first subsequent data to be processed can be determined according to the result obtained by performing the operation corresponding to the first normalization operator op1201 and the first communication operator op1202. The first subsequent data to be processed can correspond to input sub-data other than the target input sub-data. Based on the first subsequent data to be processed, the first computing unit 210 can again perform the operation corresponding to the conversion operator op111.

[0042] Through the embodiments of the present disclosure, while the first computing unit processes the intermediate result corresponding to one input sub-data, the second computing unit can process the intermediate result corresponding to another input sub-data. In addition, while the second computing unit processes the intermediate result corresponding to one input sub-data, the first computing unit can process the intermediate result corresponding to another input sub-data. Thus, efficient parallelism of the first computing unit and the second computing unit is achieved, which can fully improve the data processing efficiency of the data processing device and effectively utilize the computing resources of different computing units.

[0043] It can be understood that the above describes the device of the present disclosure, and the device of the present disclosure will be further described below in combination with a deep learning model.

[0044] Figure 3 It is a schematic diagram of forward processing of a data processing device according to an embodiment of the present disclosure.

[0045] like Figure 3 As shown, the first computing unit 310 and the second computing unit 320 can perform operations corresponding to the above-mentioned model M100. It can be understood that the model M100 is only an example, and the device disclosed in the present invention can be used to perform operations of various deep learning models.

[0046] In some embodiments, the plurality of input sub-data may include first input sub-data and second input sub-data.

[0047] In some embodiments, the second computing unit may also be configured to: normalize the first input sub-data to obtain first normalized data; perform communication based on the first normalized data to obtain a first communication result; and provide the first communication result to the first computing unit. Figure 3 As shown, in the starting time period t0, the first input sub-data can be used as the second current data to be processed. The second calculation unit 320 can perform the second current forward processing on the first input sub-data. In the starting time period t0, the second current forward processing can include: normalization and communication. For example, the second calculation unit 320 can perform operation f12011 on the first input sub-data to perform normalization and obtain first normalized data. The second calculation unit 320 can also perform operation f12021 based on the first normalized data to communicate with other data processing devices, obtain a first communication result, and provide the first communication result to the first calculation unit 310. Thus, the forward processing in the starting time period t0 is completed, and the forward processing of the first time period t1 will be performed below.

[0048] In some embodiments, in the first time period, the first current data to be processed includes the first communication result. The first current forward processing includes conversion processing. The first computing unit can be configured to perform the following operations to perform the first current forward processing on the first current data to be processed to obtain the first current processing result: according to the query matrix, the value matrix and the key matrix, the first communication result is converted to obtain a first conversion result as the first current processing result. The first conversion result includes a first query feature, a first value feature and a first key feature. Figure 3 As shown, in the first time period t1, according to the query matrix, the value matrix and the key matrix, the first computing unit 310 can perform operation f1111 to convert the first communication result to obtain a first conversion result including the first query feature, the first key feature and the first value feature. The first conversion result can be provided to the second computing unit 320.

[0049] In some embodiments, in the first time period, the second current data to be processed may include second input sub-data. The second current forward processing may include normalization and communication. The second computing unit may also be configured to perform the following operations to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: normalize the second input sub-data synchronously with the first computing unit performing the conversion processing on the first communication result to obtain second normalized data. Perform communication based on the second normalized data to obtain a second communication result as the second current processing result. Figure 3 As shown, the second computing unit 320 can perform operation f32012 on the second input sub-data to perform normalization and obtain second normalized data. The second computing unit 320 can also perform operation f32022 based on the second normalized data to communicate with other data processing devices to obtain a second communication result, and provide the second communication result to the first computing unit 310. It can be understood that in the first time period t1, operation f32012 and operation f32022 are performed synchronously with operation f3111. Operation f32011 and operation f32012 can correspond to the above-mentioned first normalization operator op1201. Operation f32021 and operation f32022 can correspond to the above-mentioned first communication operator op1202. Through the embodiment of the present disclosure, the first computing unit can perform the conversion operation synchronously with the second computing unit performing the normalization and communication operation, and can further realize the parallelism of different computing units to make full use of different computing resources.

[0050] Thus, the forward processing in the first time period t1 is completed, and the forward processing in the second time period t2 will be performed next.

[0051] In some embodiments, in a second time period after the first time period, the first current data to be processed includes a second communication result. The first computing unit is further configured to perform the following operations to perform a first current forward processing on the first current data to be processed to obtain a first current processing result: according to the query matrix, the value matrix and the key matrix, the second communication result is converted to obtain a second conversion result as the first current processing result. The second conversion result includes a second query feature, a second value feature and a second key feature. Figure 3 As shown, in the second time period t2, according to the query matrix, the value matrix and the key matrix, the first computing unit 310 can perform operation f1112 to convert the second communication result to obtain a second conversion result including a second query feature, a second key feature and a second value feature. The second conversion result can be provided to the second computing unit 320.

[0052] In some embodiments, in the second period, the second current data to be processed may include the first query feature and the first key feature. For example, the first query feature and the first key feature may be determined from the first conversion result as the second current data to be processed in the second period.

[0053] In some embodiments, in the second time period, the second current forward processing includes rotation position encoding. The second computing unit is further configured to perform the following operations to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: synchronously with the first computing unit performing the conversion processing on the second communication result, respectively perform rotation position encoding on the first query feature and the first key feature to obtain a first encoding result as the second current processing result. The first encoding result includes the first query encoding feature and the first key encoding feature. Figure 3 As shown, in the second time period t2, the second computing unit 320 can perform operation f32031 to perform a first rotational position encoding on the first query feature to obtain a first query encoding feature. The second computing unit 320 can also perform operation f32041 to perform a second rotational position encoding on the first key feature to obtain a first key encoding feature. The first query encoding feature and the first key encoding feature can be provided to the first computing unit 310. It can be understood that in the second time period t2, operations f32031 and f32041 are performed synchronously with operation f3112. Operations f3111 and f3112 can correspond to the above-mentioned conversion operator op111. Through the embodiments of the present disclosure, the first computing unit can perform the conversion operation synchronously with the second computing unit performing the rotational position encoding operation, and the parallelism of different computing units can be further realized to make full use of different computing resources.

[0054] Thus, the forward processing in the second time period t2 is completed, and the forward processing in the third time period t3 will be performed next.

[0055] In some embodiments, in a third time period after the second time period, the first current data to be processed includes a first encoding result and a first value feature. The first current forward processing includes attention fusion processing and a first full connection processing. The first computing unit can also be configured to perform the following operations to perform the first current forward processing on the first current data to be processed to obtain a first current processing result: based on the attention mechanism, perform attention fusion processing on the first query encoding feature, the first key encoding feature and the first value feature to obtain a first attention feature. Perform a first full connection processing on the first attention feature to obtain a first processed attention feature as the first current processing result. Figure 3 As shown, in the third time period t3, for example, based on the multi-head self-attention mechanism, the first computing unit 310 can perform operation f3121 to perform attention fusion processing on the first query encoding feature, the first key encoding feature and the first value feature to obtain a first attention feature. Next, the first computing unit can also perform operation f3131 to perform a first full connection processing on the first attention feature to obtain a first processed attention feature, and provide the first processed attention feature to the second computing unit 320.

[0056] In some embodiments, in the third period, the second current data to be processed includes the second query feature and the second key feature. For example, the second query feature and the second key feature can be determined from the second conversion result as the second current data to be processed in the third period.

[0057] In some embodiments, the second current forward processing may include rotational position encoding. The second computing unit is also configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: synchronously with the first computing unit performing attention fusion processing on the first query encoding feature, the first key encoding feature and the first value feature, respectively perform rotational position encoding on the second query feature and the second key feature to obtain a second encoding result as the second current processing result. The second encoding result includes the second query encoding feature and the second key encoding feature. Figure 3As shown, in the third time period t3, the second computing unit 320 can perform operation f32032 to perform a first rotation position encoding on the second query feature to obtain a second query encoding feature. The second computing unit 320 can also perform operation f32042 to perform a second rotation position encoding on the second key feature to obtain a second key encoding feature. The second query encoding feature and the second key encoding feature can be provided to the first computing unit 310. It can be understood that in the third time period t3, operation f32032 and operation f32042 are performed synchronously with operation f3121 and operation f3131. Operation f32031 and operation f32032 can correspond to the above-mentioned first rotation position encoding operator op1203. Operation f32041 and operation f32042 can correspond to the above-mentioned second rotation position encoding operator op1204. Through the embodiment of the present disclosure, the attention fusion and full connection operations performed by the first computing unit can be synchronized with the rotation position encoding operation performed by the second computing unit, and the parallelism of different computing units can be further realized to make full use of different computing resources.

[0058] Thus, the forward processing in the third time period t3 is completed, and the forward processing in the fourth time period t4 will be performed next.

[0059] In some embodiments, in a fourth time period after the third time period, the first current data to be processed includes a second encoding result and a second value feature, and the first current forward processing includes an attention fusion process and a first full connection process. The first computing unit is also configured to perform the following operations to perform the first current forward processing on the first current data to be processed to obtain a first current processing result: Based on the attention mechanism, an attention fusion process is performed on the second query encoding feature, the second key encoding feature, and the second value feature to obtain a second attention feature. The second attention feature is subjected to a first full connection process to obtain a second processed attention feature as the first current processing result. Figure 3 As shown, in the fourth time period t4, for example, based on the multi-head self-attention mechanism, the first computing unit 310 can perform operation f3122 to perform attention fusion processing on the second query encoding feature, the second key encoding feature, and the second value feature to obtain a second attention feature. Next, the first computing unit can also perform operation f3132 to perform a first full connection processing on the second attention feature to obtain a second processed attention feature, and provide the second processed attention feature to the second computing unit 320.

[0060] In some embodiments, in the fourth time period, the second current data to be processed may include the first processed attention feature. The second current forward processing includes communication, first fusion processing and normalization processing. The second computing unit is also configured to perform the following operations to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: synchronously with the first computing unit performing attention fusion processing on the second query encoding feature, the second key encoding feature and the second value feature, communicate based on the first processed attention feature to obtain the first post-communication attention feature. Perform a first fusion processing on the first post-communication attention feature and the first input sub-data to obtain a first fusion result. Normalize the first fusion result to obtain a first normalized fusion result. Communicate based on the first normalized fusion result to obtain the first post-communication fusion result as the second current processing result. Figure 3 As shown, in the fourth time period t4, the second computing unit 320 can perform operation f32051 to communicate based on the first processed attention feature to obtain the first communication attention feature. The second computing unit 320 can also perform operation f32061 to fuse the first input sub-data and the first communication attention feature to obtain a first fusion result. The second computing unit 320 can also perform operation f32071 to normalize the first fusion result to obtain a first normalized fusion result. Next, the second computing unit 320 can also perform operation f32081 to communicate based on the first normalized fusion result to obtain the first communication fusion result. The first communication fusion result can provide the first computing unit 310. It can be understood that in the fourth time period t4, operations f32051, f32061, f32071 and f32081 are performed synchronously with operations f3122 and f3132. Operation f3121 and operation f3132 may correspond to the above-mentioned attention fusion operator op112. Operation f3131 and operation f3132 may correspond to the above-mentioned first fully connected operator op113. Through the disclosed embodiment, the attention fusion and fully connected operations performed by the first computing unit may be synchronized with the communication, fusion, and normalization operations performed by the second computing unit, and the parallelism of different computing units may be further realized to make full use of different computing resources.

[0061] Thus, the forward processing in the fourth period t4 is completed, and the forward processing in the fifth period t5 will be performed below.

[0062] In some embodiments, in a fifth time period after the fourth time period, the first current data to be processed includes a first communication post-fusion result, and the first current forward processing includes a second full-connection processing. The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed to obtain a first current processing result: perform the second full-connection processing on the first communication post-fusion result to obtain a first intermediate full-connection result as the first current processing result. Figure 3 As shown, in the fifth time period t5, the first computing unit 310 may perform operation f3141 to perform a second full connection process on the first communication fusion result to obtain a first intermediate full connection result. The first intermediate full connection result may be provided to the second computing unit 320.

[0063] In some embodiments, in the fifth time period, the second current data to be processed includes a second processed attention feature. The second current forward processing may include communication, a first fusion processing, and a normalization processing. The second computing unit may also be configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: synchronously with the first computing unit performing a second fully connected processing on the first communication fusion result, communicating based on the second processed attention feature to obtain a second communication attention feature. Performing a first fusion processing on the second communication attention feature and the second input sub-data to obtain a second fusion result. Normalizing the second fusion result to obtain a second normalized fusion result. Communicating based on the second normalized fusion result to obtain a second communication fusion result as the second current processing result. Figure 3As shown, in the fifth time period t5, the second computing unit 320 can perform operation f32052 to communicate based on the second processed attention feature to obtain the second communication attention feature. The second computing unit 320 can also perform operation f32062 to fuse the second input sub-data and the second communication attention feature to obtain a second fusion result. The second computing unit 320 can also perform operation f32072 to normalize the second fusion result to obtain a second normalized fusion result. Next, the second computing unit 320 can also perform operation f32082 to communicate based on the second normalized fusion result to obtain a second communication fusion result. The second communication fusion result can provide the first computing unit 310. It can be understood that in the fifth time period t5, operations f32052, operations f32062, operations f32072 and operations f32082 are performed synchronously with operation f3141. Operations f32051 and f32052 can correspond to the above-mentioned second communication operator op1205. Operation f32061 and operation f32062 may correspond to the first fusion operator op1206. Operation f32071 and operation f32072 may correspond to the second normalization operator op1207. Operation f32081 and operation f32082 may correspond to the third communication operator op1208. Through the disclosed embodiment, the full connection operation performed by the first computing unit may be synchronized with the communication, fusion, and normalization operations performed by the second computing unit, and the parallelism of different computing units may be further realized to make full use of different computing resources.

[0064] Thus, the forward processing in the fifth period t5 is completed, and the forward processing in the sixth period t6 will be performed next.

[0065] In some embodiments, in a sixth time period after the fifth time period, the first current data to be processed includes the second communication post-fusion result, and the first current forward processing includes the second full-connection processing. The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed to obtain the first current processing result: perform the second full-connection processing on the second communication post-fusion result to obtain the second intermediate full-connection result as the first current processing result. Figure 3 As shown, in the sixth time period t6, the first computing unit 310 may perform operation f3142 to perform a second full connection process on the second post-communication fusion result to obtain a second intermediate full connection result. The second intermediate full connection result may be provided to the second computing unit 320.

[0066] In some embodiments, in the sixth time period, the second current data to be processed may include the first intermediate full connection result. The second current forward processing includes activation processing. The second computing unit is further configured to perform the following operations to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain the second current processing result: synchronously with the first computing unit performing the second full connection processing on the second communication post-fusion result, perform activation processing on the first intermediate full connection result to obtain the first activation result. Figure 3 As shown, the second computing unit 320 can perform operation f32091 to activate the first intermediate full connection result to obtain a first activation result. The first activation result can be provided to the first computing unit 310. It can be understood that in the sixth time period t6, operation f32091 is performed synchronously with operation f3142. Operation f3141 and operation f32052 can correspond to the above-mentioned second communication operator op1205. Operation f32061 and operation f3142 can correspond to the above-mentioned second full connection operator op114. Through the embodiment of the present disclosure, the full connection operation performed by the first computing unit can be synchronized with the activation operation performed by the second computing unit, and the parallelism of different computing units can be further realized to make full use of different computing resources.

[0067] Thus, the forward processing in the sixth period t6 is completed, and the forward processing in the seventh period t7 will be performed next.

[0068] In some embodiments, in a seventh time period after the sixth time period, the first current data to be processed includes a first activation result, and the first current forward processing includes a third full connection processing. The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed to obtain a first current processing result: perform the third full connection processing on the first activation result to obtain a first full connection result to be communicated as the first current processing result. Figure 3 As shown, in the seventh time period t7, the first computing unit 310 may perform operation f3151 to perform a third full connection process on the second communication fusion result to obtain a first full connection result to be communicated. The first full connection result to be communicated may be provided to the second computing unit 320.

[0069] In some embodiments, in the seventh time period, the second current data to be processed includes a second intermediate full connection result. The second current forward processing includes an activation process. The second computing unit is further configured to perform the following operations to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: synchronously with the first computing unit performing the third full connection processing on the first activation result, perform the activation processing on the second intermediate full connection result to obtain a second activation result. Figure 3As shown, the second computing unit 320 can perform operation f32092 to activate the second intermediate full connection result to obtain a second activation result. The first activation result can be provided to the first computing unit 310. It can be understood that in the seventh time period t7, operation f32092 is performed synchronously with operation f3151. Operation f32091 and operation f32092 can correspond to the above-mentioned second communication operator op1209. Thus, the forward processing in the seventh time period t7 is completed, and the forward processing of the eighth time period t8 will be performed below.

[0070] In some embodiments, in an eighth time period after the seventh time period, the first current data to be processed includes a second activation result, and the first current forward processing includes a third full-connection processing. The first computing unit is also configured to perform the following operations to perform the first current forward processing on the first current data to be processed to obtain a first current processing result: perform the third full-connection processing on the second activation result to obtain a second full-connection result to be communicated as the first current processing result. In the eighth time period t8, the first computing unit 310 may perform operation f3152 to perform the third full-connection processing on the second post-communication fusion result to obtain a second full-connection result to be communicated. The second full-connection result to be communicated may be provided to the second computing unit 320.

[0071] In some embodiments, the second current data to be processed includes the first fully connected result to be communicated. The second current forward processing includes communication and second fusion processing. The second computing unit is also configured to perform the following operations to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain the second current processing result: synchronously with the first computing unit performing the third fully connected processing on the second activation result, communicating based on the first fully connected result to be communicated to obtain the first fully connected result after communication. Perform the second fusion processing on the first fully connected result after communication and the first fusion result to obtain the first output result. Figure 3 As shown, the second computing unit 320 can perform operation f320101 to communicate based on the first fully connected result to be communicated, and obtain the fully connected result after the first communication. The second computing unit 320 can also perform operation f320111 to fuse the fully connected result after the first communication and the first fusion result to obtain the first output result. It can be understood that in the eighth time period t8, operations f320101 and f320111 are performed synchronously with operation f3152. Operations f3151 and f3152 can correspond to the third fully connected operator mentioned above. Through the embodiment of the present disclosure, the fully connected operation performed by the first computing unit can be synchronized with the communication and fusion operations performed by the second computing unit, and the parallelism of different computing units can be further realized to make full use of different computing resources.

[0072] Thus, the forward processing in the eighth period t8 is completed, and the forward processing in the ninth period t9 will be performed next.

[0073] In some embodiments, in a ninth time period after the eighth time period, the second computing unit may be further configured to: perform communication based on the second to-be-communicated full-connection result to obtain a second communication-post-full-connection result. Perform a second fusion process on the second communication-post-full-connection result and the second fusion result to obtain a second output result. Figure 3 As shown, the second computing unit 320 can perform operation f320102 to communicate based on the second fully connected result to be communicated, and obtain the second fully connected result after communication. The second computing unit 320 can also perform operation f320112 to fuse the second fully connected result after communication with the second fusion result to obtain a second output result. It can be understood that operation f320101 and operation f320102 can correspond to the fourth communication operator mentioned above. Operation f320111 and operation f320112 can correspond to the second fusion operator mentioned above. Thus, the forward processing in the ninth time period t9 is completed.

[0074] It can be understood that after executing the first current forward processing of the current period, the first computing unit can also execute the first subsequent forward processing of the subsequent period. For example, after executing the operation f3111 of the first period, the first computing unit can execute the operation f3112 of the second period according to the first subsequent data to be processed (the second communication result).

[0075] It can be understood that after executing the second current forward processing of the current period, the second computing unit can also execute the second subsequent forward processing of the subsequent period. For example, after executing the operation f32022 of the first period, the second computing unit can execute the operation f32031 and the operation f32041 of the second period according to the second subsequent data to be processed (the first conversion result).

[0076] In the embodiment of the present disclosure, the first calculation unit may also be configured to obtain a first post-processing result according to the first post-processing data. For example, if the second time period is the post-time period, the first post-processing result may be the second conversion result.

[0077] In the embodiment of the present disclosure, the second computing unit may also be configured to obtain a second post-processing result according to the second post-processing data. For example, if the second time period is a post-time period, the second post-processing result may include the first query encoding feature and the first key encoding feature.

[0078] It can be understood that the above describes the forward processing of the present disclosure, and the following will describe the reverse processing of the present disclosure.

[0079] In some embodiments, the first computing unit may also be configured to determine the gradient of the weights used in the forward processing according to the loss information.

[0080] In some embodiments, the second computing unit is further configured to: determine the gradients of multiple input sub-data in the forward processing process according to the loss information. The loss information is determined based on at least one of the first post-processing result and the second post-processing result. For example, for the seventh time period t7 mentioned above, the first output result and the second output result can be used as the second post-processing result of the second activation result. According to the first output result and the second output result, the target output result corresponding to the input data can be determined. According to the target output result, the loss information can be determined according to a supervised, semi-supervised or unsupervised training method. Taking supervised training as an example, the loss information can be determined based on the target data result and the label of the input data. The following will be combined with Figure 4 The reverse process is further described.

[0081] Figure 4 It is a reverse processing schematic diagram of a data processing device according to an embodiment of the present disclosure.

[0082] After the loss value is determined, for example, the gradient associated with the second fusion operator and the gradient associated with the fourth communication operator may be determined in sequence using the second computing unit.

[0083] In some embodiments, the second computing unit may also be configured to: determine the gradient of the input sub-data used in the forward processing according to the loss information. Figure 4 As shown, according to the gradient associated with the fourth communication operator, the second computing unit 420 may perform operation b4152 to determine a first gradient of the input sub-data of the third fully connected operator.

[0084] In some embodiments, the first computing unit may be configured to determine the gradient of the weights used in the forward processing according to the loss information.

[0085] In the embodiment of the present disclosure, the first computing unit determines the gradient of the weight used in the forward processing synchronously with the second computing unit determining the gradient of the input sub-data used in the forward processing. Figure 4 As shown, according to the gradient associated with the fourth communication operator, the first computing unit 410 may perform operation b4151 to determine the gradient of the weight of the third fully connected operator. It can be understood that operation b4151 and operation b4152 may be performed synchronously.

[0086] According to the first gradient, the second computing unit 420 may perform operation b4209 to determine a second gradient of the input sub-data of the activation operator. According to the second gradient, the second computing unit 420 may perform operation b4142 to determine a third gradient of the input sub-data of the second fully connected operator. According to the third gradient, the second computing unit 420 may perform operation b4208 to determine a fourth gradient of the input sub-data of the third communication operator. According to the fourth gradient, the second computing unit 420 may perform operation b4207 to determine a fifth gradient of the input sub-data of the second normalization operator.

[0087] like Figure 4 As shown, according to the third gradient, the first computing unit may further perform operation b4141 to determine the gradient of the weight of the second fully connected operator. It can be understood that operation b4141 and operation b4142 may be performed synchronously.

[0088] It can be understood that, during reverse processing, the gradient of the input sub-data of the subsequent operator needs to be determined based on the gradient of the input sub-data of the previous operator. For example, the second gradient of the input sub-data of the activation operator (the subsequent operator in the reverse processing process) is determined based on the first gradient of the input sub-data of the third fully connected operator (the previous operator in the reverse processing process). The gradient of the input sub-data of the subsequent operator may not be determined based on the gradient of the weight of the previous operator. Through the embodiments of the present disclosure, the gradient of the weight is determined by the first computing unit, and the gradient of the input sub-data is determined by the second computing unit, so that the reverse processing of the two computing units can be parallelized, thereby improving the efficiency of the data processing device.

[0089] It can be understood that the above describes the device of the present disclosure, and the following will describe the method of the present disclosure.

[0090] Figure 5 is a schematic flow chart of a data processing method according to an embodiment of the present disclosure.

[0091] like Figure 5 As shown, method 500 may include operations S510 to S530.

[0092] In operation S510, a first current forward processing is performed on first current data to be processed by a first computing unit to obtain a first current processing result.

[0093] In the embodiment of the present disclosure, the first current data to be processed corresponds to target input sub-data among the multiple input sub-data of the input data.

[0094] In operation S520, a second current forward processing is performed on the second current data to be processed synchronously with the first current forward processing by using a second computing unit to obtain a second current processing result.

[0095] In the embodiment of the present disclosure, the second current data to be processed corresponds to input sub-data other than the target input sub-data among the plurality of input sub-data.

[0096] In operation S530, the second current processing result is provided to the first computing unit by using the second computing unit.

[0097] In an embodiment of the present disclosure, based on the second current processing result, the first computing unit performs a first subsequent forward processing on the first subsequent data of the first current data to be processed, synchronously with the second computing unit performing a second subsequent forward processing on the second subsequent data of the second current data to be processed.

[0098] In the embodiment of the present disclosure, the second subsequent data to be processed is determined according to the first current processing result, and the first subsequent data to be processed is determined according to the second current processing result.

[0099] It can be understood that the first calculation unit may be the first calculation unit 210 described above. The second calculation unit may be the second calculation unit 220 described above.

[0100] In some embodiments, method 500 may further include: determining, using the first computing unit, a gradient of a weight used in the forward processing according to the loss information.

[0101] In some embodiments, method 500 may further include: determining, according to the loss information, using a second computing unit, the gradients of a plurality of input sub-data in the forward processing process.

[0102] In some embodiments, the method 500 may further include: using the first computing unit to obtain a first post-processing result based on the first post-processing data. Using the second computing unit to obtain a second post-processing result based on the second post-processing data. The loss information is determined based on at least one of the first post-processing result and the second post-processing result.

[0103] In some embodiments, the plurality of input sub-data include first input sub-data and second input sub-data. Method 500 may further include: using a second computing unit to normalize the first input sub-data to obtain first normalized data. Using the second computing unit to communicate based on the first normalized data to obtain a first communication result. Using the second computing unit to provide the first communication result to the first computing unit.

[0104] In some embodiments, in the first time period, the first current data to be processed includes a first communication result, the first current forward processing includes a conversion process, and the second current forward processing includes normalization and communication. Using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result includes: according to the query matrix, the value matrix and the key matrix, using the first computing unit to perform a conversion process on the first communication result to obtain a first conversion result as the first current processing result. The first conversion result includes a first query feature, a first value feature and a first key feature. Using the second computing unit to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain the second current processing result includes: synchronously with the first computing unit performing the conversion process on the first communication result, using the second computing unit to normalize the second input sub-data to obtain second normalized data. Based on the second normalized data, using the second computing unit to communicate to obtain a second communication result as the second current processing result.

[0105] In some embodiments, in a second time period after the first time period, the first current data to be processed includes a second communication result, and the second current forward processing includes rotational position encoding. Using the first computing unit to perform the first current forward processing on the first current data to be processed, and obtaining the first current processing result includes: according to the query matrix, the value matrix and the key matrix, using the first computing unit to perform conversion processing on the second communication result, and obtaining the second conversion result as the first current processing result. The second conversion result includes a second query feature, a second value feature and a second key feature. Using the second computing unit to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing, and obtaining the second current processing result includes: synchronously with the first computing unit performing conversion processing on the second communication result, using the second computing unit to perform rotational position encoding on the first query feature and the first key feature, respectively, to obtain the first encoding result as the second current processing result. The first encoding result includes a first query encoding feature and a first key encoding feature.

[0106] In some embodiments, in a third period after the second period, the first current data to be processed includes a first encoding result and a first value feature, and the first current forward processing includes an attention fusion process and a first full connection process. The first current forward processing is performed on the first current data to be processed by the first computing unit to obtain the first current processing result, including: based on the attention mechanism, the first computing unit is used to perform an attention fusion process on the first query encoding feature, the first key encoding feature and the first value feature to obtain the first attention feature. The first computing unit is used to perform a first full connection process on the first attention feature to obtain the first processed attention feature as the first current processing result. The second current forward processing is performed on the second current data to be processed by the second computing unit synchronously with the first current forward processing to obtain the second current processing result, including: synchronously with the first computing unit performing an attention fusion process on the first query encoding feature, the first key encoding feature and the first value feature, the second computing unit is used to perform rotation position encoding on the second query feature and the second key feature respectively to obtain the second encoding result as the second current processing result. The second encoding result includes the second query encoding feature and the second key encoding feature.

[0107] In some embodiments, in a fourth period after the third period, the first current data to be processed includes a second encoding result and a second value feature, and the second current forward processing includes communication, a first fusion process, and a normalization process. Using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result includes: based on the attention mechanism, using the first computing unit to perform attention fusion processing on the second query encoding feature, the second key encoding feature, and the second value feature to obtain the second attention feature. Using the first computing unit to perform a first full connection process on the second attention feature to obtain the second processed attention feature as the first current processing result. Using the second computing unit to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain the second current processing result includes: synchronously with the first computing unit performing attention fusion processing on the second query encoding feature, the second key encoding feature, and the second value feature, based on the first processed attention feature, using the second computing unit to perform communication to obtain the first communication attention feature. Using the second computing unit to perform a first fusion process on the first communication attention feature and the first input sub-data to obtain the first fusion result. The first fusion result is normalized by the second computing unit to obtain a first normalized fusion result. Based on the first normalized fusion result, the second computing unit is used to perform communication to obtain a first post-communication fusion result as the second current processing result.

[0108] In some embodiments, in a fifth period after the fourth period, the first current data to be processed includes a first communication post-fusion result, and the first current forward processing includes a second full-connection processing. Using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result includes: using the first computing unit to perform the second full-connection processing on the first communication post-fusion result to obtain the first intermediate full-connection result as the first current processing result. Using the second computing unit to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain the second current processing result includes: synchronously with the first computing unit performing the second full-connection processing on the first communication post-fusion result, based on the second processed attention feature, using the second computing unit to communicate to obtain the second communication post-attention feature; using the second computing unit to perform the first fusion processing on the second communication post-attention feature and the second input sub-data to obtain the second fusion result; using the second computing unit to normalize the second fusion result to obtain the second normalized fusion result; based on the second normalized fusion result, using the second computing unit to communicate to obtain the second communication post-fusion result as the second current processing result.

[0109] In some embodiments, in a sixth time period after the fifth time period, the first current data to be processed includes a second post-communication fusion result, and the second current forward processing includes an activation process. Performing the first current forward processing on the first current data to be processed using the first computing unit to obtain the first current processing result includes: performing a second full-connection processing on the second post-communication fusion result using the first computing unit to obtain a second intermediate full-connection result as the first current processing result. Performing the second current forward processing on the second current data to be processed synchronously with the first current forward processing using the second computing unit to obtain the second current processing result includes: performing an activation process on the first intermediate full-connection result synchronously with the first computing unit performing the second full-connection processing on the second post-communication fusion result to obtain a first activation result.

[0110] In some embodiments, in a seventh time period after the sixth time period, the first current data to be processed includes a first activation result, and the first current forward processing includes a third full-connection processing. Using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result includes: performing the third full-connection processing on the first activation result to obtain the first full-connection result to be communicated as the first current processing result. Using the second computing unit to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain the second current processing result includes: performing activation processing on the second intermediate full-connection result synchronously with the first computing unit performing the third full-connection processing on the first activation result to obtain the second activation result.

[0111] In some embodiments, in an eighth time period after the seventh time period, the first current data to be processed includes a second activation result, and the second current forward processing includes communication and a second fusion processing. Using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result includes: using the first computing unit to perform a third full connection processing on the second activation result to obtain a second full connection result to be communicated as the first current processing result. Using the second computing unit to perform the second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain the second current processing result includes: synchronously with the first computing unit performing the third full connection processing on the second activation result, based on the first full connection result to be communicated, using the second computing unit to communicate, to obtain a first fully connected result after communication; using the second computing unit to perform a second fusion processing on the first fully connected result after communication and the first fusion result to obtain a first output result.

[0112] In some embodiments, in a ninth time period after the eighth time period, the method further includes: based on the second to-be-communicated full-connection result, communicating using a second computing unit to obtain a second fully-connected result after communication. Performing a second fusion process on the second fully-connected result after communication and the second fusion result using the second computing unit to obtain a second output result.

[0113] It can be understood that the method of the present disclosure is described above, and the electronic device including the device of the present disclosure will be described below.

[0114] Figure 6 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure.

[0115] like Figure 6 As shown, the apparatus 60 may include a device 600. The device 600 may be, for example, the device 200 described above.

[0116] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0117] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0118] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, 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.

[0119] like Figure 7 As 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 to 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.

[0120] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. 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.

[0121] 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 that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a data processing method. For example, in some embodiments, the data processing method may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 708.

[0122] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the 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).

[0123] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may 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 may be a dedicated or general 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.

[0124] 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.

[0125] 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 device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories (EPROM) or flash memories, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0126] 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 cathode ray tube (CRT) display or a liquid crystal display (LCD)) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a 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).

[0127] The systems and techniques described herein may 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 may 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), and the Internet.

[0128] A computer system may include clients and servers. Clients and servers 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 to each other.

[0129] 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 recorded in this disclosure can be executed 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.

[0130] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A data processing device, comprising: The first computing unit is configured as follows: Performing a first current forward processing on the first current data to be processed to obtain a first current processing result, wherein the first current data to be processed corresponds to target input sub-data among the multiple input sub-data of the input data; The second computing unit is configured as follows: Performing a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result, wherein the second current data to be processed corresponds to the input sub-data other than the target input sub-data among the plurality of input sub-data; The second current processing result is provided to the first computing unit so that: synchronously with the second computing unit performing a second subsequent forward processing on the second subsequent data to be processed of the second current data to be processed, the first computing unit performs a first subsequent forward processing on the first subsequent data to be processed of the first current data to be processed, the second subsequent data to be processed being determined based on the first current processing result, and the first subsequent processing being determined based on the second current processing result.

2. The device according to claim 1, wherein: The first computing unit is further configured as: Based on the loss information, the gradient of the weights used in the forward process is determined.

3. The device according to claim 1, wherein: The second computing unit is further configured as: According to the loss information, the gradients of the plurality of input sub-data in the forward processing process are determined.

4. The device according to claim 2 or 3, wherein: The first calculation unit is further configured to: obtain a first post-processing result according to the first post-processing data; The second calculation unit is further configured to: obtain a second post-processing result according to the second post-processing data; The loss information is determined based on at least one of the first post-processing result and the second post-processing result.

5. The device according to claim 1, wherein: The plurality of input sub-data include first input sub-data and second input sub-data, The second computing unit is further configured as: Normalizing the first input sub-data to obtain first normalized data; Performing communication based on the first normalized data to obtain a first communication result; The first communication result is provided to the first calculation unit.

6. The device according to claim 5, wherein: In a first time period, the first current data to be processed includes the first communication result, the first current forward processing includes conversion processing, and the second current forward processing includes normalization and communication, The first computing unit is further configured to perform the following operations to perform a first current forward processing on the first current data to be processed to obtain a first current processing result: performing a conversion process on the first communication result according to the query matrix, the value matrix and the key matrix to obtain a first conversion result as the first current processing result, wherein the first conversion result includes a first query feature, a first value feature and a first key feature; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Normalizing the second input sub-data synchronously with the first computing unit converting the first communication result to obtain second normalized data; Communication is performed based on the second normalized data to obtain a second communication result as the second current processing result.

7. The device according to claim 6, wherein: In a second time period after the first time period, the first current data to be processed includes the second communication result, and the second current forward processing includes rotation position encoding, The first computing unit is further configured to perform the following operations to perform a first current forward processing on the first current data to be processed to obtain a first current processing result: performing a conversion process on the second communication result according to the query matrix, the value matrix and the key matrix to obtain a second conversion result as the first current processing result, wherein the second conversion result includes a second query feature, a second value feature and a second key feature; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Synchronously with the first computing unit converting the second communication result, the first query feature and the first key feature are rotationally encoded respectively to obtain a first encoding result as the second current processing result, wherein the first encoding result includes a first query encoding feature and a first key encoding feature.

8. The device according to claim 7, wherein: In a third period after the second period, the first current data to be processed includes the first encoding result and the first value feature, the first current forward processing includes attention fusion processing and first full connection processing, The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed, to obtain a first current processing result: Based on the attention mechanism, performing attention fusion processing on the first query encoding feature, the first key encoding feature and the first value feature to obtain a first attention feature; Performing a first fully connected processing on the first attention feature to obtain a first processed attention feature as the first current processing result; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Synchronously with the first computing unit performing attention fusion processing on the first query encoding feature, the first key encoding feature and the first value feature, the second query feature and the second key feature are respectively rotationally encoded to obtain a second encoding result as the second current processing result, wherein the second encoding result includes a second query encoding feature and a second key encoding feature.

9. The device according to claim 8, wherein: In a fourth time period after the third time period, the first current data to be processed includes the second encoding result and the second value feature, and the second current forward processing includes communication, first fusion processing and normalization processing, The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed, to obtain a first current processing result: Based on the attention mechanism, performing attention fusion processing on the second query encoding feature, the second key encoding feature and the second value feature to obtain a second attention feature; Performing a first fully connected processing on the second attention feature to obtain a second processed attention feature as the first current processing result; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Synchronously with the first computing unit performing attention fusion processing on the second query encoding feature, the second key encoding feature, and the second value feature, communicating based on the first processed attention feature to obtain a first communicated attention feature; Performing a first fusion process on the first post-communication attention feature and the first input sub-data to obtain a first fusion result; Normalizing the first fusion result to obtain a first normalized fusion result; Communication is performed based on the first normalized fusion result to obtain a first post-communication fusion result as the second current processing result.

10. The device according to claim 9, wherein: In a fifth time period after the fourth time period, the first current data to be processed includes the first post-communication fusion result, the first current forward processing includes a second full-connection processing, The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed, to obtain a first current processing result: Performing a second full-connection processing on the first post-communication fusion result to obtain a first intermediate full-connection result as the first current processing result; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Synchronously with the first computing unit performing a second fully connected processing on the first communicated fusion result, communicating based on the second processed attention feature to obtain a second communicated attention feature; Performing a first fusion process on the second post-communication attention feature and the second input sub-data to obtain a second fusion result; Normalizing the second fusion result to obtain a second normalized fusion result; Communication is performed based on the second normalized fusion result to obtain a second post-communication fusion result as the second current processing result.

11. The device according to claim 10, wherein: In a sixth time period after the fifth time period, the first current data to be processed includes the second post-communication fusion result, and the second current forward processing includes activation processing, The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed, to obtain a first current processing result: Performing a second full-connection processing on the second post-communication fusion result to obtain a second intermediate full-connection result as the first current processing result; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Synchronously with the first computing unit performing a second full-connection processing on the second post-communication fusion result, an activation processing is performed on the first intermediate full-connection result to obtain a first activation result.

12. The device according to claim 11, wherein In a seventh time period after the sixth time period, the first current data to be processed includes the first activation result, the first current forward processing includes a third full-connection processing, The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed, to obtain a first current processing result: Performing a third full connection process on the first activation result to obtain a first full connection result to be communicated as the first current processing result; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Synchronously with the first computing unit performing the third full-connection processing on the first activation result, the second intermediate full-connection result is activated to obtain a second activation result.

13. The device according to claim 12, wherein: In an eighth time period after the seventh time period, the first current data to be processed includes the second activation result, the second current forward processing includes communication and second fusion processing, The first computing unit is further configured to perform the following operations to perform the first current forward processing on the first current data to be processed, to obtain a first current processing result: Performing a third full connection process on the second activation result to obtain a second full connection result to be communicated as the first current processing result; The second computing unit is further configured to perform the following operations to perform a second current forward processing on the second current data to be processed synchronously with the first current forward processing to obtain a second current processing result: Synchronously with the first computing unit performing a third full connection processing on the second activation result, communicating based on the first to-be-communicated full connection result to obtain a first post-communication full connection result; A second fusion process is performed on the first communication full connection result and the first fusion result to obtain a first output result.

14. The device according to claim 13, wherein: In a ninth time period after the eighth time period, the second computing unit is further configured to: Communicate based on the second to-be-communicated full-connection result to obtain a second post-communication full-connection result; A second fusion process is performed on the second post-communication full connection result and the second fusion result to obtain a second output result.

15. A data processing method, comprising: Performing a first current forward processing on first current data to be processed by a first computing unit to obtain a first current processing result, wherein the first current data to be processed corresponds to target input sub-data among a plurality of input sub-data of the input data; Performing a second current forward processing on second current data to be processed synchronously with the first current forward processing by using a second computing unit to obtain a second current processing result, wherein the second current data to be processed corresponds to input sub-data other than the target input sub-data among the plurality of input sub-data; The second current processing result is provided to the first computing unit by the second computing unit, so that: synchronously with the second computing unit performing second subsequent forward processing on the second subsequent data to be processed of the second current data to be processed, the first computing unit performs first subsequent forward processing on the first subsequent data to be processed of the first current data to be processed, the second subsequent data to be processed being determined based on the first current processing result, and the first subsequent processing being determined based on the second current processing result.

16. The method according to claim 15, further comprising: Based on the loss information, the first computing unit is used to determine the gradient of the weight used in the forward processing.

17. The method according to claim 15, further comprising: According to the loss information, the second computing unit is used to determine the gradients of the plurality of input sub-data in the forward processing process.

18. The method according to claim 16 or 17, further comprising: Obtaining a first post-processing result according to the first post-processing data using a first computing unit; Obtaining a second post-processing result according to the second post-processing data using a second computing unit; The loss information is determined based on at least one of the first post-processing result and the second post-processing result.

19. The method according to claim 15, wherein: The plurality of input sub-data include first input sub-data and second input sub-data, Also includes: Normalizing the first input sub-data by using the second computing unit to obtain first normalized data; Using the second computing unit to communicate based on the first normalized data to obtain a first communication result; The first communication result is provided to the first computing unit by using the second computing unit.

20. The method according to claim 19, wherein: In a first time period, the first current data to be processed includes the first communication result, the first current forward processing includes conversion processing, and the second current forward processing includes normalization and communication, The using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result comprises: According to the query matrix, the value matrix and the key matrix, the first communication result is converted by the first computing unit to obtain a first conversion result as the first current processing result, wherein the first conversion result includes a first query feature, a first value feature and a first key feature; The using a second computing unit to synchronously perform a second current forward processing on the second current data to be processed with the first current forward processing to obtain a second current processing result includes: In synchronization with the first computing unit converting the first communication result, using the second computing unit to normalize the second input sub-data to obtain second normalized data; Based on the second normalized data, the second computing unit is used to perform communication to obtain a second communication result as the second current processing result.

21. The method according to claim 20, wherein: In a second time period after the first time period, the first current data to be processed includes the second communication result, and the second current forward processing includes rotation position encoding, The using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result comprises: According to the query matrix, the value matrix and the key matrix, the second communication result is converted by the first computing unit to obtain a second conversion result as the first current processing result, wherein the second conversion result includes a second query feature, a second value feature and a second key feature; The using a second computing unit to synchronously perform a second current forward processing on the second current data to be processed with the first current forward processing to obtain a second current processing result includes: Synchronously with the first computing unit converting the second communication result, the second computing unit is used to perform rotational position encoding on the first query feature and the first key feature respectively to obtain a first encoding result as the second current processing result, wherein the first encoding result includes a first query encoding feature and a first key encoding feature.

22. The method according to claim 21, wherein: In a third period after the second period, the first current data to be processed includes the first encoding result and the first value feature, the first current forward processing includes attention fusion processing and first full connection processing, The using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result comprises: Based on the attention mechanism, using the first computing unit to perform attention fusion processing on the first query encoding feature, the first key encoding feature and the first value feature to obtain a first attention feature; Using a first computing unit to perform a first fully connected processing on the first attention feature to obtain a first processed attention feature as the first current processing result; The using a second computing unit to synchronously perform a second current forward processing on the second current data to be processed with the first current forward processing to obtain a second current processing result includes: Synchronously with the first computing unit performing attention fusion processing on the first query encoding feature, the first key encoding feature and the first value feature, the second computing unit is used to perform rotational position encoding on the second query feature and the second key feature, respectively, to obtain a second encoding result as the second current processing result, wherein the second encoding result includes a second query encoding feature and a second key encoding feature.

23. The method according to claim 22, wherein: In a fourth time period after the third time period, the first current data to be processed includes the second encoding result and the second value feature, and the second current forward processing includes communication, first fusion processing and normalization processing, The using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result comprises: Based on the attention mechanism, using the first computing unit to perform attention fusion processing on the second query encoding feature, the second key encoding feature and the second value feature to obtain a second attention feature; Using the first computing unit to perform a first fully connected processing on the second attention feature to obtain a second processed attention feature as the first current processing result; The using a second computing unit to synchronously perform a second current forward processing on the second current data to be processed with the first current forward processing to obtain a second current processing result includes: Synchronously with the first computing unit performing attention fusion processing on the second query encoding feature, the second key encoding feature, and the second value feature, based on the first processed attention feature, communicating with the second computing unit to obtain a first communicated attention feature; Using the second computing unit to perform a first fusion process on the first post-communication attention feature and the first input sub-data to obtain a first fusion result; Normalizing the first fusion result by using the second computing unit to obtain a first normalized fusion result; Based on the first normalized fusion result, the second computing unit is used to communicate to obtain a first post-communication fusion result as the second current processing result.

24. The method according to claim 23, wherein: In a fifth time period after the fourth time period, the first current data to be processed includes the first post-communication fusion result, the first current forward processing includes a second full-connection processing, The using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result comprises: Using a first computing unit, performing a second full-connection processing on the first post-communication fusion result to obtain a first intermediate full-connection result as the first current processing result; The using a second computing unit to synchronously perform a second current forward processing on the second current data to be processed with the first current forward processing to obtain a second current processing result includes: Synchronously with the first computing unit performing a second fully connected processing on the first communication fusion result, based on the second processed attention feature, using the second computing unit to communicate to obtain a second communication attention feature; Using the second computing unit, performing a first fusion process on the second post-communication attention feature and the second input sub-data to obtain a second fusion result; Normalizing the second fusion result by using the second computing unit to obtain a second normalized fusion result; Based on the second normalized fusion result, the second computing unit is used for communication to obtain a second post-communication fusion result as the second current processing result.

25. The method according to claim 24, wherein: In a sixth time period after the fifth time period, the first current data to be processed includes the second post-communication fusion result, and the second current forward processing includes activation processing, The using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result comprises: Using the first computing unit, perform a second full-connection processing on the second post-communication fusion result to obtain a second intermediate full-connection result as the first current processing result; The using a second computing unit to synchronously perform a second current forward processing on the second current data to be processed with the first current forward processing to obtain a second current processing result includes: Synchronously with the first computing unit performing the second full-connection processing on the second post-communication fusion result, the second computing unit is used to perform activation processing on the first intermediate full-connection result to obtain a first activation result.

26. The method according to claim 25, wherein: In a seventh time period after the sixth time period, the first current data to be processed includes the first activation result, the first current forward processing includes a third full-connection processing, The using the first computing unit to perform the first current forward processing on the first current data to be processed to obtain the first current processing result comprises: Using the first computing unit to perform a third full-connection process on the first activation result, to obtain a first full-connection result to be communicated as the first current processing result; The using a second computing unit to synchronously perform a second current forward processing on the second current data to be processed with the first current forward processing to obtain a second current processing result includes: Synchronously with the first computing unit performing the third full-connection processing on the first activation result, the second computing unit performs activation processing on the second intermediate full-connection result to obtain a second activation result.

27. An electronic device comprising the data processing device according to any one of claims 1 to 14.

28. An electronic device comprising: at least one processor; as well as 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 to enable the at least one processor to perform the method of any one of claims 15 to 26.

29. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 15 to 26.

30. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 15 to 26.

Citation Information

Cited By

  • Data processing method and apparatus

    WO2026056420A1

  • Data processing method, and apparatus

    WO2026138711A1