add gptq benchmark, and speed up by ~3x with compile#4310
Merged
Conversation
Contributor
Author
|
Stack from ghstack (oldest at bottom): |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4310
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New FailureAs of commit d302888 with merge base 1b04df3 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Apr 21, 2026
vkuzo
added a commit
that referenced
this pull request
Apr 21, 2026
Summary: 1. add gptq algo benchmark 2. capture a profiling run - two main issues, (a) the to_nvfp4 kernels and (b) the hessian + weight updates 3. speed up (a) significantly by using `torch.compile`, we need to ensure to enable `TORCHINDUCTOR_EMULATE_DIVISION_ROUNDING` to keep parity with eager mode. Note there are significant accuracy regressions without this set (small differences accumulate with each incremental hessian + weight update), so we force it on by default. e2e gptq run on LLaMa 3.2 1B speeds up by ~2.5x (172 seconds -> 69 seconds) with no change in accuracy: ``` time torchao/prototype/gptq/gptq_nvfp4_llama3_2_1b_nonsequential_wikitext.sh 2>&1 | tee ~/tmp/20260421_gptq_run_compile.txt // logs: https://gist.github.com/vkuzo/4ebd0bfa71185b711b19c712216eae29 ``` Test Plan: ghstack-source-id: e73e550 ghstack-comment-id: 4290904117 Pull-Request: #4310
vkuzo
added a commit
that referenced
this pull request
Apr 21, 2026
Summary: 1. add gptq algo benchmark 2. capture a profiling run - two main issues, (a) the to_nvfp4 kernels and (b) the hessian + weight updates 3. speed up (a) significantly by using `torch.compile`, we need to ensure to enable `TORCHINDUCTOR_EMULATE_DIVISION_ROUNDING` to keep parity with eager mode. Note there are significant accuracy regressions without this set (small differences accumulate with each incremental hessian + weight update), so we force it on by default. e2e gptq run on LLaMa 3.2 1B speeds up by ~2.5x (172 seconds -> 69 seconds) with no change in accuracy: ``` time torchao/prototype/gptq/gptq_nvfp4_llama3_2_1b_nonsequential_wikitext.sh 2>&1 | tee ~/tmp/20260421_gptq_run_compile.txt // logs: https://gist.github.com/vkuzo/4ebd0bfa71185b711b19c712216eae29 ``` Test Plan: ghstack-source-id: 8b4b52c ghstack-comment-id: 4290904117 Pull-Request: #4310
jerryzh168
approved these changes
Apr 22, 2026
This was referenced Apr 22, 2026
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.
Summary:
(b) the hessian + weight updates
torch.compile, we need toensure to enable
TORCHINDUCTOR_EMULATE_DIVISION_ROUNDINGto keepparity with eager mode. Note there are significant accuracy
regressions without this set (small differences accumulate with each
incremental hessian + weight update), so we force it on by default.
e2e gptq run on LLaMa 3.2 1B speeds up by ~2.5x (172 seconds -> 69 seconds) with no change in accuracy:
Test Plan: