Skip to content

Fix conversion to zero for E4M3FNUZ and E5M2FNUZ - #5764

Merged
xadupre merged 4 commits into
onnx:mainfrom
xadupre:neg0
Dec 8, 2023
Merged

xadupre merged 4 commits into
onnx:mainfrom
xadupre:neg0

Conversation

@xadupre

@xadupre xadupre commented Nov 20, 2023

Copy link
Copy Markdown
Contributor

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
@codecov

codecov Bot commented Nov 20, 2023 •

Copy link
Copy Markdown

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
Comment thread docs/Operators.md Resolved
@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