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

Typecast for bfp16 to bfp8 is incorrect #17237

Open
TT-BrianLiu opened this issue Jan 28, 2025 · 1 comment
Open

Typecast for bfp16 to bfp8 is incorrect #17237

TT-BrianLiu opened this issue Jan 28, 2025 · 1 comment
Assignees

Comments

@TT-BrianLiu
Copy link
Contributor

Describe the bug
See #15889 for context.
Previously, our handling of mantissa rounding is always round to nearest. If tied, round up. This is incorrect and in this PR #16997, I will correct it to round to even on ties.

However, after the change, I noticed ttnn.typecast op doesn't give exact match for host conversion vs. device conversion. These 3 tests in tests/ttnn/unit_tests/operations/eltwise/test_eltwise_typecast.py break:

  • test_typecast_bf16_to_bfp8_b
  • test_typecast_bf16_to_bfp8_b_various_input
  • test_typecast_bf16_to_bfp8_b_with_inf_nan

To Reproduce
Steps to reproduce the behavior:

Expected behavior
The tests should fail without those changes and pass with them if hardware does the same rounding spec (ie. round to even).

@TT-BrianLiu TT-BrianLiu added the bug Something isn't working label Jan 28, 2025
@rdjogoTT
Copy link
Contributor

rdjogoTT commented Jan 30, 2025

Just confirmed with the HW team that WH and BH both DO NOT support rounding to even, only rounding up in case of ties. This means that the original implementation was accurately modelling HW.

@ayerofieiev-tt ayerofieiev-tt removed the bug Something isn't working label Jan 31, 2025
@ayerofieiev-tt ayerofieiev-tt changed the title [Bug Report] Typecast for bfp16 to bfp8 is incorrect Typecast for bfp16 to bfp8 is incorrect Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants