From 9c0992350f6cb930af806105d1bee4451a012917 Mon Sep 17 00:00:00 2001 From: Daniel Maddern Date: Sat, 15 Aug 2026 02:43:03 +0700 Subject: [PATCH] Match NVFP4 signed zero encoding --- src/h3_blackwell_runtime/csrc/nvfp4_scale.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/h3_blackwell_runtime/csrc/nvfp4_scale.cu b/src/h3_blackwell_runtime/csrc/nvfp4_scale.cu index 18c3a56..de86db8 100644 --- a/src/h3_blackwell_runtime/csrc/nvfp4_scale.cu +++ b/src/h3_blackwell_runtime/csrc/nvfp4_scale.cu @@ -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(code | 0x8u) : code; + return negative ? static_cast(code | 0x8u) : code; } __inline__ __device__ uint8_t encode_fp8_e4m3(float value) {