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

[Relax][Bugfix] Preserve dtype in ToMixedPrecision for kNever ops #17263

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, while an operator with the MixedPrecisionPolicyKind::kNever attribute would not be updated from float32 to float16, it would be erroneously updated from float16 to float32.

This commit updates ToMixedPrecision to preserve the datatype of any arguments used in a kNever operation, rather than forcing them to a float32 datatype.

Prior to this commit, while an operator with the
`MixedPrecisionPolicyKind::kNever` attribute would not be updated from
`float32` to `float16`, it would be erroneously updated from `float16`
to `float32`.

This commit updates `ToMixedPrecision` to preserve the datatype of any
arguments used in a `kNever` operation, rather than forcing them to a
`float32` datatype.
@tqchen tqchen merged commit b3d01c2 into apache:main Aug 11, 2024
19 checks passed
@Lunderberg Lunderberg deleted the relax_bugfix_to_mixed_precision_with_float16_in_input branch August 12, 2024 13:17
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

Successfully merging this pull request may close these issues.

2 participants