fix float8 rowwise inference perf with torch.compile#2672
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2672
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 2 PendingAs of commit 8c23d32 with merge base 7dbc816 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
In #2379, logic was added which prevented torchinductor from fusing the activation quantization for float8 inference. This PR reverts most of #2379, and adds a test to ensure we see the correct # of GPU kernels for float8 tensorwise and rowwise quantization. We'll have to re-do #2379 without breaking this test. Summary: Test Plan: ```bash TORCHINDUCTOR_FORCE_DISABLE_CACHES=1 pytest test/dtypes/test_affine_quantized_float.py -s -k expected_kernels_on_gpu ``` Reviewers: Subscribers: Tasks: Tags:
3e9752c to
8c23d32
Compare
jerryzh168
approved these changes
Aug 4, 2025
jerryzh168
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix, I feel this might be related to the fbgemm benchmark regression as well
liangel-02
pushed a commit
that referenced
this pull request
Aug 25, 2025
In #2379, logic was added which prevented torchinductor from fusing the activation quantization for float8 inference. This PR reverts most of #2379, and adds a test to ensure we see the correct # of GPU kernels for float8 tensorwise and rowwise quantization. We'll have to re-do #2379 without breaking this test. Summary: Test Plan: ```bash TORCHINDUCTOR_FORCE_DISABLE_CACHES=1 pytest test/dtypes/test_affine_quantized_float.py -s -k expected_kernels_on_gpu ``` Reviewers: Subscribers: Tasks: Tags:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In #2379, logic was added which prevented torchinductor from fusing the activation quantization for float8 inference. Here are some logs which show the extra kernels being added by that PR to float8 inference on NVIDIA GPUs: https://www.internalfb.com/phabricator/paste/view/P1891592748 .
This PR reverts most of #2379, and adds a test to ensure we see the correct # of GPU kernels for float8 tensorwise and rowwise quantization. We'll have to re-do #2379 without breaking this test.
Perf impact of this PR on MKN == 1024, 2048, 4096 on an NVIDIA H100 for float8 rowwise inference:
Note that I added a benchmark to
benchmarks/inference/bench_float8_inference.pyto reproduce the numbers above, but I ran this benchmark out-of-tree to get the actual numbers, for easier comparison of before-this-PR vs after-this-PR.Summary:
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags: