Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math_brute_force's fma test seems to strict for RTZ device #2224

Open
cycheng opened this issue Jan 10, 2025 · 0 comments
Open

math_brute_force's fma test seems to strict for RTZ device #2224

cycheng opened this issue Jan 10, 2025 · 0 comments

Comments

@cycheng
Copy link
Contributor

cycheng commented Jan 10, 2025

Hi,

It seems that the half-precision's FMA test is too strict in verification in the current code (I've tested on the latest commit).
The test case:

fma(0x8400, 0x0001, 0x7bff)
= fma_f32(-0.0000610351, 0.0000000596, 65504.0)
= fma_f32(0xb8800000, 0x33800000, 0x477fe000)

RTE HW = 65504.0 = 0x477fe000
RTZ HW = 65503.996093 = 0x477fdfff

65504 = 0x7bff (half) 
65503.996093 = 7bfe (half)

This causes 1 ULP error on my device:

        Testing half precision? YES
        Is Embedded? YES
        Running in RTZ mode? YES
        Tininess is detected before rounding? NO
        Worker threads: 10
        Testing vector sizes:   2
        Verbose? NO

fma...
  1:             fma fp16
ERROR: fma2: -1.000000 ulp error at {-0x1p-14, 0x1p-24, 0x1.ffcp+15} ({0x8400, 0x0001, 0x7bff}): *0x1.ffcp+15 vs. 0x1.ff8p+15

Any comments would be appreciated!
CY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants