Data processor core, data processor, data processing device and electronic equipment

By designing data registers and logic units in the data processor core, near-memory computing is realized, which solves the problem of large memory access in general matrix multiplication operations, improves processor performance, and reduces complexity and power consumption.

CN118860486APending Publication Date: 2024-10-29KUNLUNXIN TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310480329.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

When existing processors perform universal matrix multiplication operations, the amount of memory access is large, resulting in low performance. Especially on the fifth generation RISC computer processors that do not support vector operations, the universal matrix multiplication operations are inefficient and complex. , area and power consumption are high.

Method used

A data processor core is designed, including a data register, a decoding unit, a first logic unit and a second logic unit. By customizing instructions and adjusting the internal structure, near-memory calculations are realized, the number of loading matrices is reduced, and access times are improved. Improve storage efficiency and reduce the total amount of storage access.

Benefits of technology

By reducing the number of matrix loads and the amount of memory access, the performance of the processor is improved, the complexity, area and power consumption are reduced, and the throughput rate of the deep learning algorithm is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860486A_ABST
    Figure CN118860486A_ABST
Patent Text Reader

Abstract

The invention provides a data processor core, and relates to the technical field of artificial intelligence, in particular to the technical field of chips. The processor core comprises at least one data register which respectively corresponds to at least one first logic unit; the decoding unit is configured to determine first address indication information according to the first to-be-processed instruction, and the first address indication information is used for indicating a first storage address; the at least one first logic unit is configured to obtain at least one first operation result according to at least one piece of first current data of the first matrix at the first storage address and second data in the at least one data register, and the second data is from the second matrix; the at least one second logic unit is configured to obtain a second operation result according to the at least one first operation result; and writing the second operation result into a result register. The invention further provides a data processor, a 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, and in particular to the field of chip technology. More specifically, the present disclosure provides a data processor core, a data processor, an apparatus, a method, an electronic device, and a storage medium. Background Art

[0002] With the development of artificial intelligence technology, artificial intelligence chips can be used to perform general matrix multiplication (GEMM) operations. Summary of the invention

[0003] The present disclosure provides a data processor core, a data processor, an apparatus, a method, an electronic device, and a storage medium.

[0004] According to one aspect of the present disclosure, a data processor core is provided, which includes: at least one data register, each corresponding to at least one first logic unit; a decoding unit, configured to determine first address indication information according to a first instruction to be processed, wherein the first address indication information is used to indicate a first storage address; at least one first logic unit, configured to: obtain at least one first operation result according to at least one first current data of a first matrix at the first storage address and second data in at least one data register, wherein the second data comes from a second matrix; and at least one second logic unit, configured to: obtain a second operation result according to the at least one first operation result; and write the second operation result into a result register.

[0005] According to another aspect of the present disclosure, a data processor is provided, comprising at least one data processor core provided by the present disclosure.

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

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

[0008] According to another aspect of the present disclosure, a data processing method is provided, the method comprising: determining first address indication information according to a first instruction to be processed, wherein the first address indication information is used to indicate a first storage address; obtaining at least one first operation result using at least one first logic unit according to at least one first current data of a first matrix at the first storage address and second data in at least one data register, wherein the second data comes from a second matrix and at least one data register corresponds to at least one first logic unit; obtaining a second operation result using at least one second logic unit according to the at least one first operation result; and writing the second operation result into a result register.

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

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

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

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0014] Figure 1 is a schematic diagram of a general matrix multiplication operation according to an embodiment of the present disclosure;

[0015] Figure 2 is a schematic diagram of a data processor core according to one embodiment of the present disclosure;

[0016] Figure 3 is a schematic diagram of a second instruction to be processed according to an embodiment of the present disclosure;

[0017] Figure 4 is a schematic diagram of a processor core according to an embodiment of the present disclosure;

[0018] Figure 5is a schematic diagram of a first instruction to be processed according to an embodiment of the present disclosure;

[0019] Figure 6 is a schematic diagram of a processor core according to an embodiment of the present disclosure;

[0020] Figure 7 is a schematic diagram of a third instruction to be processed according to an embodiment of the present disclosure;

[0021] Figure 8 is a schematic diagram of a fourth instruction to be processed according to an embodiment of the present disclosure;

[0022] Fig. 9 is a schematic diagram of a third instruction to be processed according to another embodiment of the present disclosure;

[0023] Fig.10 is a schematic diagram of a processor core according to another embodiment of the present disclosure;

[0024] Fig.11 is a schematic diagram of a data processor according to an embodiment of the present disclosure;

[0025] Fig.12 is a schematic diagram of a data processing device according to an embodiment of the present disclosure;

[0026] Fig.13 is a schematic diagram of an electronic device according to an embodiment of the present disclosure;

[0027] Fig.14 is a flowchart of a data processing method according to an embodiment of the present disclosure; and

[0028] Fig.15 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

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

[0030] The application scenarios of deep learning technology involve all walks of life. Various deep learning algorithms may include multiple general matrix multiplication operations. For example, the convolution operator and the fully connected operator of the neural network model may include multiple general matrix multiplication operations.

[0031] For processors that do not have vector processing capabilities, custom instructions and adjusted processor internal structures can be used to accelerate general matrix multiplication operations. As a result, the relevant processors can have a higher throughput when running deep learning algorithms. In addition, without the need to implement full vector instructions, the complexity, area and power consumption of the processor can be effectively reduced.

[0032] Reduced Instruction Set Computer (RISC) instructions have the characteristics of fixed instruction set length, simple instruction encoding, and single instruction function, which are friendly to processor designers. As a result, the application scenarios of reduced instruction set computer instruction systems are constantly increasing. The fifth-generation reduced instruction set computer (RISC-V) instruction set has the characteristics of simple and regular encoding, and can support custom instructions so that users can implement custom functions.

