Skip to content

Fix conversion to zero for E4M3FNUZ and E5M2FNUZ #5764

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

Merged
merged 4 commits into from
Dec 8, 2023
Merged

Conversation

xadupre
Copy link
Contributor

@xadupre xadupre commented Nov 20, 2023

Description

-0.00001 must be converted into 0 and not negative zero which does not exist for types Float8E4M3FNUZ and Float8E5M2UZ.
See microsoft/onnxruntime#18473 for further details.

Signed-off-by: Xavier Dupre <xadupre@microsoft.com>
@xadupre xadupre marked this pull request as ready for review November 20, 2023 18:19
@xadupre xadupre requested review from a team as code owners November 20, 2023 18:19
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (872f320) 56.34% compared to head (a78162b) 56.34%.

Files Patch % Lines
onnx/helper.py 37.73% 26 Missing and 7 partials ⚠️
onnx/backend/test/case/node/cast.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5764   +/-   ##
=======================================
  Coverage   56.34%   56.34%           
=======================================
  Files         503      503           
  Lines       29626    29622    -4     
  Branches     4438     4434    -4     
=======================================
- Hits        16692    16690    -2     
- Misses      12119    12120    +1     
+ Partials      815      812    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xadupre xadupre enabled auto-merge November 23, 2023 16:02
@xadupre xadupre added this pull request to the merge queue Dec 8, 2023
Merged via the queue into onnx:main with commit 6ff456c Dec 8, 2023
@xadupre xadupre deleted the neg0 branch December 8, 2023 17:56
linshokaku pushed a commit to linshokaku/onnx that referenced this pull request Oct 2, 2024
### Description
-0.00001 must be converted into 0 and not negative zero which does not
exist for types Float8E4M3FNUZ and Float8E5M2UZ.
See microsoft/onnxruntime#18473 for further
details.

Signed-off-by: Xavier Dupre <xadupre@microsoft.com>
Signed-off-by: Linsho Kaku <linsho@preferred.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants