Instruction execution device and method, electronic equipment and storage medium

The instruction execution device addresses redundant calculations in AI chips by dispatching uniform operations to uniform registers, enhancing efficiency and performance with reduced overhead.

JP2025134978APending Publication Date: 2025-09-17KUNLUNXIN TECHNOLOGY (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2025111233
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-07
Filing Date
2025-07-01
Publication Date
2025-09-17

AI Technical Summary

Technical Problem

Existing artificial intelligence chips face inefficiencies due to redundant calculations during single-instruction, multiple-data operations, leading to unnecessary computational resource overhead and performance bottlenecks.

Method used

An instruction execution device that dispatches instructions as uniform operations when source registers match uniform registers, performing arithmetic operations on uniform registers to reduce redundancy and improve efficiency, utilizing a dispatch unit and first calculation unit to write results to available uniform registers.

Benefits of technology

Significantly reduces redundant operations, improves instruction execution efficiency, and enhances chip performance with minimal chip area overhead by optimizing arithmetic operations on uniform registers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025134978000001_ABST
    Figure 2025134978000001_ABST
Patent Text Reader

Abstract

To provide an instruction execution device configured to implement high computational throughput and energy efficiency, a method, electronic equipment, and a storage medium.SOLUTION: An instruction execution device 100 includes: a dispatching unit configured to respond to determining that at least one source register used for an instruction to be executed corresponds to at least one uniform register in a plurality of uniform registers, the instruction to be executed serving as a uniform instruction including a plurality of uniform computing operations to be dispatched to a first computing unit; and the first computing unit configured to execute uniform calculation operation to obtain a uniform calculation result, the uniform calculation result being written into at least one available uniform register in the plurality of uniform registers.SELECTED DRAWING: Figure 1
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, particularly to the field of chip technology and single instruction multiple data (SIMD) technology. More specifically, the present disclosure provides an instruction execution device, method, electronic device, and storage medium. [Background technology]

[0002] With the development of artificial intelligence technology, the application scenarios of artificial intelligence chips are increasing. AI chips have strong parallel processing capabilities and can efficiently process large amounts of data. Summary of the Invention

[0003] The present disclosure provides an instruction execution device, method, electronic device, and storage medium.

[0004] According to one aspect of the present disclosure, there is provided an instruction execution apparatus including: a dispatch unit configured to dispatch the instruction to be executed to a first calculation unit as a uniform instruction including a plurality of uniform arithmetic operations in response to determining that at least one source register used in the instruction to be executed corresponds to at least one uniform register of a plurality of uniform registers; and the first calculation unit configured to perform the uniform arithmetic operations to obtain a uniform arithmetic result, and to write the uniform arithmetic result to at least one available uniform register of the plurality of uniform registers.

[0005] According to another aspect of the present disclosure, there is provided an electronic device including the device provided by the present disclosure.

[0006] According to another aspect of the present disclosure, there is provided an instruction execution method, including: in response to determining that at least one source register used in the instruction to be executed corresponds to at least one uniform register of a plurality of uniform registers, dispatching the instruction to be executed to a first calculation unit as a uniform instruction including a plurality of uniform arithmetic operations; performing the uniform arithmetic operations using the first calculation unit to obtain a uniform arithmetic result; and writing the uniform arithmetic result to at least one available uniform register of the plurality of uniform registers.

[0007] According to another aspect of the present disclosure, there is provided an electronic device including at least one processor and a memory communicatively coupled to the at least one processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor such that the at least one processor can perform a method provided by the present disclosure.

[0008] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to perform the methods provided by the present disclosure.

[0009] According to another aspect of the present disclosure, there is provided a computer program product including a computer program which, when executed by a processor, implements the methods provided by the present disclosure.

[0010] It should be understood that the contents described in this section are not intended to depict key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will be readily understood from the following description. [Brief explanation of the drawings]

[0011] The drawings are for a better understanding of the invention and are not intended to limit the disclosure. [Figure 1] FIG. 1 is a schematic block diagram of an instruction execution device according to an embodiment of the present disclosure. [Figure 2] FIG. 2 is a schematic diagram of a detection unit according to one embodiment of the present disclosure. [Figure 3] FIG. 10 is a schematic diagram of updating register mapping data according to an embodiment of the present disclosure. [Figure 4] FIG. 4 is a schematic diagram of an instruction execution device according to one embodiment of the present disclosure. [Figure 5] FIG. 2 is a schematic diagram of multiple computing units according to one embodiment of the present disclosure. [Figure 6] FIG. 1 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure. [Figure 7] 1 is a flowchart of an instruction execution method according to one embodiment of the present disclosure. [Figure 8] FIG. 1 is a block diagram of an electronic device to which an instruction execution method according to an embodiment of the present disclosure can be applied. DETAILED DESCRIPTION OF THE INVENTION

[0012] Hereinafter, exemplary embodiments of the present disclosure will be described with reference to the drawings. Hereinafter, various details of the embodiments of the present disclosure are included for ease of understanding, and should be considered as examples. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, the following description will omit descriptions of well-known functions and configurations.

[0013] Artificial intelligence chips include general-purpose graphics processing units (GPGPUs), tensor processing units (TPUs), neural network processing units (NPUs), and the like. Taking a general-purpose graphics processing unit as an example, a general-purpose graphics processing unit can execute instructions in a single-instruction, multiple-data manner, thereby achieving high computational throughput and high energy efficiency. However, during the execution of instructions in a single-instruction, multiple-data manner, many redundant calculations may occur. For example, the same arithmetic operation may be performed on the same data in different execution channels. Such arithmetic operations may be referred to as uniform arithmetic operations. For example, the instruction to be executed may include one batch of arithmetic operations. One batch of arithmetic operations may include 16 arithmetic operations. These 16 arithmetic operations may involve 16 different data in a first source register and 16 different data in a second source register. In this case, the instruction to be executed may be a single vector instruction, and there are no redundant operations among the 16 arithmetic operations. For example, if 16 arithmetic operations are all related to the same first data in the first source register and the same second data in the second source register, the 16 arithmetic operations may be 16 identical arithmetic operations and produce 16 identical arithmetic results. In this case, the instruction to be executed may be one uniform instruction, and there may be redundant operations among the 16 arithmetic operations. The redundant operations may cause unnecessary computational resource overhead and make it difficult to further improve the performance of the chip.

[0014] Therefore, to improve the performance of the chip, the present disclosure provides an instruction execution device, which is described below.

[0015] FIG. 1 is a schematic block diagram of an instruction execution device according to an embodiment of the present disclosure.

[0016] As shown in FIG. 1, the instruction execution device 100 may include a dispatching unit 110 and a first calculation unit 120 .

[0017] The dispatch unit 110 may be arranged to dispatch the to-be-executed instruction to the target computation unit as a uniform instruction in response to determining that at least one source register used in the to-be-executed instruction corresponds to at least one uniform register of the plurality of uniform registers.

[0018] In an embodiment of the present disclosure, the device 100 may include a memory space. The memory space stores a correspondence between a first register and a uniform register. The correspondence may include multiple correspondences. If the number of a source register of a target instruction is the same as the number of a first register in the memory space, it can be determined that the source register used in the target instruction corresponds to the uniform register.

[0019] In the embodiment of the present disclosure, the uniform register may be a newly added register or a scalar register. For example, the capacity of the vector register may be 512 bits. The capacity of the scalar register may be 32 bits. The capacity of the uniform register may be 32 bits. The first register may be a vector register. The scalar register may be the second register.

[0020] In the embodiments of the present disclosure, the source register used in the instruction to be executed may be one or more, and if it is determined that the source register is one and corresponds to a uniform register, it can be determined that the instruction to be executed is a uniform instruction.

[0021] In an embodiment of the present disclosure, a uniform instruction may include multiple uniform arithmetic operations, for example, a uniform instruction may include 16 uniform arithmetic operations.

[0022] In an embodiment of the present disclosure, the dispatching unit can dispatch at least one of a control signal of an instruction to be executed and data to be processed to the first computing unit.

[0023] The first computing unit 120 may be configured to perform a uniform arithmetic operation to obtain a uniform arithmetic result, for example, the target computing unit 120 may perform any one of 16 uniform arithmetic operations to obtain a uniform arithmetic result.

[0024] In an embodiment of the present disclosure, the uniform operation result is written to at least one available uniform register of the plurality of uniform registers, for example, an idle uniform register of the plurality of uniform registers may be the available uniform register.

[0025] According to the embodiment of the present disclosure, when a source register used in an instruction corresponds to a uniform register, the execution result of the instruction can be obtained by performing one of the operations of the instruction, which significantly reduces redundant operations, improves instruction execution efficiency, and contributes to improving chip performance. In addition, the number of operations performed by the first calculation unit is small, and the capacity of the uniform register is small, so that significant improvement in chip performance can be achieved with small chip area overhead.

[0026] As can be understood, the above describes the device of the present disclosure. The one or more correspondences in the memory space can be register mapping data. The register mapping data will be further described below.

[0027] In an embodiment of the present disclosure, the register mapping data may indicate a first register and a uniform register corresponding to the first register. The register mapping data may include correspondences between a plurality of first registers and a plurality of uniform registers. During the process of executing a plurality of instructions, the register mapping data is constantly updated. In the initial stage of the chip executing a plurality of instructions for different tasks, the register mapping data may be empty. For example, when executing a first target instruction of a plurality of target instructions, the register mapping data may be empty and may not include correspondences between vector registers and uniform registers.

[0028] As can be appreciated, the above describes the register mapping data of the present disclosure, and the apparatus of the present disclosure will now be further described.

[0029] In some embodiments, the apparatus may further include an instruction fetch unit, a decode unit, a scheduling unit, and a sending unit. The instruction fetch unit may fetch an initial instruction. The decode unit may decode the initial instruction to obtain a to-be-executed instruction. The scheduling unit may schedule hardware resources associated with the to-be-executed instruction to execute the to-be-executed instruction. The sending unit may send a read request to one or more source registers used by the to-be-executed instruction. The sending unit may send the to-be-executed instruction to the dispatch unit. For example, the sending unit may send the first to-be-executed instruction to the dispatch unit.

[0030] In some embodiments, the dispatch unit may be configured to dispatch the target instruction to the second compute unit in response to determining that at least one source register used by the target instruction includes a first register that does not correspond to any uniform register. For example, when executing the first target instruction, the register mapping data does not include a correspondence between vector registers and uniform registers. The first target instruction may be dispatched to the second compute unit. The second compute unit may be a vector compute unit. In this case, the first target instruction may be a vector instruction. As can be appreciated, the second compute unit may be a matrix compute unit, and the present disclosure is not limited thereto.

[0031] In some embodiments, the second computing unit may be configured to perform a plurality of arithmetic operations of the target instruction to obtain a plurality of initial computation results. For example, the second computing unit may perform a plurality of arithmetic operations of the first target instruction to obtain a plurality of initial computation results. It may then be determined whether the plurality of initial computation results are the same.

[0032] In some embodiments, the device may further include a detection unit, which is described below with reference to FIG.

[0033] FIG. 2 is a schematic diagram of a detection unit according to one embodiment of the present disclosure.

[0034] 2, the detection unit 240 may include a plurality of first detection modules. The plurality of first detection modules may include first detection module 2411, ..., first detection module 2412. The detection unit 240 may further include a second detection module 242. The detection unit 240 can determine whether N detection results are the same. N may be an integer greater than 1. N may be, for example, 16.

[0035] In an embodiment of the present disclosure, the first detection module may include a bitwise exclusive-OR operator and a first bitwise OR operator. The bitwise exclusive-OR operator may be configured to perform a bitwise exclusive-OR operation on two initial operation results to obtain an exclusive-OR operation result. The first bitwise OR operator is configured to perform a bitwise OR operation on the exclusive-OR operation results to obtain an OR operation result. As shown in FIG. 2, the data size of the initial operation result may be 32 bits. The first detection module 2411 may include a bitwise exclusive-OR operator xor2411 and a first bitwise OR operator bwor2411. The bitwise exclusive-OR operator xor2411 may determine an exclusive-OR operation result based on a first initial operation result and a second initial operation result among the N initial operation results. The data size of the exclusive-OR operation result may be 32 bits. Based on the result of this exclusive OR operation, the first bit OR operator bwor2411 can determine the result of the OR operation. The data size of the result of the OR operation may be 1 bit. The first detection module 2412 may include a bit exclusive OR operator xor2412 and a first bit OR operator bwor2412. The bit exclusive OR operator xor2412 can determine the result of the exclusive OR operation based on the (N-1)th initial operation result and the Nth initial operation result among the N initial operation results. The data size of the result of the exclusive OR operation may be 32 bits. The first bit OR operator bwor2412 can determine the result of the OR operation based on the result of the exclusive OR operation. The data size of the result of the OR operation may be 1 bit. Using multiple first detection modules, N results of the OR operation can be obtained.

[0036] In an embodiment of the present disclosure, the second detection module may include a second bitwise OR operator. The second bitwise OR operator is configured to perform a bitwise OR operation on the plurality of OR operation results to obtain a detection result. The detection result may indicate whether the plurality of vector operation results are the same. As shown in FIG. 2, the second detection module 242 may perform a bitwise OR operation on N OR operation results to obtain a detection result. The detection result may have a data volume of 1 bit. A detection result of 1 may indicate that the plurality of initial operation results are the same. A detection result of 0 may indicate that there is a difference between the plurality of initial operation results. As can be understood, the detection unit may detect whether the N operation results are the same. As can be understood, after the execution of the target instruction, the number of initial operation results obtained may be less than N. In this case, if the number of initial operation results is K and K is an odd number, the (K-1)th initial operation results may be copied and detected using the detection unit. According to the embodiments of the present disclosure, after the second calculation unit executes multiple operations of the instruction, it can efficiently determine whether the multiple calculation results of the instruction are the same, thereby improving the accuracy of the chip.

[0037] For the sake of understanding, the above describes how the detection unit of the present disclosure determines the detection result, and the following describes how the detection unit performs corresponding operations based on the detection result.

[0038] In some embodiments, the detection unit may be configured to write the initial operation result to an idle uniform register in response to determining that the multiple initial operation results are the same. For example, when the detection result corresponding to the first execution target instruction indicates that the multiple operation results are the same, one idle uniform register may be identified from the multiple uniform registers. The idle uniform register may be the first uniform register. Any of the multiple initial operation results is written to the first uniform register. Then, the detection unit may update the register mapping data.

[0039] In an embodiment of the present disclosure, the detection unit may be configured to update the register mapping data by setting the idle uniform register as a uniform register corresponding to the target register of the executed instruction, and updating the register mapping data with an identifier of the idle uniform register and an identifier of the target register. For example, a first uniform register may correspond to a target register used by a first executed instruction. The register mapping data may be updated with an identifier (number) of the first uniform register and an identifier of the target register. In accordance with an embodiment of the present disclosure, the computational resources required for a uniform arithmetic operation are reduced, and a single uniform arithmetic result is written to a uniform register, reducing the storage resource overhead required for the uniform instruction and contributing to further reducing chip area overhead.

[0040] In this way, the instruction execution device can complete execution of the first target instruction and then execute the second target instruction. The source registers used for the second target instruction do not need to correspond to any uniform register. In this way, the manner in which the second target instruction is executed is the same as or similar to that of the first target instruction, and the present disclosure will not describe it here.

[0041]

[0033] It can be understood that the above describes several ways of updating the register mapping data. When multiple target instructions are uniform instructions, the register mapping data may include multiple correspondences. In this case, the register mapping data may be implemented as a register mapping table, so as to efficiently identify the uniform registers corresponding to the source registers. Hereinafter, several ways of updating the register mapping table by the detection unit will be further described with reference to FIG. 3.

[0042] FIG. 3 is a schematic diagram of updating register mapping data according to one embodiment of the present disclosure.

[0043] 3, after the second calculation unit executes the second target instruction, a plurality of initial operation results corresponding to the second target instruction can be obtained. The detection unit 340 can determine a detection result based on the plurality of initial operation results corresponding to the second target instruction. The detection result may, for example, indicate that the plurality of initial operation results are the same.

[0044] In the embodiment of the present disclosure, multiple idle uniform registers may correspond to idle uniform register indication data. The idle uniform register indication data may be implemented as an idle uniform register indication table t30. The idle uniform register table t30 may include multiple uniform register numbers. The uniform registers corresponding to the uniform register numbers in the idle uniform register table t30 are in an idle state. Based on the idle uniform register indication table t30, the detection unit 340 may, for example, obtain a uniform register u1 and write any initial operation result corresponding to the second execution target instruction to the uniform register u1. The target register used for the second execution target instruction may be the first register v3. The register mapping table t31 may be updated according to the number (v3) of the first register v3 and the number (u1) of the uniform register u1. As can be seen, the uniform register u1 may be the second uniform register. As shown in FIG. 3, after updating the register mapping table t31, the idle uniform register indication table does not include the number (u1) of the uniform register u1.

[0045] As shown in FIG. 3 , the register mapping table t31 includes a first register identifier field and a uniform register identifier field. The data in the first row of the register mapping table t31 may be written after the first execution target instruction is executed. In the first row of the register mapping table t31, the value of the first register identifier field is v1, and the value of the uniform register identifier field is u0. The first register v1 may be a target register used for the first execution target instruction. The uniform register u0 corresponds to the first register v1. The data in the second row of the register mapping table t31 may be written after the second execution target instruction is executed. In the second row of the register mapping table t31, the value of the first register identifier field is v3, and the value of the uniform register identifier field is u1. As described above, the uniform register u1 corresponds to the first register v3.

[0046] For the sake of understanding, the above description of the register mapping table of the present disclosure is provided. When the register mapping table includes multiple rows of data, a large time resource overhead is required to determine whether a source register used in an instruction to be executed corresponds to a uniform register. Therefore, when writing to a uniform register, the register's instruction data may be updated, as described below.

[0047] In some embodiments, the register instruction data includes an instruction value for each of a plurality of first registers. The instruction value may be a first instruction value or a second instruction value. The first instruction value may indicate that the first register corresponds to one uniform register. The second instruction value may indicate that the first register does not correspond to any uniform register. For example, the first instruction value may be 1, and the second instruction value may be 0. As shown in FIG. 3, the register instruction data may be implemented as a register instruction table t32. The register instruction table includes numbers of a plurality of first registers. The numbers of the plurality of first registers include v0, v1, v2, v3, ..., v31.

[0048] In an embodiment of the present disclosure, the detection unit is further configured to update the register instruction data by updating the instruction value of a first register corresponding to a target register used in the execution target instruction to a first instruction value. For example, after writing the initial operation result corresponding to the second execution target instruction to uniform register u1, the instruction value of first register v3 can be updated to the first instruction value. As shown in FIG. 3, after updating the instruction value of first register v3 to the first instruction value, the instruction value corresponding to number v3 can be 1, indicating that the first register v3 corresponds to one uniform register. Also, the instruction value corresponding to number v1 can be 1, indicating that the first register v1 corresponds to one uniform register. According to an embodiment of the present disclosure, setting the register instruction data reduces the time overhead required to determine whether a source register corresponds to a uniform register with a small memory resource overhead, thereby contributing to further improving chip performance.

[0049] For ease of understanding, the above description of the present disclosure takes the example of the detection result indicating that multiple initial calculation results are the same. Hereinafter, the following description of the present disclosure will take the example of the detection result indicating that multiple initial calculation results are different.

[0050] In some embodiments, the detection unit is further configured to write the initial operation results to at least one first register in response to determining that there is a discrepancy between the initial operation results. For example, after executing the second target instruction, a third target instruction may be executed. The source registers used by the third target instruction may not correspond to any uniform register. Therefore, the manner of executing the third target instruction is the same as or similar to the manner of executing the first target instruction, and therefore, the present disclosure will not describe it here. However, in response to the third target instruction corresponding to the initial operation results, the detection unit 340 may determine that there is a discrepancy between the initial operation results and may write the initial operation results to a first register.

[0051] For ease of understanding, the present disclosure has been described above using an example in which the source registers do not correspond to any uniform registers. Hereinafter, the present disclosure will be described using an example in which the source registers correspond to uniform registers.

[0052] FIG. 4 is a schematic diagram of an instruction execution device according to one embodiment of the present disclosure.

[0053] 4, the apparatus 400 may include an instruction acquisition unit 401, a decoding unit 402, a scheduling unit 403, a sending unit 404, a dispatching unit 410, a plurality of computing units, and a write-back unit 450. The plurality of computing units may include a first computing unit 420 and a second computing unit 430. The apparatus 400 may further include a detection unit 440.

[0054] The instruction fetch unit 401 may fetch one initial instruction. The decode unit 402 may decode the initial instruction to obtain a fourth instruction to be executed. The source registers used for the fourth instruction to be executed may be a first register v1 and a first register v3. The scheduling unit 403 may schedule hardware resources associated with the fourth instruction to be executed to execute the instruction to be executed.

[0055] In some embodiments, the sending unit may be configured to determine whether the indication value of the first register used in the instruction to be executed is the first indication value, for example, the sending unit 404 may use the register indication table to determine whether the indication value of the first register used in the instruction to be executed is the first indication value.

[0056] In an embodiment of the present disclosure, the sending unit may be configured to, in response to determining that the indication value of the first register used in the execution target instruction is the first indication value, identify a source uniform register corresponding to the first register using the register mapping data. For example, the register indication table t42 may be used to determine that the indication value of the first register v1 is 1 and corresponds to one uniform register. The register indication table t42 may also be used to determine that the indication value of the first register v3 is 1 and corresponds to one uniform register. Next, the register mapping table t31 may be used to identify the uniform register u1 corresponding to the first register v3, or the uniform register u0 corresponding to the first register v1. As can be understood, the uniform register u1 and the uniform register u0 may be source uniform registers used in the fourth execution target instruction.

[0057] In an embodiment of the present disclosure, the sending unit may be configured to send read requests for source uniform registers, for example, a read request for uniform register u1 and a read request for uniform register u0, respectively. Data to be processed corresponding to the read requests may be provided to the computing unit when the dispatching unit dispatches a command.

[0058] In an embodiment of the present disclosure, the sending unit may be configured to send the instruction to be executed to the dispatching unit, for example, the fourth instruction to be executed may be sent to the dispatching unit 410.

[0059] In some embodiments, the dispatch unit 410 may be configured to determine whether any of the multiple source registers correspond to a uniform register.

[0060] In an embodiment of the present disclosure, the dispatch unit may be further configured to provide the target instruction to the first calculation unit as a uniform instruction in response to determining that the source registers used in the target instruction correspond to the uniform registers, respectively. For example, the first register v1 and the first register v3 used in the fourth target instruction correspond to the uniform registers u0 and u1, respectively, and provide the fourth target instruction to the first calculation unit 420. The first calculation unit 420 may perform a uniform arithmetic operation on the fourth target instruction to obtain a uniform arithmetic result of the fourth target instruction. The write-back unit 450 or the first calculation unit 420 may write the uniform arithmetic result to an idle uniform register. The idle uniform register may be, for example, the uniform register u2.

[0061] For ease of understanding, the present disclosure has been described above using an example in which multiple source registers each correspond to a single uniform register. However, the present disclosure is not limited thereto, and the multiple source registers used in an instruction may include source registers that correspond to uniform registers and source registers that do not correspond to uniform registers. This will be described below.

[0062] As shown in FIG. 4 , the instruction fetch unit 401 may fetch another initial instruction. The decode unit 402 may decode the initial instruction to obtain a fifth target instruction. Upon decoding, a plurality of source registers used for the fifth target instruction may be identified. The plurality of source registers may include a first source register and a second source register. The first source register used for the fifth target instruction may be the first register v1. The second source register used for the fifth target instruction may be the first register v31. The scheduling unit 403 may schedule hardware resources associated with the fifth target instruction to execute the target instruction.

[0063] Next, the sending unit 404 can use the register indication table to determine whether the indication value of the first register used in the instruction to be executed is the first indication value. For example, the indication value of the first register v1 is 1 and corresponds to one uniform register. The indication value of the first register v31 is 0 and does not correspond to any uniform register. Thus, the first source register corresponds to a uniform register, and the second source register does not correspond to any uniform register.

[0064] In an embodiment of the present disclosure, the sending unit may be configured to, in response to determining that the indication value of the first register used in the execution target instruction is the first indication value, identify a source uniform register corresponding to the first register using the register mapping data. For example, the register indication table t32 may be used to determine that the first register v1 corresponds to a uniform register. Then, the register mapping table t31 may be used to determine that the first register v1 corresponds to the uniform register u0. As can be seen, the uniform register u0 may be a source uniform register used in the fifth execution target instruction, and the first source register corresponds to the uniform register.

[0065] In an embodiment of the present disclosure, the sending unit may be configured to send a read request for a source uniform register, for example, a read request for uniform register u0 may be sent.

[0066] In addition, in an embodiment of the present disclosure, the sending unit may be configured to send a read request for the first register in response to determining that the indication value of the first register used in the instruction to be executed is the second indication value. For example, using the register indication table t32, it can be determined that the indication value of the first register v31 is the second indication value and does not correspond to any uniform register. The sending unit 404 can send a read request for the first register v31. As can be seen, the second source register does not correspond to a uniform register.

[0067] In an embodiment of the present disclosure, the sending unit may be configured to send the instruction to be executed to the dispatching unit, for example, the fifth instruction to be executed may be sent to the dispatching unit 410.

[0068] In some embodiments, the dispatch unit 410 may be configured to determine whether any of the multiple source registers correspond to a uniform register.

[0069] In an embodiment of the present disclosure, the dispatch unit may be further configured to dispatch the instruction to be executed to the second computation unit 430 in response to determining that at least one source register used by the instruction to be executed includes a first register that does not correspond to any uniform register. For example, the first register v1 used by the fifth instruction to be executed corresponds to the uniform register u0. The first register v31 used by the fifth instruction to be executed does not correspond to any uniform register, and the fifth instruction to be executed may be provided to the second computation unit 430.

[0070] In an embodiment of the present disclosure, the second calculation unit is further configured to execute a plurality of arithmetic operations of the execution target instruction based on a plurality of first process target data and a plurality of second process target data, thereby executing a plurality of arithmetic operations of the execution target instruction. The plurality of first process target data are obtained by copying data obtained from the uniform registers multiple times, and the second process target data are obtained from the second source register. For example, assuming that the first register is a vector register, the capacity of the first register may be 512 bits and can store sixteen 32-bit data. The capacity of the uniform register may be 32 bits and can store one 32-bit data. Thus, the data in the uniform register u0 is copied multiple times to obtain sixteen first process target data. The sixteen 32-bit data in the first register v31 become sixteen second process target data. The second calculation unit 430 executes a plurality of arithmetic operations of the fifth execution target instruction to obtain a plurality of initial operation results of the fifth execution target instruction. According to the embodiments of the present disclosure, when multiple source registers include uniform registers and non-uniform registers, data in the uniform registers can be copied, which helps the computing unit perform corresponding operations according to normal execution logic and improves the stability and accuracy of the chip.

[0071] In some embodiments, the detection unit may determine whether the initial operation results are the same. In response to determining that the initial operation results are the same, one of the initial operation results may be written to an idle uniform register. In response to determining that there is a difference between the initial operation results, the initial operation results may be written to at least one first register. For example, as described above, the detection result may be 1 or 0. If the detection result is 1, one initial operation result may be written to an idle uniform register. If the detection result is 0, the initial operation results may be written to at least one first register. For example, if there is a difference between the initial operation results of the fifth execution target instruction, the detection unit 440 may write the operation results to one idle first register. Alternatively, the detection unit 440 may provide a control signal to the write-back unit 450 to write the operation results to one idle first register.

[0072] As can be understood, the entire apparatus of the present disclosure has been further described above with reference to FIG. 4, and the first calculation unit of the present disclosure will now be further described.

[0073] FIG. 5 is a schematic diagram of multiple computing units according to one embodiment of the present disclosure.

[0074] 5, the dispatch unit 510 may dispatch an instruction to be executed to the first computing unit 520 or the second computing unit 530. For example, the dispatch unit 510 may dispatch the fourth instruction to be executed to the first computing unit 520 in one clock cycle. The dispatch unit 520 may dispatch the fifth instruction to be executed to the second computing unit 530 in the same clock cycle or the next clock cycle. This allows the first computing unit 510 and the second computing unit 520 to be busy at approximately the same time, thereby improving the utilization rate of computing resources.

[0075] In some embodiments, the first computation unit may include multiple computation subunits. As shown in FIG. 5, the first computation unit 510 may include M computation subunits. The M computation subunits include computation subunit 511, computation subunit 512, ..., computation subunit 513, where M is an integer greater than 1. For example, the first computation unit may be a multiply-accumulate (MAC) array. The computation subunit may be a subarray of the multiply-accumulate array. As can be appreciated, the first computation unit may be other computation units, and the present disclosure is not limited thereto.

[0076] In some embodiments, a uniform arithmetic operation may include multiple uniform arithmetic sub-operations. Multiple computation sub-units are configured to perform the multiple uniform arithmetic sub-operations to obtain a uniform arithmetic result. For example, a uniform arithmetic operation may be multiplying two 32-bit floating-point numbers. The multiple uniform arithmetic sub-operations included in the uniform arithmetic operation include a first uniform arithmetic sub-operation, a second uniform arithmetic sub-operation, and a third uniform arithmetic sub-operation. The first uniform arithmetic sub-operation may include multiplying the high-order components of the two 32-bit floating-point numbers to obtain a high-order result. The second uniform arithmetic sub-operation may include multiplying the low-order components of the two 32-bit floating-point numbers to obtain a low-order result. The third uniform arithmetic sub-operation determines the uniform arithmetic result based on the high-order and low-order result. As can be understood, the uniform arithmetic operation may be other operations, and the present disclosure is not limited thereto. The high-order component may be the 32nd to 17th bits of the floating-point numbers. The lower component may be the 16th to 1st bits of a floating point number.

[0077] In the embodiment of the present disclosure, the multiple computational subunits may be different stages of a pipeline. Computational subunit 511 may be a computational subunit of a first stage of the pipeline. Computational subunit 512 may be a computational subunit of a second stage of the pipeline. Computational subunit 513 may be a computational subunit of an Mth stage of the pipeline. As can be understood, for different computational operations, the computational subunits of different stages may perform multiple computational sub-operations in series or at least two computational sub-operations in parallel.

[0078] In an embodiment of the present disclosure, a target computing subunit among the plurality of computing subunits is configured to perform a target uniform arithmetic sub-operation among the plurality of uniform arithmetic sub-operations to obtain an intermediate arithmetic result. In response to determining that a subsequent computing subunit corresponding to a subsequent uniform arithmetic sub-operation of the target computing sub-operation is in an idle state, the target computing subunit provides the intermediate arithmetic result to the subsequent computing subunit. For example, for the above-mentioned uniform arithmetic sub-operation of multiplying two 32-bit floating-point numbers, the first uniform arithmetic sub-operation, the second uniform arithmetic sub-operation, and the third uniform arithmetic sub-operation correspond to the computing subunit 511, the computing subunit 512, and the computing subunit 513, respectively. The computing subunit 511, as the target computing subunit, can perform the first uniform arithmetic sub-operation to obtain a higher-level arithmetic result as an intermediate arithmetic result. The computing subunit 512, as the target computing subunit, can also perform the second uniform arithmetic sub-operation to obtain a lower-level arithmetic result as an intermediate arithmetic result. When the computing subunit 513 is idle, the target computing subunit can provide the higher-level arithmetic result and the lower-level arithmetic result to the computing subunit 513. As can be understood, for the uniform arithmetic operation, the computation sub-unit 513 may be a subsequent computation sub-unit.

[0079] In the embodiment of the present disclosure, the subsequent calculation sub-units in the plurality of calculation units are configured to perform subsequent uniform calculation sub-operations based on the intermediate calculation results to obtain subsequent calculation results. For example, the calculation sub-unit 513 can perform the third uniform calculation sub-operation to obtain a uniform calculation result. The uniform calculation result can be the subsequent calculation result of the upper or lower calculation result.

[0080] In an embodiment of the present disclosure, the target computing subunit is further configured to execute a computation sub-operation of a subsequent computing operation of the uniform computing operation. For example, after executing the first uniform computing sub-operation, the computing subunit 511 is in an idle state and can execute a computation sub-operation of the subsequent computing operation. This can reduce pipeline bubbles and improve instruction execution efficiency. While the computing subunit 513 executes a computation sub-operation, the computing subunit 511 can execute a computation sub-operation of another instruction, which can improve execution parallelism, accelerate instruction sending and dispatching efficiency, and achieve higher instruction execution efficiency.

[0081] As can be understood, the above description of the present disclosure is based on the example of the dispatch unit sequentially processing uniform commands and non-uniform commands, but the present disclosure is not limited thereto, and the dispatch unit may sequentially process multiple uniform commands.

[0082] In an embodiment of the present disclosure, there may be multiple instructions to be executed. The dispatch unit may be configured to dispatch uniform instructions to the first computation unit based on a target clock cycle. The target clock cycle may be a clock cycle in which it is determined that at least one source register used in the instruction to be executed corresponds to at least one uniform register. For example, the dispatch unit may consult the register indication table to determine whether one or more source registers are all uniform registers. Consulting the table may require one or more clock cycles. The clock cycle in which it is determined that one or more source registers are all uniform registers may be the target clock cycle. Based on the target clock cycle, the instruction to be executed can be dispatched to the first computation unit without delay.

[0083] In an embodiment of the present disclosure, the multiple uniform instructions received by the first computing unit may correspond to different delay parameters. For example, the delay parameter may correspond to one or more clock cycles. In the first clock cycle, the first computing unit may receive the sixth target instruction. In the second clock cycle, the first computing unit may receive the seventh target instruction. The seventh target instruction delay parameter causes a preceding computing subunit in the pipeline of the first computing unit (e.g., the computing subunit 511 or the computing subunit 512) to execute an operation sub-operation of the seventh target instruction after the preceding computing subunit executes an operation sub-operation of the sixth target instruction.

[0084] As can be appreciated, the above describes the apparatus of the present disclosure, and the following describes an apparatus that includes the apparatus.

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

[0086] 6, the device 6000 may include an instruction execution unit 600. The unit 600 may be the unit 100 or 400 described above.

[0087] As can be appreciated, having described the apparatus of the present disclosure above, the method of the present disclosure will now be described.

[0088] FIG. 7 is a flowchart of an instruction execution method according to one embodiment of the present disclosure.

[0089] As shown in FIG. 7, the method 700 may include operations S710 to S730.

[0090] In operation S710, in response to determining that at least one source register used in the instruction to be executed corresponds to at least one uniform register of the plurality of uniform registers, dispatch the instruction to be executed to the first computation unit as a uniform instruction, the uniform instruction including a plurality of uniform arithmetic operations. Operation S710 may be performed by the dispatch unit 110 described above.

[0091] In operation S720, a uniform arithmetic operation is performed using a first calculation unit to obtain a uniform arithmetic result, which may be the first calculation unit 120.

[0092] In operation S730, the uniform operation result is written to at least one available uniform register of the plurality of uniform registers.

[0093] As can be appreciated, the method 700 may be performed by the apparatus 100 or 400 described above.

[0094] In some embodiments, the method 700 further includes, in response to determining that at least one source register used by the target instruction includes a first register that does not correspond to any uniform register, dispatching the target instruction to a second computation unit, and using the second computation unit to perform a plurality of computation operations of the target instruction to obtain a plurality of initial computation results.

[0095] In some embodiments, the method 700 further includes, in response to determining that the initial operation results are the same as one another, writing the initial operation results to an idle uniform register.

[0096] In some embodiments, the method 700 further includes writing the plurality of initial operation results to at least one first register in response to determining that there is a discrepancy between the plurality of initial operation results.

[0097] In some embodiments, writing the initial operation result to the idle uniform register includes updating at least one of register indication data and register mapping data, wherein the register indication data includes indication values ​​of each of a plurality of first registers, the indication values ​​being a first indication value or a second indication value, the first indication value being used to indicate that the first register corresponds to one uniform register, the second indication value being used to indicate that the first register does not correspond to any uniform register, and the register mapping data being used to indicate the first register and the uniform register corresponding to the first register.

[0098] In some embodiments, updating at least one of the register instruction data and the register mapping data includes updating an instruction value of a first register in the register instruction data corresponding to a target register used in the instruction to be executed to a first instruction value, setting an idle uniform register as the uniform register corresponding to the target register used in the instruction to be executed, and updating the register mapping data with an identifier of the idle uniform register and an identifier of the target register.

[0099] In some embodiments, the method 700 further includes, in response to determining that the instruction value of the first register used in the instruction to be executed is the first instruction value, identifying a source uniform register corresponding to the first register using the register mapping data; sending a read request for the source uniform register; and sending the instruction to be executed to a dispatch unit.

[0100] In some embodiments, the method 700 further includes, in response to determining that the plurality of source registers used in the instruction to be executed correspond to the plurality of uniform registers, providing the instruction to be executed to the first computation unit as a uniform instruction.

[0101] In some embodiments, the plurality of source registers used by the executed instruction include a first source register and a second source register, where the first source register corresponds to a uniform register and the second source register does not correspond to any uniform register. Performing the plurality of arithmetic operations of the executed instruction using the second computation unit includes performing the plurality of arithmetic operations of the executed instruction based on a plurality of first process target data and a plurality of second process target data. The plurality of first process target data are obtained by copying data obtained from the uniform register multiple times, and the second process target data are obtained from the second source register.

[0102] In some embodiments, there are multiple instructions to be executed. The method 700 further includes dispatching the uniform instruction to the first compute unit based on a target clock cycle, the target clock cycle being a clock cycle in which it is determined that at least one source register used in the instruction to be executed corresponds to at least one uniform register.

[0103] In some embodiments, the first computing unit includes a plurality of computing sub-units, and the uniform computation operation includes a plurality of uniform computation sub-operations. Performing the uniform computation operation using the first computing unit to obtain the uniform computation result includes performing the plurality of uniform computation sub-operations using the plurality of computing sub-units to obtain the uniform computation result.

[0104] In some embodiments, performing a plurality of uniform arithmetic sub-operations using a plurality of computing subunits to obtain a uniform arithmetic result includes performing a target uniform arithmetic sub-operation of the plurality of uniform arithmetic sub-operations using a target computing subunit of the plurality of computing subunits to obtain an intermediate arithmetic result. In response to determining that a subsequent computing subunit corresponding to a subsequent uniform arithmetic sub-operation of the target arithmetic sub-operation is in an idle state, providing the intermediate arithmetic result to the subsequent computing subunit. Performing a subsequent uniform arithmetic sub-operation using the subsequent computing subunit based on the intermediate arithmetic result to obtain the subsequent arithmetic result.

[0105] In some embodiments, performing a plurality of uniform arithmetic sub-operations using a plurality of computational sub-units to obtain a uniform arithmetic result includes performing a arithmetic sub-operation of a successor arithmetic operation of the uniform arithmetic operation using a target computational sub-unit.

[0106] In some embodiments, the method 700 further includes performing a bitwise exclusive-or operation on the two initial operation results to obtain an exclusive-or operation result; performing a bitwise OR operation on the exclusive-or operation results to obtain an OR operation result; and performing a bitwise OR operation on the multiple OR operation results to obtain a detection result. The detection result is used to indicate whether the multiple initial operation results are the same.

[0107] In some embodiments, the method 700 further includes updating the register mapping data with at least one available uniform register to which the uniform operation result is written and at least one target register used by the instruction to be executed.

[0108] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, etc. of user personal information involved are all in accordance with the provisions of relevant laws and regulations and are not contrary to public order and morals.

[0109] According to embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.

[0110] 8 illustrates a schematic block diagram for implementing an exemplary electronic device 800 according to an embodiment of the present disclosure. The electronic device is intended to represent various types of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various types of mobile devices, such as personal digital assistants, mobile phones, smartphones, wearable devices, and other similar computing devices. The components, their connections and relationships, and their functions illustrated herein are merely exemplary and do not limit the implementation of the present disclosure as described and / or claimed herein.

[0111] 8, the device 800 includes a computing unit 801, which may perform various appropriate operations and processes based on a computer program stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may further store various programs and data necessary for the operation of the device 800. The computing unit 801, the ROM 802, and the RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0112] The components of the device 800 are connected to an I / O interface 805, which includes an input unit 806 such as a keyboard, a mouse, etc., an output unit 807 such as various types of displays, speakers, etc., a storage unit 808 such as a magnetic disk, an optical disk, etc., and a communication unit 809 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 enables the device 800 to exchange information and data with other devices via a computer network such as the Internet and / or various electrical networks.

[0113] The computing unit 801 may be various general-purpose and / or specialized processing modules having processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, computing units running various machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 executes each of the methods and processes described above, such as the instruction execution method. For example, in some embodiments, the instruction execution method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, some or all of the computer program may be loaded and / or installed into the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, it may perform one or more steps of the instruction execution method described above. Alternatively, in other embodiments, the computing unit 801 may be arranged to perform the instruction execution method in any other suitable manner (eg, via firmware).

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

[0115] Program code for implementing the methods 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 apparatus, so that when the program code is executed by the processor or controller, the functions and operations specified in the flowcharts and / or block diagrams are performed. The program code may be executed entirely on a device, partially on a device, partially on a device as a separate software package, and partially on a remote device, or entirely on a remote device or server.

[0116] In the context of this disclosure, a machine-readable medium may be a tangible medium, and may contain or store a program for use in or in connection with an instruction execution system, device, or electronic device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or electronic device, or any suitable combination of the above. More specific examples of machine-readable storage media include an electrical connection of one or more wires, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0117] To provide for user interaction, a computer may implement the systems and techniques described herein and include a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to a user, and a keyboard and pointing device (e.g., a mouse or trackball) through which a user can provide input to the computer. Other types of devices may also provide for user interaction; for example, the feedback provided to the user may be any form of sensing feedback (e.g., visual feedback, auditory feedback, or tactile feedback) and may receive input from the user in any form (including voice input, speech input, or tactile input).

[0118] The systems and techniques described herein can be implemented in a computing system including background components (e.g., a data server), or a computing system including middleware components (e.g., an application server), or a computing system including front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with embodiments of the systems and techniques described herein), or a computing system including any combination of such background, middleware, or front-end components. The components of the system can be connected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include, by way of example, a local area network (LAN), a wide area network (WAN), and the Internet.

[0119] A computer system may include clients and servers. Clients and servers are generally remote and typically interact through a communication network. The relationship of client and server is created by computer programs running on the corresponding computers and having the client-server relationship.

[0120] It should be understood that various types of flows shown above may be used, and operations may be rearranged, added, or deleted. For example, the operations described in this disclosure may be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this specification is not limited thereto.

[0121] The above specific embodiments do not limit the scope of protection of the present disclosure. Those skilled in the art should understand that various modifications, combinations, subcombinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present disclosure should be included within the scope of protection of the present disclosure.

Claims

1. An instruction execution device, a dispatch unit configured to, in response to determining that at least one source register used in the instruction to be executed corresponds to at least one uniform register of the plurality of uniform registers, dispatch the instruction to be executed to the first computation unit as a uniform instruction including a plurality of uniform arithmetic operations; a first calculation unit configured to perform the uniform arithmetic operation to obtain a uniform arithmetic result, the uniform arithmetic result being written to at least one available uniform register of the plurality of uniform registers; Instruction execution device.

