diff --git a/sw/blas/gemm/verify.py b/sw/blas/gemm/verify.py index ee97ae195..02f9249ef 100755 --- a/sw/blas/gemm/verify.py +++ b/sw/blas/gemm/verify.py @@ -21,18 +21,6 @@ NP_DTYPE = {8: np.float64, 4: np.float32, 2: np.float16, 1: np.uint8} -def fp8byte_to_float(byte: np.uint8): - """Converts a number from a byte stored as a uint8 to a float.""" - sign = (byte & 0x80) >> 7 # Extract sign (1 bit) - exponent = (byte & 0x7c) >> 2 # Extract exponent (5 bits) - mantissa = (byte & 0x03) << 5 # Extract mantissa (2 bits) - real_exp = exponent - 15 # Convert exponent from excess-7 to excess-127 - value = (1 + mantissa / 4) * (2 ** float(real_exp)) # Calculate value - if sign: - value *= -1 - return value - - def main(): # Run simulation and get outputs args = verification.parse_args()