[0033] When performing general matrix multiplication operations on a fifth-generation RISC computer instruction set processor that does not support vector operations, load instructions can be frequently used to obtain each data in the two matrices and then perform multiplication operations. In addition, the multiplication results need to be added. Figure 1 Provide explanation.

[0034] Figure 1 is a schematic diagram of a general matrix multiplication operation according to an embodiment of the present disclosure.

[0035] like Figure 1 As shown, the general matrix multiplication operation can be related to the multiplicand matrix M11, the multiplier matrix M12 and the result matrix M13. The calculation process of the general matrix multiplication can be implemented as:

[0036] C=A×B (Formula 1)

[0037] A may be the multiplicand matrix M11. B may be the multiplier matrix M12. C may be the result matrix M13. The size (shape) of the multiplicand matrix M11 may be m×k, the size of the multiplier matrix M12 may be k×n, and the size of the result matrix M13 may be m×n.

[0038] For example, in order to determine the data D31 in the result matrix M13, k data in the first row of the multiplicand matrix M11 can be loaded, or k data in the first column of the multiplier matrix M12 can be loaded. A total of 2k data need to be executed, 2k load instructions need to be executed, and k multiplication operations and k-1 addition operations need to be performed. When performing the first multiplication operation, the first data D11 in the first row of the multiplicand matrix M11 and the first data D21 in the first column of the multiplier matrix M12 can be multiplied to obtain the first multiplication result. By adding the k multiplication results, data D31 can be obtained.

[0039] However, during the multiplication operation, the previous operation result can be written into the general register of the processor core. After obtaining the current operation result, in order to use the general register, the previous operation result needs to be stored in the main memory. Therefore, when performing a general matrix multiplication operation, the memory access amount is large, resulting in low processor performance.

[0040] In order to improve the performance of the processor, the present disclosure provides a data processor core, which will be described below.

[0041] Figure 2 is a schematic diagram of a data processor core according to one embodiment of the present disclosure.

[0042] like Figure 2 As shown, the processor core 200 may include at least one data register 210 , a decoding unit 220 , at least one first logic unit 230 , and at least one second logic unit 240 .

[0043] At least one data register 210 may correspond to at least one first logic unit, respectively. In the embodiment of the present disclosure, a data register may correspond to one first logic unit.

[0044] The decoding unit 220 may be configured to: determine first address indication information according to the first instruction to be processed. The first address indication information may indicate a first storage address. In the embodiment of the present disclosure, the instruction to be processed may be a custom instruction based on the fifth generation reduced instruction set computer instruction set.

[0045] At least one first logic unit 230 is configured to obtain at least one first operation result according to at least one first current data of the first matrix at the first storage address and the second data in at least one data register. The second data may come from the second matrix. For example, the first matrix may be the multiplier matrix M12 mentioned above. The at least one first current data may be the k data of the first column of the multiplier matrix M12 mentioned above. The second data in the at least one data register may be the k data of the first row of the second matrix respectively. The second matrix may be the multiplicand matrix M11 mentioned above. The at least one first operation result may, for example, include the multiplication result between the first data D11 of the first row mentioned above and the first data D21 of the first column mentioned above.

[0046] The at least one second logic unit 240 may be configured to obtain a second operation result according to the at least one first operation result and write the second operation result into the result register. For example, the at least one first operation result may be added to obtain the second operation result.

[0047] Through the disclosed embodiment, the data register corresponding to the first logic unit stores the second data, which can achieve a similar effect to near memory calculation. In addition, storing the second data in the data register can reduce the number of times the second matrix is ​​loaded, improve memory access efficiency, and reduce the total memory access amount.

[0048] In the embodiment of the present disclosure, the processor core 200 may further include a result register. The result register may be configured to: determine a target value according to the second operation result and the initial value of the result register. Write the target value into the result register. For example, the second operation result may be added to the initial value of the result register to obtain the target value. Next, the target value may be written into the result register. Through the embodiment of the present disclosure, when the scale of at least one of the first matrix and the second matrix is ​​large, the result register may temporarily store the intermediate operation result of the general matrix multiplication operation to reduce the memory access amount and improve the chip performance.

[0049] It can be understood that the data processor core of the present disclosure is described above. Figure 3 A plurality of pending instructions of the present disclosure are further described.

[0050] Figure 3 is a schematic diagram of a second instruction to be processed according to an embodiment of the present disclosure.

[0051] like Figure 3As shown, instruction I320 may be a general matrix multiplication start instruction (GEMM-tart), which may be used as a second instruction to be processed. In the disclosed embodiment, the decoding unit may also be configured to: determine second address indication information according to the second instruction to be processed. The second address indication information may indicate a second storage address, which will be further described below.

[0052] like Figure 3 As shown, instruction I320 may include an operation code (opcode) I321, an identification value (fun) I322, a signal value (mask) I323, a second source register identification (rs1) I324 and a second immediate value (imm[11:0]) I325.

[0053] like Figure 3 As shown, the bit width of instruction I320 may be, for example, 32 bits.

[0054] Bits 0 to 6 of instruction I320 may be operation code I321. Figure 3 As shown, when the value of the operation code I321 is 1111011, the operation code I321 may indicate that the second instruction to be processed I320 is a custom instruction.

[0055] The 7th to 8th bits of the instruction I320 may be an identification value I322. Figure 3 As shown, when the identification value I322 is 00, the identification value I322 may indicate that the instruction I320 is a general matrix multiplication start instruction.

[0056] The 9th to 14th bits of the instruction I320 may be a signal value I323. For example, the signal value I323 may be a continuous 1 starting from the lowest bit of the instruction (the 9th bit of the instruction I320).

