Match NVFP4 signed zero encoding

This commit is contained in:
Daniel Maddern 2026-08-15 02:43:03 +07:00
parent ef84a2786c
commit 9c0992350f

View file

@ -73,7 +73,7 @@ __inline__ __device__ uint8_t encode_fp4_e2m1(float value) {
} else if (abs_value >= 0.25f) {
code = 1;
}
return negative && code != 0 ? static_cast<uint8_t>(code | 0x8u) : code;
return negative ? static_cast<uint8_t>(code | 0x8u) : code;
}
__inline__ __device__ uint8_t encode_fp8_e4m3(float value) {