From 228c0f13347f9e7e756be03ee4a61d239a60d43b Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Sun, 27 Apr 2025 22:49:23 +0300 Subject: [PATCH] Add definition for te_fp8_fnuz when ROCm version is 6.2 Before https://github.com/ROCm/clr/commit/353f15afa6cfb0fc1eebbc618be47e0cb639c321 (In ROCm6.2), FP8 OCP is not added and the code implementation is in FNUZ, so we define `te_fp8_fnuz()` to return true, to fix the following error: ```logs transformer_engine/common/recipe/delayed_scaling.hip:42:14: error: use of undeclared identifier 'te_fp8_fnuz' 42 | return te_fp8_fnuz() ? 240 : 448; | ^ 1 error generated when compiling for gfx90a. ``` Signed-off-by: Hollow Man --- transformer_engine/common/amd_detail/hip_float8.h | 1 + 1 file changed, 1 insertion(+) diff --git a/transformer_engine/common/amd_detail/hip_float8.h b/transformer_engine/common/amd_detail/hip_float8.h index f135945ed..0caabd2b3 100644 --- a/transformer_engine/common/amd_detail/hip_float8.h +++ b/transformer_engine/common/amd_detail/hip_float8.h @@ -79,6 +79,7 @@ static inline bool te_fp8_fnuz() { return false; } #else //HIP_VERSION >= 60300000 typedef __hip_fp8_e4m3_fnuz _te_hip_fp8_e4m3; typedef __hip_fp8_e5m2_fnuz _te_hip_fp8_e5m2; +static inline bool te_fp8_fnuz() { return true; } #endif //HIP_VERSION >= 60300000 struct te_hip_fp8_e4m3 {