Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[float8] improve eager numerics for dynamic scales and gets on par with torch.compile #904
[float8] improve eager numerics for dynamic scales and gets on par with torch.compile #904
Changes from 2 commits
6bf0f5c
553687f
19a592d
218290e
24ec914
c099486
b93ffc8
ebff416
8978ab2
f17dc12
511c751
9becda1
e4fdca9
0cd4d37
014558d
3267402
1e07eff
ebdeed0
09ffa22
0b8dd85
87faf04
3a9fdb0
fc6c393
0043ace
ab3435c
a05a40f
334891b
c706139
93554c0
efd9bb9
85126cc
a5a426e
e7270f1
352685c
168cfe9
5900c3e
37e1479
2efde49
8c04f4f
04b229b
8b7c2ef
9346afd
3d0da20
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move to
test_compile.py
since this is testing compile vs eager?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without upcasting, the eager numeric is like
-157.00000000000000000000
, compile is like-157.06507873535156250000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
torch.compile upcast tensor ahead, see
tmp0 = tl.load(in_ptr0 + (x0), None).to(tl.float32)
in following output codeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upcast
amax
inamax_to_scale
instead oftensor_to_amax
for 2 reasonsamax_buffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you share why the upcasting happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can look into inductor more on how it achieved fp64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
torch.compile actually upcasts to float32 with
tl.load(in_ptr0 + (x0), None).to(tl.float32)
. Upcasting to float64 further help because torch.compile and eager shows different numerics for 1.0 / float32 (but same numeric for float64)The float32 numeric difference can be verified with