2. The dispatch unit further comprises: configured to dispatch the instruction to be executed to a second computation unit in response to determining that at least one source register used by the instruction to be executed includes a first register that does not correspond to any of the uniform registers; the second computation unit is arranged to perform a plurality of computation operations of the target instruction to obtain a plurality of initial computation results; 10. The apparatus of claim 1.

3. 3. The apparatus of claim 2, further comprising a detection unit, the detection unit being configured to write the initial operation result to an idle uniform register in response to determining that a plurality of the initial operation results are the same as one another.

3. The apparatus of claim 2.

4. the detection unit is further configured to write the plurality of initial operation results to at least one first register in response to determining that there is a difference between the plurality of initial operation results.

4. The apparatus of claim 3.

5. the detection unit is further configured to write the initial operation result to an idle uniform register by updating at least one of register indication data and register mapping data; the register indication data includes indication values ​​of each of the plurality of first registers, the indication values ​​being first indication values ​​or second indication values, the first indication value being used to indicate that the first register corresponds to one of the uniform registers, the second indication value being used to indicate that the first register does not correspond to any of the uniform registers, and the register mapping data being used to indicate the first register and the uniform register corresponding to the first register; 4. The apparatus of claim 3.

6. The detection unit is further arranged to update at least one of register indication data and register mapping data by performing the following operations: The operation is updating a pointer value of a first register corresponding to a target register used in the execution target instruction, among the pointer data of the registers, to the first pointer value; setting the idle uniform register as a uniform register corresponding to a target register used in the execution target instruction, and updating the register mapping data with an identifier of the idle uniform register and an identifier of the target register; 6. The apparatus of claim 5.

7. further comprising a transmitting unit; The transmitting unit In response to determining that a pointer value of a first register used in the execution target instruction is the first pointer value, identifying a source uniform register corresponding to the first register using the register mapping data; Sending a read request for the source uniform register; configured to transmit the instructions to be executed to the dispatch unit; 6. The apparatus of claim 5.

8. The dispatch unit further comprises: is configured to provide the target instruction to the first computation unit as a uniform instruction in response to determining that a plurality of the source registers used in the target instruction correspond to a plurality of the uniform registers, respectively.

10. The apparatus of claim 1.

9. the plurality of source registers used for the execution target instruction include a first source register and a second source register, the first source register corresponds to the uniform register, and the second source register does not correspond to any of the uniform registers; the second computation unit is further arranged to perform a plurality of arithmetic operations of the target instruction by performing the following operations: the operation is an operation of executing a plurality of arithmetic operations of the execution target instruction based on a plurality of first process target data and a plurality of second process target data, the plurality of first process target data being obtained by copying data obtained from the uniform register a plurality of times, and the second process target data being obtained from the second source register; 3. The apparatus of claim 2.

10. the execution target instructions are plural, the dispatch unit is further configured to dispatch the uniform instruction to the first computation unit based on a target clock cycle, the target clock cycle being a clock cycle in which it is determined that at least one source register used in the instruction to be executed corresponds to at least one of the uniform registers; 10. The apparatus of claim 1.

11. The first computation unit includes a plurality of computation sub-units, and the uniform computation operation includes a plurality of uniform computation sub-operations; a plurality of said computation sub-units are arranged to perform a plurality of said uniform computation sub-operations to obtain said uniform computation result; 10. The apparatus of claim 1.

12. A target computing subunit of the plurality of computing subunits is executing a target uniform arithmetic sub-operation of the plurality of uniform arithmetic sub-operations to obtain an intermediate arithmetic result; providing the intermediate operation result to a subsequent computing subunit corresponding to a subsequent uniform computing sub-operation of the target computing sub-operation in response to determining that the subsequent computing sub-unit is in an idle state; the subsequent calculation sub-units in the plurality of computing elements are arranged to perform the subsequent uniform arithmetic sub-operation based on the intermediate operation result to obtain a subsequent operation result; 12. The apparatus of claim 11.

13. the target computation subunit is further configured to perform a computation sub-operation of a successor computation operation of the uniform computation operation; 13. The apparatus of claim 12.

14. The detection unit includes a plurality of first detection modules and a second detection module, the first detection modules including a bitwise exclusive-OR operator and a first bitwise OR operator, and the second detection modules including a second bitwise OR operator; the bitwise exclusive-OR operator is arranged to perform a bitwise exclusive-OR operation on the two initial operation results to obtain an exclusive-OR operation result; the first bitwise OR operator is arranged to perform a bitwise OR operation on the exclusive OR operation result to obtain a bitwise OR operation result; the second bitwise OR operator is arranged to perform a bitwise OR operation on a plurality of the OR operation results to obtain a detection result for indicating whether the plurality of initial operation results are the same or not.

4. The apparatus of claim 3.

15. An electronic device comprising a device according to any one of claims 1 to 14.

16. 1. An instruction execution method, comprising: In response to determining that at least one source register used in the instruction to be executed corresponds to at least one uniform register among a plurality of uniform registers, dispatching the instruction to be executed to a first computation unit as a uniform instruction including a plurality of uniform arithmetic operations; performing the uniform arithmetic operation using the first computing unit to obtain a uniform arithmetic result; writing the uniform operation result to at least one available uniform register of the plurality of uniform registers; Instruction execution method.

17. In response to determining that at least one source register used by the instruction to be executed includes a first register that does not correspond to any of the uniform registers, dispatching the instruction to be executed to a second computation unit; and performing a plurality of arithmetic operations of the target instruction using the second calculation unit to obtain a plurality of initial calculation results.

17. The method of claim 16.

18. and further including, in response to determining that the plurality of initial operation results are the same as one another, writing the initial operation results to an idle uniform register.

18. The method of claim 17.

19. and further comprising, in response to determining that there is a difference between the plurality of initial operation results, writing the plurality of initial operation results to at least one first register.

18. The method of claim 17.

20. Writing the initial operation result to an idle uniform register updating at least one of register indication data and register mapping data, wherein the register indication data includes indication values ​​of each of a plurality of the first registers, the indication values ​​being first indication values ​​or second indication values, the first indication value being used to indicate that the first register corresponds to one of the uniform registers, the second indication value being used to indicate that the first register does not correspond to any of the uniform registers, and the register mapping data being used to indicate the first register and the uniform register corresponding to the first register; 20. The method of claim 18.

21. Updating at least one of the register indication data and the register mapping data includes: updating a pointer value of a first register corresponding to a target register used in the execution target instruction, among the pointer data of the registers, to the first pointer value; setting the idle uniform register as a uniform register corresponding to a target register used in the execution target instruction, and updating the register mapping data with an identifier of the idle uniform register and an identifier of the target register; 21. The method of claim 20.

22. In response to determining that a pointer value of a first register used in the execution target instruction is the first pointer value, identifying a source uniform register corresponding to the first register using the register mapping data; sending a read request for the source uniform register; sending the instructions to be executed to the dispatch unit.

21. The method of claim 20.

23. and providing the target instruction to the first computation unit as a uniform instruction in response to determining that the source registers used in the target instruction correspond to the uniform registers, respectively.

17. The method of claim 16.

24. the plurality of source registers used for the execution target instruction include a first source register and a second source register, the first source register corresponds to the uniform register, and the second source register does not correspond to any of the uniform registers; Executing a plurality of arithmetic operations of the target instruction using the second computation unit includes: Executing a plurality of arithmetic operations of the execution target instruction based on a plurality of first process target data and a plurality of second process target data, wherein the plurality of first process target data are obtained by copying data obtained from the uniform register a plurality of times, and the second process target data is obtained from the second source register; 18. The method of claim 17.

25. the execution target instructions are plural, and dispatching the uniform instruction to the first computation unit based on a target clock cycle, the target clock cycle being a clock cycle in which it is determined that at least one source register used in the instruction to be executed corresponds to at least one of the uniform registers.

17. The method of claim 16.

26. The first computation unit includes a plurality of computation sub-units, and the uniform computation operation includes a plurality of uniform computation sub-operations; performing the uniform arithmetic operation using the first computing unit to obtain a uniform arithmetic result, performing a plurality of the uniform arithmetic sub-operations using the plurality of computation sub-units to obtain the uniform arithmetic result; 17. The method of claim 16.

27. Executing a plurality of the uniform arithmetic sub-operations using the plurality of computation sub-units to obtain the uniform arithmetic result includes: performing a target uniform arithmetic sub-operation of the plurality of uniform arithmetic sub-operations using a target computation sub-unit of the plurality of computation sub-units to obtain an intermediate computation result; providing the intermediate operation result to a subsequent computing subunit corresponding to a subsequent uniform computing sub-operation of the target computing sub-operation in response to determining that the subsequent computing sub-unit is in an idle state; and performing the subsequent uniform arithmetic sub-operation using the subsequent calculation sub-unit based on the intermediate arithmetic result to obtain a subsequent arithmetic result.

17. The method of claim 16.

28. Executing a plurality of the uniform arithmetic sub-operations using the plurality of computation sub-units to obtain the uniform arithmetic result includes: performing a computation sub-operation of a successor computation operation of the uniform computation operation using the target computation sub-unit; 28. The method of claim 27.

29. performing a bitwise exclusive-OR operation on the two initial operation results to obtain an exclusive-OR operation result; performing a bitwise OR operation on the exclusive OR operation result to obtain a logical OR operation result; performing a bitwise OR operation on the plurality of OR results to obtain a detection result indicating whether the plurality of initial operation results are the same.

20. The method of claim 18.

30. updating register mapping data using the at least one available uniform register into which the uniform operation result is written and at least one target register used by the instruction to be executed; 21. The method of claim 20.

31. at least one processor; a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor such that the at least one processor can perform the method of any one of claims 16 to 30; electronic equipment.

32. A non-transitory computer-readable storage medium having computer instructions stored thereon, comprising: The computer instructions are used to cause the computer to carry out the method according to any one of claims 16 to 30. A non-transitory computer-readable storage medium.

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

Citation Information

Patent Citations

  • Method and Computing System for Handling Instruction Execution Using Affine Register File on Graphic Processing Unit

    US20170269931A1

  • Scalarization of instructions for SIMT architectures

    US20240118899A1