Skip to content

Commit ad5ca77

Browse files
committed
fix fp8 nans: fp8 requantization match
1 parent 45d29af commit ad5ca77

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/scala/gemmini/BF16ScalaRoundToTiny.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ object E5M3ToFp8 {
178178

179179
val mapToZero = (exp <= 5.U) || isZero
180180
val mapToSubnorm = (exp >= 6.U) && (exp <= 8.U)
181-
val mapToMax = (exp > (23.U)) || isSpecial
181+
val mapToMax = (exp > (23.U)) || isSpecial || (exp === 23.U && sig.andR)
182182

183183
val exp_adj = (exp - biasDiff)(3, 0)
184184
val outNorm = sign ## exp_adj ## sig

0 commit comments

Comments
 (0)