[0057] Bits 15 to 19 of the instruction I320 may be a second source register identifier I324. Bits 20 to 31 of the instruction I320 may be a second immediate value I325.

[0058] In the disclosed embodiment, the decoding unit may also be configured to: determine the second immediate number, the second source register identifier, and the signal value according to the second instruction to be processed. For example, the decoding unit may determine the second immediate number I325, the second source register identifier I324, and the signal value I323 according to the instruction I320. The second immediate number I325 and the second source register identifier I324 may be used as the second address indication information.

[0059] In the disclosed embodiment, the decoding unit may also be configured to: in response to receiving the second instruction to be processed, suspend responding to the interrupt request. For example, in response to receiving instruction I320, the response to the interrupt request may be suspended so that the processor core can efficiently complete the general matrix multiplication operation.

[0060] It can be understood that the second instruction to be processed in the present disclosure is described above. Figure 4 The processor core of the present disclosure is further described.

[0061] Figure 4 is a schematic diagram of a processor core according to one embodiment of the present disclosure.

[0062] like Figure 4 As shown, the processor core 400 may include data registers 411 to 416 and first logic units 441 to 446. For example, the data register 411 may correspond to the first logic unit 431. The data register 412 may correspond to the first logic unit 432. The data register 413 may correspond to the first logic unit 433. The data register 414 may correspond to the first logic unit 434. The data register 415 may correspond to the first logic unit 435. The data register 416 may correspond to the first logic unit 436.

[0063] In the embodiment of the present disclosure, the decoding unit of the processor core 400 may determine the second immediate value I325, the second source register identifier I324 and the signal value I323 according to the above instruction I320.

[0064] In the embodiment of the present disclosure, the processor core may further include a memory access unit. The memory access unit may be configured to: determine the signal of each of at least one first logic unit according to the signal value. The signal may include a valid signal and an invalid signal. For example, if the above signal value I323 is 111111, the memory access unit 460 may determine that the signals of the six first logic units are all valid signals.

[0065] In the disclosed embodiment, the memory access unit may also be configured to determine the second storage address according to the second immediate number and the value corresponding to the second register identifier. For example, the value corresponding to the second register identifier I324 may be obtained from a register file. The memory access unit 460 may determine the second storage address addr42 according to the second immediate number I325 and the value corresponding to the second source register identifier I324. The second storage address addr42 may be located in a data cache unit (Data Cache, DCache) 401.

[0066] In the embodiment of the present disclosure, the memory access unit may also be configured to: determine the number of second data in the second matrix loaded from the second storage address according to the signal value. For example, the second data may come from the row data of the second matrix. If the signal value I323 is 111111, the number of data mask_n4 may be determined to be 6.

[0067] In the embodiment of the present disclosure, the memory access unit may also be configured to: load the number of data and the second data into a plurality of data registers respectively. The plurality of data registers correspond to the first logic units whose signals are valid signals respectively. For example, the memory access unit 460 may send a data loading request req4, a second storage address addr42, and a number of data mask_n4 to the data cache unit 410, so as to determine the number of data and the second data in the data cache unit 410. Taking the second matrix as a 6×6 matrix as an example, if it is determined that the signals of the first logic unit 431 to the first logic unit 436 are all valid signals and the number of data is determined to be 6, the 6 data of the first row of the second matrix may be used as 6 second data. The memory access unit 460 may load the 6 data from the data cache unit to the data register 411 to the data register 416 respectively. Through the embodiment of the present disclosure, the number of data and the signal of the first logic unit are determined according to the signal value, and the first logic unit to be run can be efficiently determined, which helps to improve the stability of the processor core.

[0068] For example, the memory access unit 460 may be configured to: load the first data of the first row of the second matrix into the data register 411. load the second data of the first row of the second matrix into the data register 412. load the third data of the first row of the second matrix into the data register 413. load the fourth data of the first row of the second matrix into the data register 414. load the fifth data of the first row of the second matrix into the data register 415. load the sixth data of the first row of the second matrix into the data register 416.

[0069] In the embodiment of the present disclosure, the first logic unit may be configured to: load the second data from the data register corresponding to the first logic unit. For example, the first logic unit 341 may load the second data from the data register 311 .

[0070] It is understandable that the signal value may also be other values. For example, if the signal value is 001111 and the six first logic units are arranged in ascending order according to the identification value, it can be determined that the signals of the first four first logic units are valid signals and the signals of the last two first logic units are invalid signals.

[0071] It can be understood that the present disclosure is described above in conjunction with the second instruction to be processed, and the present disclosure will be described below in conjunction with the first instruction to be processed.

[0072] Figure 5 is a schematic diagram of a first instruction to be processed according to an embodiment of the present disclosure.

[0073] like Figure 5 As shown, the instruction I510 may be a general matrix multiply load multiply accumulate instruction (GEMM_ldmac), which may be used as the first instruction to be processed. The instruction I510 may include an operation code I511, an identification value I512, a first source register identification I514, and a first immediate value I515.

[0074] like Figure 5 As shown, the bit width of instruction I510 may be, for example, 32 bits.

[0075] Bits 0 to 6 of instruction I510 may be operation code I511. Figure 5 As shown, when the value of the operation code I511 is 1111011, the operation code I511 may indicate that the instruction I510 is a custom instruction.

[0076] The 7th to 8th bits of the instruction I510 may be the identification value I512. Figure 5 As shown, when the identification value I512 is 01, the identification value I512 may indicate that the instruction I510 is a general matrix multiply-load-multiply-accumulate instruction.

