Floating point multiply-add, accumulate unit with exception processing
AssigneeSambaNova Systems, Inc.
InventorsVojin G. Oklobdzija, Matthew M. Kim
Life of this patent
Estimating the term…
Abstract
A Floating point Multiply-Add, Accumulate Unit, supporting BF16 format for Multiply-Accumulate operations, and FP32 Single-Precision Addition complying with the IEEE 754 Standard is described with exception handling. Operations including exception handling in a way that does not interfere with execution of data flow operations, overflow detection, zero detection and sign extension are adopted for 2's complement and Carry-Save format.
Claims24
A circuit to receive a sequence of operands A(i) and operands B(i) in floating point encoding format, for (i) going from 0 to N−1, and to calculate a summation S(i) of terms A(i)*B(i), where (i) goes from 0 to N−1, and N is the number of terms in the summation, the circuit comprising:
- a multiplier circuit receiving operand A(i) and operand B(i), to multiply operand A(i) and operand B(i) to generate calculated term A(i)*B(i) in a format including a multiplier output exponent of term A(i)*B(i), a multiplier output sign of term A(i)*B(i) and a multiplier output significand of term A(i)*B(i), the multiplier circuit including:
- a multiplier exception processing circuit to detect at least one invalid multiply operation and in response to set the multiplier output exponent of term A(i)*B(i) and multiplier output significand of term A(i)*B(i) to values usable in further computation;
- and
- an accumulator circuit connected to outputs of the multiplier circuit, to add the term A(i)*B(i) to the summation S(i−1) to generate a summation S(i) in a format including an accumulator output exponent of summation S(i), and accumulator output sign of summation S(i), and an accumulator output significand of summation S(i), the accumulator circuit including:
- an accumulator exception processing circuit to detect at least one invalid add operation and in response to set the accumulator output exponent of summation S(i), and the accumulator output significand of summation S(i) to values usable in further computation.
A method to calculate in a floating point encoding format having at least one illegal multiply operation and at least one illegal add operation, a summation S(i) of terms A(i)*B(i), where (i) goes from 0 to N−1, and N is the number of terms in the summation, the method comprising:
- receiving, at a multiplier circuit, a sequence of operands A(i) and operands B(i) in floating point encoding format, for (i) going from 0 to N−1;
- multiplying, by the multiplier circuit, operand A(i) and operand B(i) to generate term A(i)*B(i) in a format including a multiplier output exponent of term A(i)*B(i) and a multiplier output significand of term A(i)*B(i), including, for said at least one illegal multiply operation, setting, by a multiplier exception processing circuit coupled to the multiplier circuit, the multiplier output exponent of term A(i)*B(i) and multiplier output significand of term A(i)*B(i) to values usable in further computation by an accumulator circuit;
- and
- adding, by the accumulator circuit, the term A(i)*B(i) to the summation S(i−1) to generate a summation S(i) in a format including an accumulator output exponent of summation S(i) and an accumulator output significand of summation S(i), including detecting, by an accumulator exception processing circuit coupled to the accumulator circuit, at least one invalid add operation and for said at least one invalid add operation setting, by the accumulator exception processing circuit, the accumulator output exponent of term A(i)*B(i) and accumulator output significand of term A(i)*B(i) to values usable in further computation.
A multiply-and-accumulate unit, comprising:
- a pipeline configured to execute a floating point, multiply-and-accumulate operation for a summation S(i) of terms A(i)*B(i), where (i) goes from 0 to N−1, and N is the number of terms in the summation, the pipeline including:
- a multiplier pipeline stage including a multiplier circuit to provide multiplier significand and multiplier exponent values of a term A(i)*B(i) in response to first and second input operands, a radix-8 conversion circuit to convert the multiplier significand and multiplier exponent values of term A(i)*B(i) to radix-8 format, and a 2's complement conversion circuit to convert the multiplier significand value to a 2's complement representation for the multiplier output significand of term A(i)*B(i);
- a multiplier exception processing circuit to detect at least one invalid multiply operation and in response to set the multiplier output exponent of term A(i)*B(i) and multiplier output significand of term A(i)*B(i) to values usable in further computation, and generate multiplier exception flags;
- an accumulator stage including a significand circuit to add the multiplier output significand of term A(i)*B(i) to fed back significand of summation S(i−1), and generate sum-and-carry values for summation S(i), the significand circuit including a 2's complement, carry-save adder, to generate sum and carry accumulator output significand values of summation S(i);
- and an exponent circuit receiving the multiplier exponent value of term A(i)*B(i) and a fed back exponent value of summation S(i−1), to generate an accumulator stage exponent value for summation S(i);
- a stage to convert the accumulator sign bit, an accumulator stage exponent and accumulator significand sum and carry values to a sign-magnitude significand format for summation S(i);
- a stage to convert the sign-magnitude significand format from radix-8 alignment to radix-2 alignment, and produce a normalized exponent and significand for summation S(i);
- a stage to perform rounding and conversion to a standard floating point representation of summation S(i), including an accumulator output exponent of summation S(i), and an accumulator output significand of summation S(i);
- and
- an accumulator exception processing circuit responsive to the multiplier exception flags and the accumulator stage to detect at least one invalid add operation and in response to set the accumulator output exponent of summation S(i), and the accumulator output significand of summation S(i) to values usable in further computation.
A reconfigurable arithmetic unit, comprising:
- a circuit configurable to execute a plurality of floating point arithmetic operations using input operands and generating an output operand in a floating point encoding format, where a source of the input operands, a destination of the output operand and an operation of the plurality of floating point operations are set by configuration data, the circuit including an exception handling circuit to detect at least one of an invalid operation and an invalid result according to the floating point encoding format, and to set the output operand to a value useable in further processing.
Dependencies are inferred from the claim text.