Skip to content

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

Merged
tqchen merged 1 commit intoapache:mainfrom
Lunderberg:relax_bugfix_to_mixed_precision_with_float16_in_input
Aug 11, 2024
Merged

[Relax][Bugfix] Preserve dtype in ToMixedPrecision for kNever ops#17263
tqchen merged 1 commit intoapache:mainfrom
Lunderberg:relax_bugfix_to_mixed_precision_with_float16_in_input

Conversation

@Lunderberg
Copy link
Copy Markdown
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
@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