[0077] The 9th to 14th bits of instruction I510 may be empty. For example, as described above, the number of data of the second data and the signal of the first logic unit have been determined by the signal value I323. In order to perform the matrix multiplication operation, the number of first data may be consistent with the number of data of the second data. Thus, the 9th to 14th bits of instruction I510 may be empty.

[0078] Bits 15 to 19 of the instruction I510 may be a first source register identifier I514 . Bits 20 to 31 of the instruction I510 may be a first immediate value I515 .

[0079] In the disclosed embodiment, the decoding unit may also be configured to: determine, according to the first instruction to be processed, a first immediate value and a first source register identifier as first address indication information. For example, according to instruction I510, a first immediate value I515 and a first source register identifier I514 may be determined as first address indication information.

[0080] It can be understood that the first instruction to be processed is described above, and the following will be combined with Figure 6 The processor core of the present disclosure is further described.

[0081] Figure 6 is a schematic diagram of a processor core according to one embodiment of the present disclosure.

[0082] like Figure 6 As shown, the processor core 600 may include data registers 611 to 616 and first logic units 631 to 636. Each data register stores a second data. For detailed descriptions of the data registers 611 to 616 and the first logic units 641 to 646, reference may be made to the above descriptions of the data registers 411 to 416 and the first logic units 431 to 436, which will not be repeated in this disclosure.

[0083] In the embodiment of the present disclosure, the processor core may further include a result register 650. After receiving the above instruction I320, the result register 620 may be initialized. For example, the value of the result register 650 may be set to 0.

[0084] In the embodiment of the present disclosure, the processor core may further include a memory access unit. The memory access unit may be configured to determine a first storage address based on a first immediate number and a value corresponding to a first source register identifier. The first storage address may be located in a data cache unit, for example. At least one first current data of the first matrix may be stored at the first storage address. At least one first current data may come from column data of the first matrix. For example, the memory access unit 660 may determine a first storage address addr61 based on the above-mentioned first immediate number I515 and a value corresponding to the first source register identifier I514. Taking the first matrix as a 6×6 matrix as an example, the first storage address addr61 may store 6 data of the first column of the first matrix as 6 first current data.

[0085] In the embodiment of the present disclosure, the memory access unit may also be configured to: load at least one first current data at the first storage address in the data cache unit to at least one first logic unit. Figure 6 As shown, the memory access unit 660 can load the six data of the first column of the first matrix from the data cache unit to the first logic unit 631 to the first logic unit 636 respectively.

[0086] For example, the memory access unit 660 may be configured to: load the first data of the first column of the first matrix to the first logic unit 631. load the second data of the first column of the first matrix to the first logic unit 632. load the third data of the first column of the first matrix to the first logic unit 633. load the fourth data of the first column of the first matrix to the first logic unit 634. load the fifth data of the first column of the first matrix to the first logic unit 635. load the sixth data of the first column of the first matrix to the first logic unit 636.

[0087] In the embodiment of the present disclosure, at least one first logic unit may be multiple. The first logic unit may also be configured to: perform a multiplication operation based on the first current data and the second data in the data register corresponding to the first logic unit to obtain a first operation result. Figure 6 As shown, the first data of the first row of the second matrix in the data register 611 can be loaded into the first logic unit 631. The first logic unit 631 can perform a multiplication operation based on the first data of the first column of the first matrix and the first data of the first row of the second matrix to obtain a first operation result O631. The second data of the first row of the second matrix in the data register 612 can be loaded into the first logic unit 632. The first logic unit 632 can perform a multiplication operation based on the second data of the first column of the first matrix and the second data of the first row of the second matrix to obtain a first operation result O632. The third data of the first row of the second matrix in the data register 613 can be loaded into the first logic unit 633. The first logic unit 633 can perform a multiplication operation based on the third data of the first column of the first matrix and the third data of the first row of the second matrix to obtain a first operation result O633. The fourth data of the first row of the second matrix in the data register 614 can be loaded into the first logic unit 634. The first logic unit 634 can perform a multiplication operation based on the 4th data of the 1st column of the first matrix and the 4th data of the 1st row of the second matrix to obtain a first operation result O634. The 5th data of the 1st row of the second matrix in the data register 615 can be loaded into the first logic unit 635. The first logic unit 635 can perform a multiplication operation based on the 5th data of the 1st column of the first matrix and the 5th data of the 1st row of the second matrix to obtain a first operation result O635. The 6th data of the 1st row of the second matrix in the data register 616 can be loaded into the first logic unit 636. The first logic unit 636 can perform a multiplication operation based on the 6th data of the 1st column of the first matrix and the 6th data of the 1st row of the second matrix to obtain a first operation result O636. Through the embodiment of the present disclosure, the first logic unit uses the second data in the data register corresponding to the first logic unit to perform operations, which can improve data processing efficiency and help improve the performance of the processor core.

[0088] In the embodiment of the present disclosure, the at least one second logic unit may be multiple. The multiple second logic units include at least one first-level second logic unit. The first-level second logic unit may be configured to add at least two first operation results to obtain a third operation result. Figure 6As shown, the plurality of second logic units include a first-level second logic unit 641, a first-level second logic unit 642, and a first-level second logic unit 643. The first-level second logic unit 641 may add the first operation result O631 and the first operation result O632 to obtain a third operation result O6312. The first-level second logic unit 642 may add the first operation result O633 and the first operation result O634 to obtain a third operation result O6334. The first-level second logic unit 643 may add the first operation result O635 and the first operation result O636 to obtain a third operation result O6356.

[0089] In the embodiment of the present disclosure, the plurality of second logic units may further include a second-level second logic unit. The second-level second logic unit may be configured to: add the plurality of third operation results to determine the second operation result. Figure 6 As shown, the second-level second logic unit 644 can add the third operation result O6312, the third operation result O6334, and the third operation result O6356 to obtain the second operation result.

[0090] In the disclosed embodiment, the result register may be configured to: add the second operation result and the initial value in the result register to obtain a target value, and write the target value into the result register. For example, as described above, after receiving instruction I320, the value of the result register 650 may be initialized to 0. The second operation result may be added to the initial value of the result register 650 to obtain a target value. The target value may be written into the result register 650.

[0091] The result of multiplying the first matrix and the second matrix can be used as the third matrix. In the case where the first matrix is ​​a 6×6 matrix and the second matrix is ​​a 6×6 matrix, the target value can be used as the first data of the first row of the third matrix.

[0092] In the embodiment of the present disclosure, the memory access unit may also be configured to initiate a pre-fetch request to the secondary cache unit via the data cache unit, so that at least one first subsequent data of the first matrix is ​​loaded into the data cache unit. For example, the memory access unit 660 may send a pre-fetch request pre_fetch to the secondary cache unit 602 via the data cache unit 601. In addition, the data cache unit 601 may send an address new_addr related to the first subsequent data resp_data. The secondary cache unit 603 may return the first subsequent data resp_data to the data cache unit 601.

[0093] It can be understood that when the first matrix is ​​a 6×6 matrix, the 6 data in the second column of the first matrix can be used as the 6 first-after data. It can also be understood that if the first matrix and the second matrix are large in size, partial data of rows or columns can be loaded each time.

[0094] It can be understood that the present disclosure is described above in conjunction with the first instruction to be processed, and the present disclosure will be further described below in conjunction with the third instruction to be processed.

[0095] Figure 7 is a schematic diagram of a third instruction to be processed according to an embodiment of the present disclosure.

[0096] like Figure 7 As shown, instruction I730 may be a general matrix multiplication save instruction (GEMM_save), which may be used as the third instruction to be processed. Instruction I730 may include an operation code I731, an identification value I732, a third source register identification I734, and a third immediate value I735.

[0097] like Figure 7 As shown, the bit width of instruction I730 may be, for example, 32 bits.

[0098] Bits 0 to 6 of instruction I730 may be operation code I731. Figure 7 As shown, when the value of the operation code I731 is 1111011, the operation code I731 may indicate that the instruction I730 is a custom instruction.

[0099] The 7th to 8th bits of instruction I730 may be identification value I732. Figure 7 As shown, when the identification value I732 is 10, the identification value I732 may indicate that the instruction I730 is a general matrix multiplication save instruction.

[0100] Bits 9 to 14 of instruction I730 may be empty.

[0101] Bits 15 to 19 of the instruction I730 may be a third source register identifier I734. Bits 20 to 31 of the instruction I730 may be a third immediate value I735.

[0102] In the embodiment of the present disclosure, the decoding unit may also be configured to: determine a third immediate value and a third source register identifier according to the third instruction to be processed. For example, according to instruction I730, a third source register identifier I734 and a third immediate value I735 may be determined.

[0103] In the disclosed embodiment, the memory access unit may also be configured to determine a third storage address according to the third immediate value and the value corresponding to the third source register identifier. The third storage address may be located in the main memory. For example, the third storage address may be determined according to the value corresponding to the third source register identifier I734 and the third immediate value I735.

[0104] In the embodiment of the present disclosure, the memory access unit may also be configured to: write the target value of the result register to the third storage address. For example, in response to receiving instruction I730, the memory access unit 660 may write the target value to the third storage address. Through the embodiment of the present disclosure, after determining one data of the third matrix, the data may be written to the main memory to determine other data of the third matrix.

[0105] It can be understood that the present disclosure is described above in conjunction with the third instruction to be processed, and will be further described below in conjunction with the fourth instruction to be processed.

[0106] Figure 8 is a schematic diagram of a fourth instruction to be processed according to an embodiment of the present disclosure.

[0107] like Figure 8 As shown, instruction I840 may be a general matrix multiplication end instruction (GEMM_end), which may be used as the fourth instruction to be processed. Instruction I840 may include an operation code I841 and an identification value I842.

[0108] like Figure 8 As shown, the bit width of instruction I840 may be, for example, 32 bits.

[0109] Bits 0 to 6 of instruction I840 may be operation code I841. Figure 8 As shown, when the value of the operation code I841 is 1111011, the operation code I841 may indicate that the instruction I840 is a custom instruction.

[0110] The 7th to 8th bits of instruction I840 may be identification value I842. Figure 8 As shown, when the identification value I842 is 11, the identification value I842 may indicate that the instruction I840 is a general matrix multiplication end instruction.

[0111] Bits 9 to 31 of instruction I840 may be empty.

[0112] In the disclosed embodiment, the decoding unit may also be configured to: in response to receiving the fourth instruction to be processed, allow responding to the interrupt request. For example, after receiving instruction I840, the general matrix multiplication operation may be suspended, or the processor core may be allowed to process other instructions.

[0113] It can be understood that the third instruction to be processed includes the third immediate value as an example to illustrate the present disclosure, but the present disclosure is not limited thereto, and the third instruction to be processed may not include the third immediate value, which will be further explained below.

[0114] Fig. 9 is a schematic diagram of a third instruction to be processed according to another embodiment of the present disclosure.

[0115] like Fig. 9 As shown, the instruction I930' may be a general matrix multiplication save instruction (GEMM_save), which may be used as the third instruction to be processed. The instruction I930' may include an operation code I931, an identification value I932 and a third source register identification I934.

[0116] like Fig. 9 As shown, the bit width of instruction I930' may be 32 bits, for example.

[0117] Bits 0 to 6 of instruction I930' may be operation code I931. Fig. 9 As shown, when the value of the operation code I931 is 1111011, the operation code I931 may indicate that the instruction I930' is a custom instruction.

[0118] The 7th to 8th bits of the instruction I930' may be the identification value I932. Fig. 9 As shown, when the identification value I932 is 10, the identification value I932 may indicate that the instruction I930' is a general matrix multiplication save instruction.

[0119] Bits 9 to 14 of instruction I930' may be empty.

[0120] Bits 15 to 19 of instruction I930' may be the third source register identifier I934. Bits 20 to 31 of instruction I730 may be empty.

[0121] In the embodiment of the present disclosure, the decoding unit may also be configured to: determine a third source register identifier according to the third instruction to be processed. The third source register identifier may indicate a register to be written. For example, according to instruction I930', the decoding unit may determine a third source register identifier I934.

[0122] In the embodiment of the present disclosure, the result register may also be configured to write the target value of the result register into the register to be written. For example, the result register may write the target value into the register to be written indicated by the third source register identifier I934. Through the embodiment of the present disclosure, the target value may also be written into the register. Thus, the processor core may meet various data processing requirements.

[0123] It can be understood that the decoding unit, the first logic unit, the second logic unit, the data register, the result register and the memory access unit are described above. In the embodiment of the present disclosure, the data processor core may also include an instruction fetch unit and a dispatch unit, which will be further described below.

[0124] Fig.10 is a schematic diagram of a processor core according to another embodiment of the present disclosure.

[0125] like Fig.10 As shown, the processor core 1000 may include data registers 1011 to 1016 , a decoding unit 1020 , first logic units 1031 to 1036 , first-level second logic units 1041 to 1043 , second-level second logic units 1044 , and a result register 1050 .

[0126] It can be understood that the detailed description of data registers 1011 to 1016, decoding unit 1020, first logic unit 1031 to 1036, first-level second logic unit 1041 to 1043, second-level second logic unit 1044, result register 1050, data cache unit 1001, and secondary cache unit 1003 can refer to the above-mentioned description of data registers 611 to 616, decoding unit 620, first logic unit 631 to 636, first-level second logic unit 641 to 643, second-level second logic unit 644, result register 650, data cache unit 601, and secondary cache unit 603, and the present disclosure will not repeat them here.

[0127] In the embodiment of the present disclosure, the processor core 1000 may further include an instruction fetch unit 1070 . The instruction fetch unit 1070 may be configured to send an instruction fetch request to the instruction cache unit 1002 so that the instruction cache unit sends the custom instruction to the decoding unit 1020 .

[0128] In the embodiment of the present disclosure, the processor core 1000 may further include a dispatch unit 1080. The dispatch unit 1080 may detect the correlation between the custom instruction and the instruction currently executed by the processor core. If the currently executed instruction has no correlation and the current instruction is executed, the dispatch unit 1080 may obtain the source register value related to the custom instruction from the register file 1004. Next, at least one of the immediate value and the source register value of the custom instruction may be sent to the memory access unit.

[0129] In the disclosed embodiment, the operation result of the custom instruction (eg, the target value mentioned above) can be written back to the register file 1004 by the result register 1050 .

[0130] In the embodiment of the present disclosure, the processor core can also process instructions in a preset format. For example, the arithmetic logic unit (ALU) of the processor core can process instructions in a preset format.

[0131] It can be understood that the above description uses the matrix size of 6×6 as an example to illustrate the present disclosure, but the present disclosure is not limited thereto, and the first matrix and the second matrix can be matrices of any size, which is not limited by the present disclosure.

[0132] It is understandable that the above description uses the bit width of the custom instruction as 32 bits as an example to explain the present disclosure, but the present disclosure is not limited thereto, and the bit width of the instruction may also be 64 bits, 128 bits, etc.

[0133] It can be understood that the data processor core of the present disclosure is described above, and the data processor including the data processor core will be described below.

[0134] Fig.11 is a schematic diagram of a data processor according to one embodiment of the present disclosure.

[0135] like Fig.11 As shown, the processor P110 may include at least one data processor core 1100 provided by the present disclosure. The data processor core 1100 may be, for example, the processor core 200 described above.

[0136] It can be understood that the data processor of the present disclosure is described above, and a data processor device including the data processor will be described below.

[0137] Fig.12 is a schematic diagram of a data processing device according to an embodiment of the present disclosure.

[0138] like Fig.12 As shown, the data processing device 12 may include a data processor P120 provided by the present disclosure. The data processor P120 may be, for example, the processor P110 described above. The data processing device 12 may also include a storage unit.

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

[0140] Fig.13 is a schematic diagram of an electronic device according to an embodiment of the present disclosure.

[0141] like Fig.13 As shown, the electronic device 13000 may include a data processing device 13. The data processing device 13 may be, for example, the data processing device 12 described above.

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

[0143] Fig.14 is a flow chart of a data processing method according to an embodiment of the present disclosure.

[0144] like Fig.14 As shown, the method 1400 may include operations S1410 to S1440.

[0145] In operation S1410, first address indication information is determined according to a first instruction to be processed. For example, the first address indication information is used to indicate a first storage address.

[0146] In operation S1420, at least one first operation result is obtained using at least one first logic unit according to at least one first current data of the first matrix at the first storage address and second data in at least one data register. For example, the second data comes from the second matrix, and at least one data register corresponds to at least one first logic unit.

[0147] In operation S1430, a second operation result is obtained by using at least one second logic unit according to the at least one first operation result.

[0148] In operation S1440, the second operation result is written into the result register.

[0149] It can be understood that the method 1400 can be implemented using the processor core 200 described above.

