add roofline estimation of float8 gemm + overhead #668
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.
Summary:
This PR adds a script to help estimate when it is expected to be faster to convert a
torch.nn.Linear
to float8, versus leaving it in bfloat16, for compute bound training use cases.How we do this:
Note that currently the gemm benchmarks require running a separate script, as documented in the argument descriptions. We can make this nicer at a future time.
Test Plan:
Meta-only spreadsheet with more analysis, we should eventually OSS a vesion of this: https://docs.google.com/spreadsheets/d/1BpgGQjJwSmGen2QHukMmoCl7Ra5bgxAEQLEI0fma-Fs/edit?gid=195198894#gid=195198894
My tl;dr; from the analysis above:
a. getting torch.compile to be optimal for dynamic scaling: ~1.05x per-linear speedup vs dynamic worst-case
b. getting torch.compile to be optimal for delayed scaling: ~1.13x per-linear speedup vs delayed worst-case
c. after (a) and (b) are done, delayed scaling is expected to be 1.06x faster, per-linear, for large shapes
Reviewers:
Subscribers:
Tasks:
Tags: