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

[Bug Report] HiFi4 gives more inaccurate result than HiFi2 in bfloat16 multiplication on FPU #12923

Open
jeongu-moreh opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working LLK moreh moreh contribution P0_Showstopper

Comments

@jeongu-moreh
Copy link
Contributor

jeongu-moreh commented Sep 20, 2024

Describe the bug
It is expected that HiFi4 gives more accurate result compared to HiFi2 for bfloat16 multiplication but in some cases it does not.

To Reproduce
For bfloat16 multiplication (mul_tiles) on Wormhole B0:

  • 1.3125 × 7.96875
    • HiFi2: 10.4375
    • HiFi4: 10.5

In this case the mantissa of 7.96875 is 0b1.1111111 (least significant bit is 1) so HiFi2 and HiFi4 give different results according to this comment: #12453 (comment). If I understood correctly, HiFi2 caculates 1.3125 × 7.9375 (mantissa 0b1.1111110) = 10.41796875 and then it is rounded to 10.4375 so the result is as expected. However, HiFi4 must calculate with the full precision so its result must be 10.458984375 and 10.4375 when rounded, which is different from the actual result. I wonder if this is intended behavior of the hardware or a bug in LLK.

Expected behavior
HiFi4 gives the same result with HiFi2.

@jeongu-moreh jeongu-moreh added bug Something isn't working moreh moreh contribution P1_critical labels Sep 20, 2024
@tenstorrent tenstorrent deleted a comment Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLK moreh moreh contribution P0_Showstopper
Projects
None yet
Development

No branches or pull requests

2 participants