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

doc: clarify conversions can be impacted by double-rounding #2361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgouicem
Copy link
Contributor

@mgouicem mgouicem commented Jan 9, 2025

Specify in the documentation that there could be double rounding going on when converting f32 to very low accuracy datatypes (fp4/fp8).

@mgouicem mgouicem requested review from a team as code owners January 9, 2025 13:00
@github-actions github-actions bot added the documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc label Jan 9, 2025
Copy link
Contributor

@ranukund ranukund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments suggested, please incorporate as you see fit, thanks!

@@ -99,7 +99,12 @@ No downconversions are allowed by default, but can be enabled using
the floating-point math controls described in @ref
dev_guide_attributes_fpmath_mode.


The \f$convert_{dst\_dt}\f$ conversion is not guaranteed to be correctly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be the result of the conversion is not guaranteed to be correctly rounded to the nearest value?


The \f$convert_{dst\_dt}\f$ conversion is not guaranteed to be correctly
rounded. In particular, some hardware platforms have no direct
conversion instructions from f32 to low-precision datatypes (e.g. fp8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
conversion instructions from f32 to low-precision datatypes (e.g. fp8
conversion instructions to convert f32 data types to low-precision data types such as fp8

The \f$convert_{dst\_dt}\f$ conversion is not guaranteed to be correctly
rounded. In particular, some hardware platforms have no direct
conversion instructions from f32 to low-precision datatypes (e.g. fp8
or fp4), and will perform conversion through an intermediate datatype
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
or fp4), and will perform conversion through an intermediate datatype
or fp4, and will perform conversion through an intermediate data type

rounded. In particular, some hardware platforms have no direct
conversion instructions from f32 to low-precision datatypes (e.g. fp8
or fp4), and will perform conversion through an intermediate datatype
(e.g. f16/bf16), which may cause [double
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(e.g. f16/bf16), which may cause [double
(for example, f16 or bf16), which may result in [double

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants