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

[Spec issue] Rounding or truncation behavior for Cast operator is not specified in the spec #3876

Open
max-ku opened this issue Dec 2, 2021 · 1 comment
Labels
bug operator Issues related to ONNX operators spec clarification Clarification of the ONNX spec needed

Comments

@max-ku
Copy link

max-ku commented Dec 2, 2021

  • ORT performs rounding when Cast operator is used from f32 to bfloat16.
  • There is no explicit mentioning about rounding or truncation behavior for Cast operator on documentation page.
  • The test example on same page related to Cast operator performs truncation, not rounding.

Suggesting to revise documentation:

  • explicitly state that rounding is performed in Cast operator for floating-point conversions.
  • update example to remove confusion about truncation behavior for Cast from f32 to bfloat16.

Repro for rounding
rounding.zip

@max-ku max-ku added the bug label Dec 2, 2021
@jcwchen jcwchen added documentation Issues related to ONNX documentation operator Issues related to ONNX operators labels Dec 3, 2021
@jcwchen
Copy link
Member

jcwchen commented Dec 3, 2021

Hi @max-ku,
I also think the document should be clearer for this case... There are a few similar issues related to Cast like #2285. I will add this item into tracking. Feel free to propose a PR for improving document if you have bandwidth. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug operator Issues related to ONNX operators spec clarification Clarification of the ONNX spec needed
Projects
None yet
Development

No branches or pull requests

3 participants