Execution of floating-point multiply-add operations in a computer implementation environment
The soFMA unit addresses inefficiencies in AI accelerators by eliminating hardware overhead in data loading, enhancing efficiency and supporting all floating-point values, thus improving performance and reducing power consumption.
Patent Information
- Application Number
- JP2024520783
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-10-27
- Filing Date
- 2022-10-24
- Publication Date
- 2024-10-18
AI Technical Summary
Existing AI accelerator architectures face inefficiencies due to infrastructure overhead such as control complexity, wiring, and memory footprint, which reduce overall efficiency in floating-point operations, particularly in loading data into local register files.
A method and apparatus using a selectable arithmetic floating-point multiply-accumulate (soFMA) unit that eliminates the need for bypass logic, second write ports, and dedicated load instructions by allowing operand substitution with predefined values, reducing hardware overhead and supporting all floating-point values, including normalized and subnormal values.
This approach enhances efficiency by reducing area and power consumption, minimizing wiring complexity, and enabling multiple instruction multiple data execution on single instruction multiple data processors, allowing vectorization of non-vectorizable workloads.
Smart Images

Figure 2024538012000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates generally to data processing computer systems, and more particularly to a processor-implemented method and apparatus for performing floating-point multiply-add operations on at least one multiply-add unit. [Background technology]
[0002] A typical artificial intelligence (AI) accelerator consists of an array of many processing tiles (PTs) or processing elements (PEs) optimized for high throughput or high efficiency, measured in floating-point operations per second (FLOPS) (FLOPS / watt or FLOPS / area). The infrastructure overhead within a tile, e.g., control complexity, wiring and memory footprint, multiplies with the number of tiles, reducing the overall efficiency of the method. For example, a "load" instruction that writes unmodified data to a local register file (LRF) for reuse requires dedicated instruction and decode logic, a second write port or bypass logic and control to the LRF, and finally collision avoidance. These features are utilized for only a small fraction of the total computation time. Thus, there is a need for an efficient infrastructure to load floating-point values into the LRF without hardware overhead.
[0003] US 2019 / 0042254 A1 discloses a system and method for loading tile register pairs. A processor is disclosed that includes a decode circuit for decoding a load matrix pair instruction having an opcode and fields for source and destination identifiers for identifying source and destination matrices, respectively, each matrix having a PAIR parameter equal to TRUE, and an execution circuit for executing the decoded load matrix pair instruction to load all elements of left and right tiles of an identified destination matrix from corresponding element positions of left and right tiles of an identified source matrix, respectively, the execution operating on one row of the identified destination matrix at a time, starting with the first row.
[0004] This reference uses additional dedicated load / store instructions to load / store register pairs. The system requires tile configuration using additional dedicated instructions (TILECONFIG, TILERELEASE, etc.).
[0005] US 2021 / 0089316 A1 discloses a deep learning implementation using systolic arrays and fusion operations. A processor is disclosed that includes a fetch and decode circuit for fetching and decoding instructions having an opcode and fields specifying a destination and a location of N source matrices, where the opcode indicates that the processor loads the N source matrices from memory, performs N convolutions on the N source matrices to generate N feature maps, and stores the results of the N convolutions in registers to be passed to an activation layer, and the processor performs N convolutions and activation layers with at most one memory load for each of the N source matrices. The processor further includes a scheduling circuit for scheduling execution of the instructions, and an execution circuit for executing the instructions according to the opcode.
[0006] This reference focuses on convolution and subsequent layer applications. The disclosed implementation uses additional dedicated load / store instructions to load / store register pairs. The system requires tile configuration using additional dedicated instructions (TILECONFIG, TILERELEASE, etc.).
[0007] US 9,778,908 B2 discloses a method provided in a microprocessor for performing a fused multiply-accumulate operation of the form ±A*B±C, where A, B, and C are input operands, and no rounding occurs before C is accumulated to the product of A and B. The fused multiply-accumulate operation is divided into a first and a second multiply-accumulate sub-operation to be executed by one or more instruction execution units. In the first multiply-accumulate sub-operation, a selection is made whether to accumulate the partial products of A and B with C, or instead to accumulate only the partial products of A and B and generate therefrom an undrounded non-redundant sum. Between the first and second multiply-accumulate sub-operations, the undrounded non-redundant sum is stored in memory to enable one or more instruction execution units to perform other operations unrelated to the multiply-accumulate operation. Alternatively or additionally, the undrounded non-redundant sum is transferred from the first instruction execution unit to the second instruction execution unit. In the second multiply-accumulate sub-operation, C is accumulated with the undone non-redundant sum if the first multiply-accumulate sub-operation produced an undone non-redundant sum without accumulating C. In the second multiply-accumulate sub-operation, a final rounded result is produced from the fused multiply-accumulate operation.
[0008] This reference explains that the fused multiply-accumulate operation can compute A*B by, among other things, setting C to 0. This is not possible for IEEE compliant floating-point numbers because it results in a difference case where -0.0 in either A or B when added to +0.0 is exactly zero, and therefore the result has the wrong sign. Summary of the Invention
[0009] A computer-implemented method includes performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit, and relates to a processor having at least one device for performing the floating-point multiply-add operation and a non-transitory machine-readable medium comprising instructions for performing the floating-point multiply-add operation.
[0010] A processor-implemented method is proposed for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit with three input floating-point operands A, B, C, where at least one of the operands A, B, C is replaced by at least one value from a predefined set of operand values.
[0011] The method of the present invention uses a selectable-operation floating-point-multiply-add (soFMA) unit, which represents a software implementation and hardware implementation that enhances that of a floating-point-multiply-add (FMA) unit, where the FMA unit inputs values A, B, and C and calculates a value D=A*B+C as output by the FMA unit.
[0012] The benefits of the proposed method are that no bypass logic is required to perform the load operation, no second write port is required within the LRF, and no dedicated load instruction and decode logic is required.
[0013] Thus, area and power savings may be advantageous. Wiring complexity and routing congestion is reduced. The method supports all floating-point values, normalized and denormalized floating-point values.
[0014] The method enables multiple instruction multiple data (MIMD)-like execution on a single instruction multiple data (SIMD) processor at reduced cost.
[0015] The method enables vectorization of workloads that are not normally considered vectorizable.
[0016] According to one embodiment of the invention, in addition or alternatively, the method may further comprise at least providing at least one of the floating-point operands A, B, C by a substitution logic, and configuring the substitution logic to be separately configurable to replace the operands A, B, C with at least one value of a predefined set of operand values that is propagated to at least one output port of the substitution logic, such that the substitution logic passes any floating-point value unchanged or allows a correct IEEE compliant floating-point multiplication, addition, or multiply-add operation to be performed using the soFMA unit.
[0017] According to one embodiment of the present invention, the permutation logic may additionally or alternatively be configured as a multiplexer circuit. The method may further comprise at least the steps of providing at least one of the three floating-point operands A, B, C by a multiplexer circuit, respectively, where the multiplexer circuit comprises a first input port for each floating-point operand A, B, C, and at least a second input port for at least one value of a predefined operand value set, and at least one output port, and configuring the multiplexer circuit to be separately configurable to select one of the input ports to be propagated to the at least one output port. Advantageously, the input values for the soFMA unit may be controlled in an efficient manner.
[0018] According to one embodiment of the method of the present invention, one or two or all three of the input operands A, B, C may each be provided by a multiplexer circuit. A first multiplexer circuit for a first input port of the soFMA unit may provide the first operand value A or one of the values from a set including values −0, +0, +1, −1. Similarly for the second operand value B and the third operand value C.
[0019] For example, by selecting a value +1 in the first multiplexer circuit, the soFMA unit performs the operation B+C. The method includes a selection code that encodes the selection by each of the input multiplexer circuits of the soFMA unit. For example, for a soFMA unit having three multiplexer circuits for operands A, B, C, 12 different selection codes including values 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 may correspond to 12 different selectable operations -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C performed by the soFMA unit. The IEEE floating-point standard allows for correct results for the selectable operations for all input operand values A, B, C.
[0020] According to one embodiment of the present invention, in addition or alternatively, the floating-point multiply-add operation may be triggered by an instruction having a select code parameter that specifies the configuration of the replacement logic, so that the input values for the soFMA unit may be controlled in an efficient manner.
[0021] According to one embodiment of the present invention, the predefined operand value set may additionally or alternatively be configured as a set including at least the values −0, +0, +1, −1, such that the constant values serve to control floating-point operations in an appropriate manner.
[0022] According to one embodiment of the invention, additionally or alternatively, one of the input ports may be selected for propagation to at least one output port by a selection code parameter, which is at least one of a set corresponding to a selectable operation comprising the parameters −0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, −A+C, −B+C. In this way, the steps required to perform the floating-point operation may be selected in an appropriate manner.
[0023] According to one embodiment of the invention, additionally or alternatively, a floating-point multiply-add operation of the form A0*B0+A1*B1+C may be performed using input floating-point operands including operands A0, A1, B0, B1, C. Thus, the method allows a concatenated pair of two arbitrary floating-point values to be loaded into the register file via a floating-point multiply-add (FMMA) unit.
[0024] According to one embodiment of the present invention, in addition or alternatively, the floating-point operand may be provided as an input operand by a register file, and the output may be received from the permutation logic by a register file having at least two read ports and one write port. In particular, the input operand may be provided and triggered by an instruction having a selection code parameter. Thus, it is advantageously possible to load any floating-point value into the register file via the soFMA unit.
[0025] In accordance with one embodiment of the present invention, additionally or alternatively, when the processor further comprises an interconnected mesh of devices each having at least one multiply-accumulate unit, where each multiply-accumulate unit comprises at least one local register file for intermediate storage of data values, a floating-point multiply-accumulate operation may be triggered by an instruction having a select code parameter that specifies the configuration of the replacement logic.
[0026] One embodiment of the method of the present invention enhances that of a dataflow device consisting of an interconnected mesh of FMA units, where each FMA unit has a local register for intermediate storage of values. In such a dataflow device, the soFMA unit may reduce the hardware required to support storing values from the mesh to local registers. A dataflow device consisting of an interconnected mesh of soFMA units may result in higher application performance.
[0027] In accordance with one embodiment of the present invention, in addition or alternatively, the processor further comprises a single instruction multiple data device having multiple devices each having at least one multiply-accumulate unit, and selects to perform a floating-point multiply-accumulate operation for each device when the instruction can specify that a predicate value for each device is provided by a predicate register.
[0028] Further embodiments of the method of the present invention enhance a single instruction multiple data (SIMD) device in a CPU core. The SIMD device includes multiple FMA units. For a SIMD device, a software instruction may specify a register providing a predicate value for each FMA to select execution of each FMA's instruction. In a SIMD device with soFMA units, a software instruction may specify a register providing a selection code for each soFMA to select execution of each soFMA's instruction. A SIMD device with soFMA units may provide higher application performance than a SIMD with FMA units. A SIMD device with soFMA units is a type of MIMD device. The higher performance results from three reasons: it allows vectorization of inequality operations, thus allowing benefit from the parallel structure of SIMD devices; fewer instructions are required, since IF-ELSE statements can be reduced or replaced with predicates; the reduction in IF-ELSE statements results in fewer time-consuming pipeline flushes resulting from incorrect branch predictions.
[0029] According to one embodiment of the present invention, in addition or alternatively, the predicate register further comprises a multi-bit predicate field having a predicate value, which, if enabled by the instruction, may be executed on the lanes of the device to change the type of the individual lanes based on the respective predicate value for each lane. Thus, the method enables dynamic multi-bit predication of individual SIMD lanes based on a previous result vector.
[0030] According to one embodiment of the present invention, in addition or alternatively, at least one operand of an internal operation in at least one multiply-accumulate unit of the device may be replaced with at least one value of a predefined set of operand values. The operation may be triggered by a predicate value that is assigned and decoded by a predicate logic into a selection code parameter based on a predicate value provided by a load-store unit, a result of a previous instruction, and information about dynamic or static usage. Thus, in a SIMD approach, the method may be further used in conjunction with a predicate to enable each individual SIMD lane to perform various operations.
[0031] Further, an apparatus is proposed for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit using the method described above, with three input floating-point operands A, B, C, where at least one of the floating-point operands A, B, C is provided by a substitution logic configured to be separately configurable to replace the operand A, B, C with at least one value of a predefined set of operand values that is propagated to at least one output port of the substitution logic.
[0032] The apparatus comprises at least one selectable arithmetic floating-point multiply-accumulate (soFMA) unit, which exhibits software usage and hardware implementations that enhance those of a floating-point multiply-accumulate (FMA) unit, where the FMA unit inputs values A, B, C and calculates a value D=A*B+C as output by the FMA unit.
[0033] The benefits of the proposed device are that no bypass logic is required to perform floating-point multiply-add operations. No second write port is required in the LRF. Furthermore, no dedicated load instruction and decode logic is required.
[0034] Thus, area and power savings may be advantageous. Wiring complexity and routing congestion is reduced. The device supports all floating point values, normalized and denormalized floating point values.
[0035] According to one embodiment of the present invention, in addition or alternatively, the permutation logic may be configured as a multiplexer circuit, with at least one of the three floating-point operands A, B, C being provided by each of the multiplexer circuits. The multiplexer circuits may comprise a first input port for each floating-point operand A, B, C, at least a second input port for at least one value of the predefined set of operand values, and at least one output port assigned to the corresponding first and second input port. The multiplexer circuits may be configured to be separately configurable to select one of the input ports to be propagated to the at least one output port.
[0036] Depending on the embodiment, one or two or all three of the input operands A, B, C may each be provided by a multiplexer circuit. A first multiplexer circuit for a first input port of the soFMA unit may provide the first operand value A or one of the values from a set including values −0, +0, +1, −1. Similarly for the second operand value B and the third operand value C.
[0037] For example, by selecting a value +1 in the first multiplexer circuit, the soFMA unit performs the operation B+C. The method includes a selection code that encodes the selection by each of the input multiplexer circuits of the soFMA unit. For example, for a soFMA unit having three multiplexer circuits for operands A, B, C, 12 different selection codes including values 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 may correspond to 12 different selectable operations -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C performed by the soFMA unit. The IEEE floating-point standard allows for correct results for the selectable operations for all input operand values A, B, C.
[0038] According to one embodiment of the present invention, a floating-point multiply-add operation may additionally or alternatively be triggered by an instruction having a selection code parameter that specifies the configuration of at least one permutation logic, such that input values for the soFMA unit may be controlled in an efficient manner.
[0039] According to one embodiment of the present invention, the predefined operand value set may additionally or alternatively be configured as a set including at least the values −0, +0, +1, −1, such that the constant values serve to control floating-point operations in an appropriate manner.
[0040] According to one embodiment of the invention, additionally or alternatively, the selection code parameter used to select one of the input ports to be propagated to the at least one output port may be at least one of a set corresponding to selectable operations comprising: -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C. In this way, the steps required to perform the floating-point operation may be selected in an appropriate manner.
[0041] According to one embodiment of the present invention, the apparatus may additionally or alternatively include at least one multiply-accumulate unit having three inputs, at least one input being received from an output of at least one permutation logic, such that at least one input may be used to control floating-point operations performed by the FMA unit.
[0042] According to one embodiment of the present invention, in addition or alternatively, the device may comprise a register file having at least two read ports and one write port, the register file may be configured to provide input operands and to receive outputs from the multiply-accumulate unit. In particular, the register file may provide input operands triggered by an instruction having a select code parameter. Thus, it is advantageously possible to load any floating-point value into the register file via the soFMA unit.
[0043] According to one embodiment of the invention, additionally or alternatively, the apparatus may be configured to perform a floating-point multiply-add operation of the form A0*B0+A1*B1+C, with input floating-point operands including A0, A1, B0, B1, C. Thus, the apparatus allows a concatenated pair of two arbitrary floating-point values to be loaded into a register file via a floating-point multiply-add (FMMA) unit.
[0044] Further, a processor is proposed comprising at least one unit for performing a floating-point multiply-add operation, wherein at least one of the floating-point operands A, B, C are each provided by a permutation logic, and the floating-point multiply-add operation is triggered by an instruction having a select code parameter specifying the configuration of the permutation logic.
[0045] Advantageously, the processor comprises at least one device having at least one selectable arithmetic floating-point multiply-accumulate (soFMA) unit, the soFMA unit exhibiting software usage and hardware implementations that enhance those of a floating-point multiply-accumulate (FMA) unit, the FMA unit inputting values A, B, C to calculate a value D=A*B+C as output by the FMA unit.
[0046] Such a processor offers advantageous area and power savings. Wiring complexity and routing congestion is reduced. The processor supports all floating-point values, normalized and denormalized floating-point values.
[0047] In accordance with one embodiment of the present invention, in addition or alternatively, a processor may have a single instruction multiple data device having multiple units, and a predicate register is specified to select execution of a floating-point multiply-add operation for each unit by an instruction providing a predicate value for each unit.
[0048] The embodiments enhance a single instruction multiple data (SIMD) device in a CPU core. The SIMD device includes multiple FMA units. For a SIMD device, a software instruction may specify a register that provides a predicate value for each FMA to select execution of an instruction for each FMA. In a SIMD device with an soFMA unit, a software instruction may specify a register that provides a selection code for each soFMA to select execution of an instruction for each soFMA. A SIMD device with an soFMA unit may provide higher application performance than a SIMD with an FMA unit. A SIMD device with an soFMA unit is a type of MIMD device.
[0049] According to one embodiment of the present invention, in addition or alternatively, the predicate register may comprise a multi-bit predicate field having a predicate value, which is enabled by an instruction to execute the predicate value on the lanes of the device to change the type of the individual lanes based on the respective predicate for each lane. Thus, the method enables dynamic multi-bit predication of individual SIMD lanes based on a previous result vector.
[0050] According to one embodiment of the present invention, in addition or alternatively, at least one multiply-accumulate unit may be configured to replace at least one operand of an internal operation with at least one value of a predefined set of operand values. The operation may be triggered by a predicate value that is assigned and decoded by a predicate logic into a selection code parameter based on a predicate value provided by a load-store unit, a result of a previous instruction, and information about dynamic or static usage. Thus, in a SIMD approach, the method may be further used in conjunction with a predicate to enable each individual SIMD lane to perform various operations.
[0051] Further proposed is a non-transitory machine-readable medium comprising instructions for performing, on at least one multiply-add unit, a floating-point multiply-add operation of the form A*B+C using the method described above, with three input floating-point operands A, B, C, where at least one of the operands A, B, C is replaceable by at least one value of a predefined set of operand values.
[0052] The method of the present invention uses a Selectable Arithmetic Floating-Point Multiply-Add (soFMA) unit, which represents a software implementation and hardware implementation that enhances that of a Floating-Point Multiply-Add (FMA) unit, where the FMA unit inputs values A, B, and C and calculates a value D=A*B+C as output by the FMA unit.
[0053] The method enables multiple instruction multiple data (MIMD)-like execution on a single instruction multiple data (SIMD) processor at reduced cost.
[0054] The method enables vectorization of workloads that are not normally considered vectorizable. [Brief description of the drawings]
[0055] The present invention, together with the above-mentioned and other objects and advantages, may best be understood from the following detailed description of certain illustrative, but not limiting, implementations.
[0056] [Figure 1] FIG. 2 is a block diagram illustrating an apparatus for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit with three input floating-point operands A, B, and C, in accordance with one embodiment of the present invention.
[0057] [Diagram 2] 2 is a flow chart illustrating operations for performing a floating-point multiplication, addition, or multiply-and-accumulate operation of the form A*B+C, according to one embodiment of the present invention having an apparatus according to FIG. 1;
[0058] [Diagram 3] FIG. 11 is a schematic block diagram of an apparatus for performing floating-point multiply-add operations according to a further embodiment of the present invention using a multiplexer circuit;
[0059] [Figure 4] FIG. 11 is a schematic block diagram of an apparatus for performing floating-point multiply-add operations according to a further embodiment of the present invention using a register file;
[0060] [Diagram 5] FIG. 11 is a schematic block diagram of a processor with a single instruction multiple data device having multiple units with at least one multiply-accumulate unit according to a further embodiment using predicates;
[0061] [Figure 6] FIG. 11 is a schematic block diagram of a processor with a single instruction multiple data device having multiple units with at least one multiply-accumulate unit according to a further embodiment using dynamic multi-bit predication of individual SIMD lanes based on a previous result vector.
[0062] [Figure 7] FIG. 13 is a schematic diagram illustrating an example implementation of dynamic predicate decode logic according to further embodiments.
[0063] [Figure 8] 4 is a schematic block diagram of an apparatus for performing floating-point multiply-add operations in accordance with a further embodiment of the present invention;
[0064] [Figure 9] 5 is a flowchart illustrating the operation of an exemplary matrix multiplication program in accordance with further embodiments of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0065] In the drawings, like elements are referred to with the same reference numerals. The drawings are merely schematic representations and are not intended to portray specific parameters of the invention. Moreover, the drawings are intended to depict only typical implementations of the invention and therefore should not be considered as limiting the scope of the invention.
[0066] Exemplary embodiments described herein provide an apparatus for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit using the method described above, with three input floating-point operands A, B, C, where at least one of the floating-point operands A, B, C is provided by substitution logic configured to be separately configurable to replace the operand A, B, C with at least one value of a predefined set of operand values that is propagated to at least one output port.
[0067] Exemplary embodiments may further be used for a method for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit with three input floating-point operands A, B, C, where at least one of the operands A, B, C is replaced by at least one value of a predefined set of operand values.
[0068] FIG. 1 illustrates an apparatus 10 for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit 15, with three input floating-point operands A, B, C, in accordance with one embodiment of the present invention.
[0069] Apparatus 10 represents a processing tile comprising an FMA unit 15 and three operand permutation logic units 94 , 95 , 96 .
[0070] Floating point operands A, B, C are provided by substitution logic 94, 95, 96. The substitution logic 94, 95, 96 are configured to be separately configurable to substitute the operands A, B, C with at least one value of a predefined set of operand values 50 that is propagated as inputs 90, 91, 92 of the FMA unit 15 to at least one output port 17, 18, 19 of the substitution logic 94, 95, 96.
[0071] The floating point multiply-add operation is triggered by an instruction 16 having a selection code parameter that specifies the configuration of at least one of the permutation logic 94,95,96.
[0072] The predefined operand value set 50 is configured as at least a set including the values -0, +0, +1, and -1.
[0073] The multiply-accumulate unit 15 has three inputs 90,91,92, at least one of the inputs 90,91,92 being received from an output 17,18,19 of at least one permutation logic 94,95,96.
[0074] The floating point multiply-add operation is triggered by an instruction 16 having a select code parameter that specifies the configuration of the substitution logic 94,95,96.
[0075] Operand substitution logic 94 may be configured by a mode control input to pass either input A or one of the well-defined floating-point constants 0x8000 (−0.0) or 0x3E00 (1.0) from predefined operand value set 50 to operand A of FMA unit 15. Operand substitution logic 95 may be configured by a mode control input to pass either input B or one of the well-defined floating-point constants 0x3E00 (1.0) to operand B of FMA unit 15. Operand substitution logic 96 may be configured by a mode control input to pass either input C or one of the well-defined floating-point constants 0x8000 (−0.0) to operand C of FMA unit 15.
[0076] FMA unit 15 can multiply two inputs (operand A and operand B) and add the product with a third input (operand C). Three operand permutation logic units 94, 95, 96 are controlled by a current FMA instruction code 16 that has conditions for individually setting the permutation mode, mode A, mode B, mode C, of each operand permutation unit 94, 95, 96.
[0077] FIG. 2 shows a flow chart for performing a floating-point multiplication, addition or multiply-accumulate operation of the form A*B+C according to one embodiment of the invention comprising an apparatus 10 according to FIG.
[0078] Three floating-point input operands A, B and C (inputs in steps S100, S102, S104) may be individually replaced with well-defined floating-point constants based on Mode A, Mode B and Mode C, respectively.
[0079] A may be replaced by at least -0.0 (steps S106, S108) or 1.0 (steps S114, S116) or left unchanged (steps S122, S124). B may be replaced by at least 1.0 (steps S110, S112) or left unchanged (steps S118, S120). C may be replaced by at least -0.0 (steps S132, S134) or left unchanged (steps S128, S130).
[0080] After the permutation step, the resulting operands are processed by FMA unit 15 to generate operation D=A*B+C in step S136. Based on the respective permutation mode, result D corresponds to at least one of the selectable operations -0.0, A, B, C, A*B, A+C, B+C, or A*B+C. Result D is set for output in step S138. An invalid mode exception is set for output in step S126.
[0081] Extending the method to allow each operand to be replaced with -0.0, +0.0, -1.0, +1.0 further extends the set of selectable operations to at least -0.0, +0.0, A, B, C, -A, -B, A*B, -A*B, A+C, B+C, A*B+C, -1.0, 1.0, A+1.0, A-1.0, B+1.0, B-1.0, C+1.0, C-1.0.
[0082] FIG. 3 shows an apparatus 10 for performing floating-point multiply-add operations according to a further embodiment of the invention using multiplexer circuits 11, 12, 13.
[0083] This implementation realizes the operand permutation logic 94, 95, 96 of the implementation shown in FIG. 1 using multiplexer circuits 11, 12, 13 to enable any floating-point value to be passed on unchanged or to perform correct IEEE compliant floating-point multiplication, addition or multiply-and-accumulate operations using FMA unit 15.
[0084] The device 10 as a processing tile comprises three operand multiplexer circuits 11 , 12 , 13 and an FMA unit 15 .
[0085] At least one of the three floating point operands A, B, C is provided to the FMA unit 15 by a multiplexer circuit 11, 12, 13, respectively. The multiplexer circuits 11, 12, 13 comprise first input ports 80, 81, 82; 83, 84; 85, 86 for the respective floating point operands A, B, C, at least second input ports 80, 81, 82; 83, 84; 85, 86 for at least one value of the predefined operand value set 50, and at least one output port 17, 18, 19 assigned to the corresponding first and second input ports 80, 81, 82; 83, 84; 85, 86. The multiplexer circuits 11,12,13 are arranged such that they are separately configurable to select one of the input ports 80,81,82; 83,84; 85,86 for propagation to at least one output port 17,18,19.
[0086] Multiplexer circuit 11 with input ports 80, 81, 82 may be configured to select either input A, the constant 0x8000 (-0.0) from predefined value set 50, or the constant 0x3E00 (1.0). Multiplexer circuit 12 with input ports 83, 84 may be configured to select either input B or the constant 0x3E00 (1.0). Multiplexer circuit 13 with input ports 85, 86 may be configured to select either input C or the constant 0x8000 (-0.0).
[0087] FMA unit 15 may multiply two inputs (operand A and operand B) from inputs 90, 91 and add the product D with a third input (operand C) from input 92.
[0088] The select ports of multiplexer circuits 11, 12, 13 correspond to the mode control inputs of operand substitution units 94, 95, 96 of device 10 shown in FIG.
[0089] One of the input ports 80, 81, 82; 83, 84; 85, 86 may be selected for propagation to the corresponding at least one output port 17, 18, 19 by a selection code parameter which is at least one of a set corresponding to selectable operations including parameters -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C.
[0090] FIG. 4 shows an apparatus 10 for performing floating-point multiply-add operations according to a further embodiment of the invention using a register file 14.
[0091] The device 10 as a processing tile comprises three operand multiplexer circuits 11 , 12 , 13 , a local register file (LRF) 14 and an FMA unit 15 .
[0092] The register file 14 has a first read port 52 and a second read port 54 and one write port 56. The register file 14 is configured to provide input operands 68, 69 and receives an output 67 from the multiply-accumulate unit 15 and is configured to provide the input operands 68, 69 triggered by an instruction 16 having, among other things, a select code parameter.
[0093] The selection code parameter is used to select one of the input ports (corresponding to FIG. 3) to be propagated to at least one output port 17, 18, 19 and is at least one of a set corresponding to selectable operations including: -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C.
[0094] The multiplexer circuit 11 may be configured to select either a data source from the West input 60 of the processing tile, a data source from the North input 62 of the processing tile, or the constant 0x8000 (−0.0).
[0095] In other embodiments, the data sources may have other directions, for example from an East input and from a South input, without departing from the methods of the present invention.
[0096] Multiplexer circuit 12 may be configured to select either read port 52 of register file 14 or the constant 0x3E00 (1.0) as input operand 68. Multiplexer circuit 13 may be configured to select either the data source from north input 62, read port 54 of register file 14, or the constant 0x8000 (-0.0).
[0097] The local register file 14 is a register file having a first read port 52 and a second read port 54 and one write port 56 .
[0098] FMA unit 15 may multiply two inputs (operand A and operand B) and add a third input (operand C) to the product D as output 67, which may be propagated to south output 66 or write port 56 of register file 14.
[0099] In the table below, an exemplary setup of the operands of the multiplexer circuits 11, 12, 13 with the selection code parameters for loading any floating point value from the North input 62 into the local register file 14 via the FMA unit 15 is shown. [Table 1]
[0100] In the table below, an exemplary setup of the operands of multiplexer circuits 11, 12, 13 with select code parameters for multiplying a floating point value from the West input 60 with a floating point value from the local register file 14 and adding another floating point value from the local register file 14 is shown. The result is either written to the local register file 14 or passed to the South output 66. [Table 2]
[0101] Where the processor 100 comprises an interconnected mesh of devices 10 each having at least one multiply-add unit 15, 25, 35, 45, where each multiply-add unit 15, 25, 35, 45 comprises at least one local register file 14 for intermediate storage of data values, floating-point multiply-add operations are triggered by an instruction 16 having a selection code parameter that specifies the configuration of substitution logic 94, 95, 96.
[0102] FIG. 5 shows a processor 100 with a single instruction multiple data device having multiple units 10, 20, 30 each having at least one multiply-accumulate unit 15, 25, 35 according to a further embodiment using predicates 42.
[0103] The processor 100 comprises at least one unit 10 for performing a floating-point multiply-add operation, where at least one of the floating-point operands A, B, C is provided by permutation logic 94, 95, 96, respectively. The floating-point multiply-add operation may be triggered by an instruction 16 having a selection code parameter specifying the configuration of the permutation logic 94, 95, 96. The permutation logic 94, 95, 96 may be realized as multiplexer circuits 11, 12, 13, 21, 22, 23, 31, 32, 33.
[0104] The processor 100 shown in FIG. 5 comprises a single instruction multiple data device having multiple units 10, 20, 30, and a predicate register 40 is specified to select execution of a floating-point multiply-add operation for each unit 10 by an instruction 16 providing a predicate value 42 for each unit 10.
[0105] The predicate register 40 comprises a multi-bit predicate field 44 that contains a predicate value 42. The predicate field 44 is enabled by instruction 16 to execute the predicate value 42 on the lanes 70, 71, 72 of the devices 10, 20, 30 to change the type of the individual lanes 70, 71, 72 based on the respective predicates 42 for each lane 70, 71, 72.
[0106] At least one multiply-add unit 15, 25, 35 is configured to replace at least one operand of an internal operation with at least one value from a predefined set of operand values 50. The operation is triggered by a predicate value 42 that is assigned and decoded by predicate logic 77, 78, 79 based on the predicate value 42 into a selection code parameter.
[0107] The devices 10, 20, 30 represent N identical SIMD lanes 70, 71, 72, where N is a natural number, each comprising three operand multiplexer circuits 11, 12, 13; 21, 22, 23; 31, 32, 33, FMA units 15, 25, 35 similar to the implementation shown in FIG. 4, and predicate decode logic 77, 78, 79.
[0108] A predicate register 40 consisting of N multi-bit predicate fields 44 enables FMA instructions to be executed on all N SIMD lanes 70, 71, 72 that change the type of individual lanes 70, 71, 72 based on a respective predicate 42 for each lane 70, 71, 72, such that: A predicate value of 0 yields -0. A predicate value of 1 results in the operation A*B+C. A predicate value of 2 results in the operation A*B having a correct +0 or -0 as if a special multiplication unit had been used. A predicate value of 3 results in the operation A+C, which has a correct +0 or -0 as if using a special add unit. A predicate value of 4 results in the operation B+C having a correct +0 or -0 as if an add unit had been used specifically. Predicate value 5 specifically yields A that is bitwise identical to input A for all values of A. Predicate value 6 specifically results in B being bitwise identical to input B for all values of B. In particular, the predicate value 7 yields a result, C, that is bitwise identical for input C for all values of C.
[0109] In another embodiment, the predicate 42 may be encoded within the instruction 16 .
[0110] The set of eight operations shown in Figure 5 can be extended by two further operations: a predicate value that results in 1, and a predicate value that results in 1+C. A potential use of these two operations is, for example, to increment or not increment a counter based on the predicate value.
[0111] A given implementation may have four predicate bits to choose from the ten possible operations above. A given implementation with two predicate bits may support any four of the ten operations above. A given implementation with three predicate bits may support any eight of the ten operations above.
[0112] FIG. 6 shows a processor 100 with a single instruction multiple data device having multiple units 10, 20, 30 each having at least one multiply-accumulate unit 15, 25, 35 in accordance with a further embodiment using dynamic multi-bit predication of individual SIMD lanes 70, 71, 72 based on a previous result vector.
[0113] At least one operand of an internal operation in at least one multiply-accumulate unit 15, 25, 35 of apparatus 10 is replaced with at least one value from a predefined set of operand values 50. The operation is triggered by a predicate value 42 provided by load-store unit 46, which is assigned and decoded into a selection code parameter by predicate logic 77, 78, 79 based on the predicate value 42 provided by load-store unit 46, the result 76 of a previous instruction 16, and information 73 about dynamic or static usage.
[0114] A vector register 74 containing the result 76 of the previous SIMD instruction is added to enable dynamic predication. The previous result 76 has a range of at least two possible values, 0 or 1. In one implementation, the vector register 74 may be a register or register file that holds the primary result 76 of the previous SIMD instruction for each SIMD lane 70, 71, 72. In another embodiment, the vector register 74 may be a condition code register that holds a condition code as a secondary result of the previous SIMD instruction supporting a condition code for each SIMD lane, e.g., compare, minimum, maximum.
[0115] The instruction code 16 is extended by at least one bit to enable dynamic predication. The instruction code 16 now includes at least one opcode field, a unique code indicating that it is an FMA instruction, and one field 73 indicating dynamic predication. Optionally, it may additionally include one further field 41 for a predicate register index if multiple predicate registers 40 are present. Optionally, it may additionally include one further field 75 for a register index if the implementation uses the primary result of a previous SIMD instruction in the register file 74 for dynamic predication.
[0116] Each lane 70, 71, 72 of the SIMD predicate register 40 is further divided into len(range(condition code)) precompiled predicates.
[0117] Predicate register 40 may be written to, for example, by load / store unit 46 or a similar unit capable of moving data from memory or from the immediate instruction field into the register.
[0118] The predicate decode logic 77, 78, 79 for each SIMD lane 70, 71, 72 is expanded compared to the predicate decode logic 77, 78, 79 in the implementation shown in FIG. 5, as follows: When dynamic predication is enabled by a respective bit 73 in the instruction code 16, the value of the condition code for a particular lane 70, 71, 72 is determined to be one of the precompiled predicates 42 from the predicate register 40 for the particular lane 70, 71, 72, i.e., predicate.<lane_id> Select [condition code_value]. When dynamic predication is disabled, the first of the precompiled predicates 42, i.e., predicate.<lane_id> [0] will be selected.
[0119] Another implementation may use the primary result of the previous instruction instead of the condition code.
[0120] FIG. 7 shows an exemplary implementation of dynamic predicate decode logic 77 used within the first lane 70 of the implementation shown in FIG. 6, according to a further embodiment.
[0121] For simplicity, it is assumed that the previous result vector 76 has, for each of the SIMD lanes 70, 71, 72, a range of 4 possible values that are the result of a generalized vector comparison between, for example, two vectors X and Y, where the result for each element is 0 if x!=y, 1 if x==y, 2 if x<y, and 3 if x<=y.
[0122] The multiplexer circuit 87 is used to select one of the pre-compiled predicate values 42 for its lane 70 that includes multiplexers 11, 12, 13 to perform a floating point multiply-accumulate operation.
[0123] The selection signal for the multiplexer circuit 87 is controlled by the previous result 76, such that an additional AND gate 97 having a first input connected to the "dynamic" bit 73 of the extended FMA instruction code and a second input connected to the previous result 76 forces the selection to "0" when dynamic predication is disabled.
[0124] The output of the multiplexer circuit 87 is connected to decode logic 77 that includes one AND gate 98 having an inverted first input [1] and a second input [2] to obtain the selection signal for the operand multiplexer circuits 11, 12, 13 of the first lane 70.
[0125] FIG. 8 shows an apparatus 10 for performing a floating point multiply-product-sum operation according to a further embodiment of the present invention.
[0126] Apparatus 10 is configured to perform a floating-point multiply-add operation of the form A0*B0+A1*B1+C, with input floating-point operands including A0, A1, B0, B1, and C.
[0127] The device 10 allows a concatenated pair of two arbitrary floating-point values to be loaded into the register file 14 through a floating-point multiply-accumulate (FMMA) unit 45 .
[0128] The device 10 as a processing tile comprises three operand multiplexer circuits 11, 12, 13, a local register file (LRF) 14 and an FMMA unit 45.
[0129] Multiplexer circuit 11 may be configured to select either a data source from West input 60, a data source from North input 62, or the concatenated constant pair 0x8000 (-0.0, +0.0) from predefined set 50. Multiplexer circuit 12 may be configured to select either read port 52 of register file 14, or the constant 0x3E00 (1.0, +0.0). Multiplexer circuit 13 may be configured to select either a data source from North input 62, a read port 54 of register file 14, or the constant 0x8000 (-0.0).
[0130] The local register file 14 is a register file that has two read ports 52 , 54 and one write port 56 .
[0131] FMMA unit 45 may multiply the first half of operand A (A0) with the first half of operand B (B0) and the second half of operand A (A1) with the second half of operand B (B1), then sum the two products, A0*B0+A1*B1, and add a third input (operand C) to the sum of the products.
[0132] In the table below, an exemplary setup of the operands of the multiplexer circuits 11, 12, 13 with the selection code parameters for loading any floating point value from the North input 62 into the local register file 14 via the FMMA unit 45 is shown. [Table 3]
[0133] FIG. 9 shows a flowchart of an exemplary matrix multiplication program according to a further embodiment of the present invention. Information stored in matrices can be used extensively in AI applications. High throughput and high efficiency operations are essential for operating, for example, AI accelerators. The FMA unit according to an embodiment of the present invention can serve as an efficient infrastructure for loading floating-point data into a logical register file without significant hardware overhead.
[0134] After initializing the column index I to 0 in step S200, a column of eight elements of the second matrix (MatB) is first loaded into the local register file (LRF) through the FMA unit (step S204). The element number is incremented in step S206 and checked to see if it is less than 8 in step S202. Then, for each of the four rows of the first matrix (MatA), the eight elements are multiplied and accumulated with the other eight elements stored in the LRF through the FMA unit (step S214). The element number of the column is checked in step S212 and incremented in step S216 until it is equal to 8. The row number is checked in step S218 and incremented in step S220 until it is equal to 4.
[0135] For simplicity, the example does not actually use the interleaved computation order required in a pipeline design to avoid read-before-write hazards.
[0136] The advantage of using static prediction with selectable arithmetic FMA units can be demonstrated by computing a traditionally non-vectorizable problem. The high-level pseudocode for computing a traditionally non-vectorizable problem on a state-of-the-art processor is: D[0]=A[0]*B[0]+C[0]; D[1]=C[1]; D[2]=B[2]+C[2]; X[3]=-0.0; Here's the pseudo-assembly code to solve the same problem as static prediction: [Table 4]
[0137] Thus, using the soFMA unit according to one embodiment of the present invention, very short and concise code results.
[0138] The advantage of using dynamic prediction with selectable arithmetic FMA units can be demonstrated by computing a traditionally non-vectorizable problem. The high-level pseudocode for computing a traditionally non-vectorizable problem on a state-of-the-art processor is: [Table 5] The pseudo-assembly code to compute the same problem on the proposed soFMA with dynamic predication looks like this: [Table 6]
[0139] Dynamic prediction also results in very short and concise code.
[0140] Further exemplary implementations of the present disclosure are described in the following numbered clauses:
[0141] Numbered Clause 1: A processor-implemented method for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit (15, 25, 35, 45) using three input floating-point operands (A, B, C), comprising: A processor-implemented method, wherein at least one of the operands (A, B, C) is replaced with at least one value from a predefined set of operand values (50).
[0142] Numbered clause 2: providing at least one of said floating-point operands (A, B, C) by a permutation logic (94, 95, 96); configuring said substitution logic (94, 95, 96) to be separately configurable to replace said operands (A, B, C) with said at least one value of said predefined set of operand values (50) which is propagated to at least one output port (17, 18, 19) of said substitution logic (94, 95, 96); 2. The method of claim 1, further comprising at least
[0143] Numbered clause 3: the permutation logic (94, 95, 96) is configured as a multiplexer circuit (11, 12, 13); The method further comprises: providing at least one of said three floating-point operands (A, B, C) by said multiplexer circuits (11, 12, 13), respectively, said multiplexer circuits (11, 12, 13) comprising a first input port (80, 81, 82; 83, 84; 85, 86) for said respective floating-point operand (A, B, C) and at least a second input port (80, 81, 82; 83, 84; 85, 86) for at least one value of a predefined set of operand values (50), and at least one output port (17, 18, 19), configuring said multiplexer circuits (11, 12, 13) to be separately configurable to select one of said input ports (80, 81, 82; 83, 84; 85, 86) for propagation to said at least one output port (17, 18, 19); 3. The method according to claim 1 or 2, comprising at least
[0144] Numbered Clause 4: The method of any one of clauses 1 to 3, further comprising triggering the floating-point multiply-add operation by an instruction (16) having a selection code parameter specifying the configuration of the substitution logic (94, 95, 96).
[0145] Numbered Clause 5: The method of any one of clauses 1 to 4, further comprising configuring the predefined set of operand values (50) as a set including at least the values -0, +0, +1, -1.
[0146] Numbered Clause 6: The method of any one of clauses 3 to 5, further comprising selecting one of the input ports (80, 81, 82; 83, 84; 85, 86) for propagation to the at least one output port (17, 18, 19) by the selection code parameter being at least one of a set corresponding to selectable operations comprising parameters -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C.
[0147] Numbered Clause 7: The method of any one of clauses 1 to 6, further comprising performing a floating-point multiply-add operation of the form A0*B0+A1*B1+C using input floating-point operands comprising operands A0, A1, B0, B1, C.
[0148] Numbered Clause 8: The method of any one of clauses 1 to 7, further comprising providing floating point operands as input operands (68, 69) by a register file (14), and receiving an output (67) from said permutation logic (94, 95, 96) by a register file (14) having at least two read ports (52, 54) and one write port (56), providing said input operands (68, 69) triggered by said instruction (16) having, in particular, a selection code parameter.
[0149] Numbered Clause 9: The method of any one of clauses 1 to 8, further comprising, when the processor (100) comprises an interconnected mesh of devices (10) each having at least one multiply-accumulate unit (15, 25, 35, 45), each multiply-accumulate unit (15, 25, 35, 45) comprising at least one local register file (14) for intermediate storage of data values, the floating-point multiply-accumulate operation being triggered by an instruction (16) having a selection code parameter specifying a configuration of the substitution logic (94, 95, 96).
[0150] Numbered clause 10: The method of any one of clauses 1 to 9, further comprising: a single instruction multiple data device having a plurality of units (10) each having at least one multiply-accumulate unit (15, 25, 35, 45), wherein the method selects execution of a floating-point multiply-accumulate operation for each unit (10) when the instruction (16) specifies that a predicate value (42) for each unit (10) is provided by a predicate register (40).
[0151] Numbered clause 11: The method of clause 10, further comprising, when the predicate register (40) comprises a multi-bit predicate field (44) having the predicate value (42), which, when enabled by the instruction (16), executes the predicate value (42) on lanes (70, 71, 72) of the device (10, 20, 30 to change the type of individual lanes (70, 71, 72) based on the respective predicate values (42) for each lane (70, 71, 72).
[0152] Numbered clause 12: At least one operand of an internal operation in the at least one multiply-accumulate unit (15, 25, 35, 45) of the device (10) is replaced with at least one value of a predefined set of operand values (50); the operations are triggered by predicate values (42) provided by a load store unit (46), results (76) of previous instructions (16), and information (73) about dynamic or static usage, which are assigned and decoded by predicate logic (77, 78, 79) into select code parameters; 12. The method according to clause 10 or 11.
[0153] Numbered Clause 13: An apparatus (10) for performing a floating-point multiply-add operation of the form A*B+C on at least one multiply-add unit (15, 25, 35, 45) using a method according to any one of clauses 1 to 12, using three input floating-point operands (A, B, C), comprising: An apparatus (10), wherein at least one of the floating-point operands (A, B, C) is provided by substitution logic (94, 95, 96) configured to be separately configurable to replace the operand (A, B, C) with the at least one value of the predefined operand value set (50) that is propagated to at least one output port (17, 18, 19) of the substitution logic (94, 95, 96).
[0154] Numbered clause 14: The permutation logic (94, 95, 96) is configured as multiplexer circuits (11, 12, 13), at least one of the three floating-point operands (A, B, C) is provided by each of the multiplexer circuits (11, 12, 13), the multiplexer circuits (11, 12, 13) being: a first input port (80, 81, 82; 83, 84; 85, 86) for each of said floating-point operands (A, B, C); at least a second input port (80, 81, 82; 83, 84; 85, 86) for at least one value of a predefined set of operand values (50); and at least one output port (17, 18, 19) assigned to said corresponding first and second input ports (80, 81, 82; 83, 84; 85, 86); said multiplexer circuits (11, 12, 13) are configured to be separately configurable to select one of said input ports (80, 81, 82; 83, 84; 85, 86) for propagation to said at least one output port (17, 18, 19); 14. Apparatus according to clause 13.
[0155] Numbered clause 15: The apparatus of clause 13 or 14, wherein the floating-point multiply-add operation is triggered by an instruction (16) having a selection code parameter specifying a configuration of the at least one substitution logic (94, 95, 96).
[0156] Numbered Clause 16: The apparatus of any one of clauses 13 to 15, wherein the predefined operand value set (50) is configured as a set including at least the values -0, +0, +1, -1.
[0157] Numbered Clause 17: An apparatus as described in clause 15 or 16, wherein the selection code parameter used to select one of the input ports (80, 81, 82; 83, 84; 85, 86) to be propagated to the at least one output port (17, 18, 19) is at least one of a set corresponding to selectable operations comprising: -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C.
[0158] Numbered Clause 18: An apparatus as described in any one of clauses 13 to 17, comprising at least one multiply-accumulate unit (15, 25, 35, 45) having three inputs (90, 91, 92), at least one input (90, 91, 92) being received from an output (17, 18, 19) of the at least one permutation logic (94, 95, 96).
[0159] Numbered Clause 19: An apparatus as described in any one of clauses 13 to 18, comprising a register file (14) having at least two read ports (52, 54) and one write port (56), the register file (14) being configured to provide input operands (68, 69) and configured to provide the input operands (68, 69) triggered by the instruction (16) having a selection code parameter, in particular to receive an output (67) from the multiply-accumulate unit (15, 25, 35, 45).
[0160] Numbered Clause 20: Apparatus as claimed in any one of clauses 13 to 19, configured to perform a floating-point multiply-add operation of the form A0*B0+A1*B1+C using input floating-point operands comprising A0, A1, B0, B1, C.
[0161] Numbered Clause 21: A processor (100) comprising at least one apparatus (10) for performing a floating-point multiply-add operation as described in any one of clauses 13 to 20, wherein at least one of the floating-point operands (A, B, C) is provided by a permutation logic (94, 95, 96), respectively, and the floating-point multiply-add operation is triggered by an instruction (16) having a selection code parameter specifying a configuration of the permutation logic (94, 95, 96).
[0162] Numbered clause 22: A processor as described in clause 21, comprising a single instruction multiple data device having a plurality of units (10), wherein a predicate register (40) is specified to select execution of a floating-point multiply-add operation for each unit (10) by an instruction (16) providing a predicate value (42) for each unit (10).
[0163] Numbered clause 23: The processor of clause 22, wherein the predicate register (40) comprises a multi-bit predicate field (44) having the predicate value (42), the predicate field (44) being enabled by the instruction (16) to execute the predicate value (42) on lanes (70, 71, 72) of the device (10, 20, 30 to change the type of individual lanes (70, 71, 72) based on the respective predicates (42) for each lane (70, 71, 72).
[0164] Numbered clause 24: the at least one multiply-accumulate unit (15, 25, 35, 45) is configured to replace at least one operand of an internal operation with at least one value of a predefined set of operand values (50); the operations are triggered by predicate values (42) provided by a load store unit (46), results (76) of previous instructions (16), and information (73) about dynamic or static usage, which are assigned and decoded by predicate logic (77, 78, 79) into select code parameters; 24. A processor according to clause 22 or 23.
[0165] Numbered clause 25: On at least one multiply-accumulate unit (15, 25, 35, 45), with three input floating-point operands (A, B, C), 13. A non-transitory machine-readable medium comprising instructions for performing a floating-point multiply-add operation of the form A*B+C using the method of any one of clauses 1-12, comprising: At least one of the operands (A, B, C) is replaceable with at least one value of a predefined set of operand values (50).
Claims
1. 1. A processor-implemented method for performing floating-point multiply-add operations of the form A*B+C on at least one multiply-add unit, comprising: three input floating point operands A, B, C, where at least one of said input floating point operands A, B, C is to be replaced with at least one value from a predefined set of operand values; 13. A processor-implemented method comprising:
2. providing at least one of the input floating point operands A, B, C by permutation logic; and configuring said substitution logic to be separately configurable to replace said input floating point operands A, B, C with said at least one value of said predefined set of operand values that is propagated to at least one output port of said substitution logic; The method of claim 1 further comprising:
3. The permutation logic is configured as a multiplexer circuit, and the processor-implemented method includes: providing at least one of said three input floating-point operands A, B, C by said multiplexer circuits, respectively, said multiplexer circuits having first input ports for each of said input floating-point operands A, B, C, and at least a second input port for at least one value of a predefined set of operand values, and at least one output port; and configuring the multiplexer circuitry to be separately configurable to select one of the first input port and the second input port for propagation to the at least one output port. The method of claim 1 or 2, further comprising:
4. triggering said floating point multiply-add operation by an instruction having a select code parameter that specifies said configuration of said permutation logic. The method of any one of claims 1 to 3, further comprising:
5. configuring said predefined set of operand values as a set including at least the values −0, +0, +1, and −1; The method of any one of claims 1 to 4, further comprising:
6. selecting one of the first input port and the second input port for propagation to the at least one output port by a selection code parameter, the selection code parameter being at least one of a set corresponding to selectable operations comprising parameters −0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, −A+C, −B+C. The method of any one of claims 3 to 5, further comprising:
7. performing a floating-point multiply-add operation of the form A0*B0+A1*B1+C using input floating-point operands comprising operands A0, A1, B0, B1 and C; The method of any one of claims 1 to 6, further comprising:
8. providing floating point operands as input operands by a register file, receiving outputs from said permutation logic by a register file having at least two read ports and one write port, providing said input operands triggered in particular by an instruction having a selection code parameter; The method of any one of claims 1 to 7, further comprising:
9. where the processor comprises an interconnected mesh of devices each having at least one multiply-accumulate unit, each multiply-accumulate unit comprising at least one local register file for intermediate storage of data values, triggering said floating-point multiply-accumulate operations by an instruction having a select code parameter specifying the configuration of said permutation logic. The method of any one of claims 1 to 8, further comprising:
10. a processor including a single instruction multiple data device having a plurality of units each having at least one multiply-accumulate unit, and wherein selecting execution of a floating point multiply-accumulate operation for each unit when an instruction specifies that a predicate value for each unit is provided by a predicate register; The method of any one of claims 1 to 9, further comprising:
11. executing the predicate values on lanes of the device, the predicate register comprising a multi-bit predicate field having the predicate values, when enabled by the instruction, to change individual lane types based on the respective predicate values for each lane. The method of claim 10 further comprising:
12. 12. A processor implementation method as claimed in claim 10 or 11, wherein at least one operand of an internal operation in the at least one multiply-accumulate unit of the device is replaced with at least one value from a predefined set of operand values, the internal operation being triggered by a predicate value that is assigned and decoded by predicate logic into a selection code parameter based on predicate values provided by a load-store unit, results of previous instructions, and information about dynamic or static usage.
13. 13. An apparatus for performing floating-point multiply-add operations of the form A*B+C on at least one multiply-add unit using the processor implementation method of claim 1, comprising: three input floating-point operands A, B, C, at least one of the input floating-point operands A, B, C being provided by a substitution logic configured to be separately configurable to replace the input floating-point operand A, B, C with the at least one value of the predefined set of operand values that is propagated to at least one output port of the substitution logic; An apparatus comprising:
14. The permutation logic is configured as a multiplexer circuit, at least one of the three floating point operands A, B, C being provided by each of the multiplexer circuits, the multiplexer circuits being: a first input port for each of said input floating-point operands A, B, C; at least a second input port for at least one value of a predefined set of operand values; and at least one output port assigned to a corresponding one of the first input port and the second input port, wherein the multiplexer circuit is configured to be separately configurable to select one of the first input port and the second input port for propagation to the at least one output port; The apparatus of claim 13 , comprising:
15. 15. Apparatus according to claim 13 or 14, wherein the floating point multiply-add operation is triggered by an instruction having a select code parameter specifying a configuration of the at least one substitution logic.
16. Apparatus according to any one of claims 13 to 15, wherein the predefined set of operand values is arranged as a set including at least the values -0, +0, +1 and -1.
17. 17. The apparatus of claim 15 or 16, wherein the selection code parameter used to select one of the input ports for propagation to the at least one output port is at least one of a set corresponding to selectable operations comprising: -0, C, A, A+C, B, B+C, A*B, A*B+C, C+1, 1, -A+C, -B+C.
18. Apparatus according to any one of claims 13 to 17, comprising at least one multiply-accumulate unit having three inputs, at least one input being received from an output of the at least one permutation logic.
19. 19. An apparatus according to any one of claims 13 to 18, comprising a register file having at least two read ports and one write port, the register file being configured to provide input operands and configured to provide the input operands triggered by an instruction having, in particular, a select code parameter, for receiving an output from the multiply-accumulate unit.
20. 20. Apparatus according to any one of claims 13 to 19, configured to perform a floating point multiply-add operation of the form A0*B0+A1*B1+C, using input floating point operands comprising A0, A1, B0, B1, C.
21. 13. A processor comprising at least one apparatus for performing floating-point multiply-add operations of the form A*B+C on at least one multiply-add unit using the processor implementation method of claim 1, comprising: three input floating-point operands A, B, C, where at least one of said input floating-point operands A, B, C is provided by said substitution logic configured to be separately configurable to replace said input floating-point operand A, B, C, respectively, with said at least one value of said predefined set of operand values that is propagated to at least one output port of the substitution logic, and said floating-point multiply-add operation is triggered by an instruction having a select code parameter specifying a configuration of said substitution logic; A processor having:
22. 22. The processor of claim 21, further comprising: a single instruction multiple data device having multiple units, where a predicate register is specified to select execution of a floating point multiply-add operation for each unit by an instruction providing a predicate value for each unit.
23. 23. The processor of claim 22, wherein the predicate register comprises a multi-bit predicate field having the predicate value, the multi-bit predicate field being enabled by the instruction to execute the predicate value on lanes of a device to change individual lane types based on the respective predicate values for each lane.
24. 24. The processor of claim 22 or 23, wherein the at least one multiply-accumulate unit of the apparatus is configured to replace at least one operand of an internal operation with at least one value of a predefined set of operand values, the internal operation being triggered by a predicate value specified and decoded by predicate logic into a selection code parameter based on predicate values provided by a load-store unit, results of previous instructions, and information about dynamic or static usage.
25. on at least one multiply-accumulate unit, using three input floating-point operands A, B, and C, 1. A non-transitory machine-readable medium comprising instructions for performing a floating-point multiply-add operation of the form A*B+C, comprising: three input floating point operands A, B, C, where at least one of said input floating point operands A, B, C is to be replaced with at least one value from a predefined set of operand values; Equipped with 11. A non-transitory machine-readable medium, wherein at least one of the input floating-point operands A, B, C is replaceable by at least one value of a predefined set of operand values.
Citation Information
Patent Citations
Processor and data processor
JP1997325953A
Fused multiply-add operation functional unit
JP2009140491A
Processor and method for outer product accumulate operations
JP2018055677A
Methods of dyadic DSP instruction operation
US20030018881A1
