From 8cb0d98ccd0a310879ae8eaa1ce2c41e4b40a052 Mon Sep 17 00:00:00 2001 From: Eddie Zhou Date: Sun, 22 Nov 2026 04:06:12 -0700 Subject: [PATCH] HIP: fix double halving of NVFP4 scales on CDNA3 (#32790) Fixes #32789 --- ggml/src/ggml-cuda/common.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml/src/ggml-cuda/common.cuh b/ggml/src/ggml-cuda/common.cuh index 8cd2366ed..5b3c32858 100644 --- a/ggml/src/ggml-cuda/common.cuh +++ b/ggml/src/ggml-cuda/common.cuh @@ -911,7 +911,7 @@ static __device__ __forceinline__ float ggml_cuda_ue4m3_to_fp32(uint8_t x) { // but CDNA3 supports only e4m3_fnuz (no inf). const uint32_t bits = x * (x != 0x7F && x != 0xFF); // Convert NaN to 0.0f to match CPU implementation. const __hip_fp8_e4m3_fnuz xf = *reinterpret_cast(&bits); - return static_cast(xf) / 2; + return static_cast(xf); #else #if defined(FP8_AVAILABLE) && !defined(GGML_USE_HIP) const uint32_t bits = x * (x != 0x7F && x != 0xFF); // Convert NaN to 0.0f to match CPU implementation.