I have a question regarding the functional.py file in the bitsandbytes library, specifically the comment on line 855:
0b000 = 0
0b001 = 0.0625
0b010 = 8
0b011 = 12
0b100 = 4
0b101 = 6
0b110 = 2
0b111 = 3
can also be created with bnb.functional.create_fp8_map(signed=True, exponent_bits=2, precision_bits=1, total_bits=4)
For the FP4 format with 1 sign bit, 2 exponent bits, and 1 mantissa bit, where the sign bit is 0, I'm struggling to understand why the values are calculated as shown above.
According to the IEEE 754 standard, I believe the calculations should be(not considering bias):
I have a question regarding the functional.py file in the bitsandbytes library, specifically the comment on line 855:
For the FP4 format with 1 sign bit, 2 exponent bits, and 1 mantissa bit, where the sign bit is 0, I'm struggling to understand why the values are calculated as shown above.
According to the IEEE 754 standard, I believe the calculations should be(not considering bias):
What am I missing here? Additionally, could you advise on what documents I should refer to for a better understanding of the FP4 format?
Thank you for your assistance.