From 2b8dff1f90605452c378c02298dd0cacaf65753c Mon Sep 17 00:00:00 2001 From: GTO Date: Mon, 22 Sep 2025 06:43:59 +0300 Subject: [PATCH] Fix bfloat16 epsilon (#2607) * Fix bfloat16 epsilon * just use constants --------- Co-authored-by: Konstantin Co-authored-by: Haicheng Wu --- include/cutlass/bfloat16.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/cutlass/bfloat16.h b/include/cutlass/bfloat16.h index 5e2f40b1..0c1f4d36 100644 --- a/include/cutlass/bfloat16.h +++ b/include/cutlass/bfloat16.h @@ -362,8 +362,7 @@ struct numeric_limits { /// Returns smallest finite value CUTLASS_HOST_DEVICE - static cutlass::bfloat16_t epsilon() { return cutlass::bfloat16_t::bitcast(0x1000); } - + static cutlass::bfloat16_t epsilon() { return cutlass::bfloat16_t::bitcast(0x3c00); } /// Returns smallest finite value CUTLASS_HOST_DEVICE static cutlass::bfloat16_t round_error() { return cutlass::bfloat16_t(0.5f); } @@ -431,8 +430,7 @@ struct numeric_limits { /// Returns smallest finite value CUTLASS_HOST_DEVICE - static cutlass::bfloat16_t epsilon() { return cutlass::bfloat16_t::bitcast(0x1000); } - + static cutlass::bfloat16_t epsilon() { return cutlass::bfloat16_t::bitcast(0x3c00); } /// Returns smallest finite value CUTLASS_HOST_DEVICE static cutlass::bfloat16_t round_error() { return cutlass::bfloat16_t(0.5f); }