-
Notifications
You must be signed in to change notification settings - Fork 344
Improve SmoothQuant test cases #3101
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3101
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 389b91d with merge base 5cbbd73 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
CC @namgyu-youn I cannot add you as a reviewer. |
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.
LGTM, thanks for the fix
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.
Injecting outliers looks good to me, thanks for the fix.
Thanks. Actually, the cases may fail if we don't. That means alpha=0.5 is worse than 0 with some random inputs. |
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 think we can reproduce outliers by adjusting ratio and size, please check comments Sorry ratio and size looks good, followings should be removed.
Yeah outlier is a key to produce SmoothQuant. Thanks for this change |
Summary
The test cases for SmoothQuant have the following issues:
test_smoothquant_accuracy
uses a single linear as the model, but only submodules can be converted toSmoothQuantObservedLinear
. So, the single linear is never converted and the case does not actually test the results of SmoothQuant linear. When running withpytest -sv
, the following warning messages are printed:convert: module is not SmoothQuantObservedLinear, skipping: <class 'torch.nn.modules.linear.Linear'>
This PR fixes the issues.
Test plan
pytest -sv test/prototype/test_smoothquant.py