[0150] In some embodiments, obtaining at least one first operation result using at least one first logic unit includes: performing a multiplication operation using the first logic unit according to first current data and second data in a data register corresponding to the first logic unit to obtain a first operation result.

[0151] In some embodiments, writing the second operation result into the result register further comprises: adding the second operation result to the initial value in the result register to obtain a target value, and writing the target value into the result register.

[0152] In some embodiments, determining the first address indication information according to the first instruction to be processed includes: determining a first immediate value and a first source register identifier as the first address indication information according to the first instruction to be processed.

[0153] In some embodiments, the method 1400 further includes: determining a first storage address according to the first immediate value and a value corresponding to the first source register identifier, and loading at least one first current data at the first storage address in the data cache unit into at least one first logic unit.

[0154] In some embodiments, the method 1400 further includes: initiating a pre-fetch request to the secondary cache unit via the data cache unit, so that at least one first subsequent data of the first matrix is ​​loaded into the data cache unit.

[0155] In some embodiments, at least one first logic unit is multiple. At least one second logic unit is multiple. The multiple second logic units include at least one first-level second logic unit and a second-level second logic unit. Obtaining the second operation result using the at least one second logic unit includes: using the first-level second logic unit to add at least two first operation results to obtain a third operation result. Using the second-level second logic unit to add multiple third operation results to obtain the second operation result.

[0156] In some embodiments, the method 1400 further includes: determining second address indication information according to the second instruction to be processed. For example, the second address indication information is used to indicate the second storage address.

[0157] In some embodiments, determining the second address indication information includes: determining a second immediate value, a second source register identifier, and a signal value according to the second instruction to be processed. For example, the second address indication information is the second immediate value and the second source register identifier.

[0158] In some embodiments, the method 1400 further includes: determining a signal of each of the at least one first logic unit according to the signal value, wherein the signal includes a valid signal and an invalid signal.

[0159] In some embodiments, the method 1400 further includes: determining a second storage address according to the second immediate value and a value corresponding to the second source register identifier. Determining the number of data of the second data in the second matrix loaded from the second storage address according to the signal value. Loading the number of data and the second data to a plurality of data registers respectively. The plurality of data registers respectively correspond to the first logic units where the plurality of signals are valid signals.

[0160] In some embodiments, the method 1400 further includes: in response to receiving a second pending instruction, suspending responding to the interrupt request.

[0161] In some embodiments, method 1400 further includes: determining a third immediate value and a third source register identifier according to a third instruction to be processed.

[0162] In some embodiments, the method 1400 further includes: determining a third storage address according to the third immediate value and a value corresponding to the third source register identifier, and writing the target value of the result register into the third storage address.

[0163] In some embodiments, method 1400 further includes: determining a third source register identifier according to a third instruction to be processed, wherein the third source register identifier is used to indicate a register to be written.

[0164] In some embodiments, method 1400 further includes: writing the target value of the result register into the register to be written.

[0165] In some embodiments, the method 1400 further includes: in response to receiving a fourth pending instruction, allowing a response to the interrupt request.

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

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

[0168] Fig.15 A schematic block diagram of an example electronic device 1500 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.

[0169] like Fig.15 As shown, the device 1500 includes a computing unit 1501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1502 or a computer program loaded from a storage unit 1508 into a random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the device 1500 can also be stored. The computing unit 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0170] A number of components in the device 1500 are connected to the I / O interface 1505, including: an input unit 1506, such as a keyboard, a mouse, etc.; an output unit 1507, such as various types of displays, speakers, etc.; a storage unit 1508, such as a disk, an optical disk, etc.; and a communication unit 1509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1509 allows the device 1500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0171] The computing unit 1501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1501 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1500 via ROM 1502 and / or communication unit 1509. When the computer program is loaded into RAM 1503 and executed by the computing unit 1501, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1501 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).

[0172] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

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

[0174] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0175] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) display or an LCD (liquid crystal display)) 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).

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

[0177] 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 processor core, comprising: at least one data register, corresponding to at least one first logic unit respectively; A decoding unit, configured to determine first address indication information according to a first instruction to be processed, wherein the first address indication information is used to indicate a first storage address; at least one first logic unit configured to obtain at least one first operation result according to at least one first current data of the first matrix at the first storage address and second data in at least one of the data registers, wherein the second data comes from the second matrix; and At least one second logic unit is configured to: obtain a second operation result according to at least one first operation result; and write the second operation result into a result register.

2. The processor core according to claim 1, wherein: The first logic unit is further configured as: A multiplication operation is performed according to the first current data and the second data in the data register corresponding to the first logic unit to obtain the first operation result.

3. The processor core according to claim 1, wherein: The result register configuration is: Adding the second operation result to the initial value in the result register to obtain a target value; The target value is written into the result register.

4. The processor core according to claim 1, wherein: The decoding unit is further configured as: According to the first instruction to be processed, a first immediate value and a first source register identifier are determined as the first address indication information.

5. The processor core according to claim 4, further comprising: Memory access unit, configured as: determining the first storage address according to the first immediate value and a value corresponding to the first source register identifier; At least one first current data at the first storage address in the data cache unit is loaded into at least one of the first logic units respectively.

6. The processor core according to claim 5, wherein: The memory access unit is further configured as: A pre-fetch request is initiated to a secondary cache unit via the data cache unit, so that at least one first subsequent data of the first matrix is ​​loaded into the data cache unit.

7. The processor core according to claim 1, wherein: At least one of the first logic units is a plurality, at least one of the second logic units is a plurality, and the plurality of the second logic units includes at least one first-level second logic unit and a second-level second logic unit. The first-level second logic unit is configured to add at least two first operation results to obtain a third operation result; The second-level second logic unit is configured to add a plurality of the third operation results to obtain the second operation result.

8. The processor core according to claim 1, wherein: The decoding unit is further configured as: According to the second instruction to be processed, second address indication information is determined, wherein the second address indication information is used to indicate a second storage address.

9. The processor core according to claim 8, wherein: The decoding unit is further configured as: According to the second instruction to be processed, determining a second immediate value, a second source register identifier and a signal value, The second address indication information is the second immediate value and the second source register identifier.

10. The processor core according to claim 9, further comprising: Memory access unit, configured as: According to the signal value, a signal of at least one of the first logic units is determined, wherein the signal includes a valid signal and an invalid signal.

11. The processor core according to claim 10, wherein: The memory access unit is further configured as: determining the second storage address according to the second immediate value and a value corresponding to the second source register identifier; determining, according to the signal value, the number of data of the second data in the second matrix loaded from the second storage address; The number of second data are loaded into the plurality of data registers respectively, and the plurality of data registers respectively correspond to the first logic units whose signals are the valid signals.

12. The processor core according to claim 8, wherein: The decoding unit is further configured as: In response to receiving the second pending instruction, responding to the interrupt request is suspended.

13. The processor core according to claim 3, wherein: The decoding unit is further configured as: According to the third instruction to be processed, a third immediate value and a third source register identifier are determined.

14. The processor core according to claim 13, further comprising: The memory access unit is configured as follows: determining the third storage address according to the third immediate value and a value corresponding to the third source register identifier; The target value of the result register is written into the third storage address.

15. The processor core according to claim 3, wherein: The decoding unit is further configured as: A third source register identifier is determined according to a third instruction to be processed, wherein the third source register identifier is used to indicate a register to be written.

16. The processor core according to claim 15, wherein: The result register is also configured as: The target value of the result register is written into the register to be written.

17. The processor core according to claim 1, wherein: The decoding unit is further configured as: In response to receiving the fourth pending instruction, responding to the interrupt request is enabled.

18. A data processor comprising at least one data processor core according to any one of claims 1 to 17.

19. A data processing device, comprising the data processor according to claim 18.

20. An electronic device comprising the data processing device according to claim 19.

21. A data processing method, comprising: Determine first address indication information according to the first instruction to be processed, wherein the first address indication information is used to indicate a first storage address; Obtain at least one first operation result using at least one first logic unit according to at least one first current data of the first matrix at the first storage address and second data in at least one data register, wherein the second data comes from the second matrix, and at least one of the data registers corresponds to at least one of the first logic units; Obtaining a second operation result using at least one second logic unit according to at least one first operation result; and The second operation result is written into the result register.

22. The method according to claim 21, wherein: The obtaining of at least one first operation result by using at least one first logic unit comprises: A multiplication operation is performed using the first logic unit according to the first current data and the second data in the data register corresponding to the first logic unit to obtain the first operation result.

23. The method according to claim 21, wherein: Writing the second operation result into the result register further comprises: Adding the second operation result to the initial value in the result register to obtain a target value; The target value is written into the result register.

24. The method according to claim 21, wherein: The determining, according to the first instruction to be processed, the first address indication information comprises: According to the first instruction to be processed, a first immediate value and a first source register identifier are determined as the first address indication information.

25. The method according to claim 24, further comprising: determining the first storage address according to the first immediate value and a value corresponding to the first source register identifier; At least one first current data at the first storage address in the data cache unit is loaded into at least one of the first logic units respectively.

26. The method according to claim 25, further comprising: A pre-fetch request is initiated to a secondary cache unit via the data cache unit, so that at least one first subsequent data of the first matrix is ​​loaded into the data cache unit.

27. The method of claim 21, wherein: At least one of the first logic units is a plurality, at least one of the second logic units is a plurality, and the plurality of the second logic units includes at least one first-level second logic unit and a second-level second logic unit. The obtaining of the second operation result by using at least one second logic unit comprises: Using the first-level second logic unit to add at least two first operation results to obtain a third operation result; The second logic unit of the second level is used to add a plurality of the third operation results to obtain the second operation result.

28. The method of claim 21, further comprising: According to the second instruction to be processed, second address indication information is determined, wherein the second address indication information is used to indicate a second storage address.

29. The method according to claim 28, wherein: The determining of the second address indication information comprises: According to the second instruction to be processed, determining a second immediate value, a second source register identifier and a signal value, The second address indication information is the second immediate value and the second source register identifier.

30. The method according to claim 29, further comprising: According to the signal value, a signal of at least one of the first logic units is determined, wherein the signal includes a valid signal and an invalid signal.

31. The method of claim 30, further comprising: determining the second storage address according to the second immediate value and a value corresponding to the second source register identifier; determining, according to the signal value, the number of data of the second data in the second matrix loaded from the second storage address; The number of second data are loaded into the plurality of data registers respectively, and the plurality of data registers respectively correspond to the first logic units whose signals are the valid signals.

32. The method according to claim 28, further comprising: In response to receiving the second pending instruction, responding to the interrupt request is suspended.

33. The method of claim 23, further comprising: According to the third instruction to be processed, a third immediate value and a third source register identifier are determined.

34. The method of claim 33, further comprising: determining the third storage address according to the third immediate value and a value corresponding to the third source register identifier; The target value of the result register is written into the third storage address.

35. The method of claim 23, further comprising: A third source register identifier is determined according to a third instruction to be processed, wherein the third source register identifier is used to indicate a register to be written.

36. The method of claim 35, further comprising: The target value of the result register is written into the register to be written.

37. The method of claim 1, further comprising: In response to receiving the fourth pending instruction, responding to the interrupt request is enabled.

38. 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 21 to 37.

39. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to perform the method according to any one of claims 21 to 37.

40. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 21 to 37.