-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[quantization] fix run_arg tiny bug #48537
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
💊 CI failures summary and remediationsAs of commit 3c209a3 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 24 times. |
Codecov Report
@@ Coverage Diff @@
## master #48537 +/- ##
==========================================
- Coverage 80.93% 80.93% -0.01%
==========================================
Files 1855 1855
Lines 200194 200194
==========================================
- Hits 162024 162020 -4
- Misses 38170 38174 +4 |
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.
OK, thanks. Please try not to use this api since we might want to deprecate it in the future.
this can be replace by
model = prepare(model),
calibrate(model, inputs)
model = convet(model)
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.
@jerryzh168 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
I found you have a similar high-level API for dynamic quantization as well. Can I assume the |
we won't deprecate these in short term. but not sure about longer term. in general quantize_dynamic is not needed either. you can use model = prepare(model, qconfig_dict)
model = convert(model) as well. a single line api does not buy us much and increases the api surface. For example, in case of static quantization, the api should also include a key word argument dictionary to be complete (currently we only have positional run_args). this file: https://github.com/pytorch/pytorch/blob/master/torch/quantization/quantize_fx.py shows the long term apis we are thinking of better. basically just prepare, prepare_qat and convert, and user will decide whether to run calibration/training or not. (we also have some warnings in the observer when calibration/training is not run) |
@jerryzh168 Thank you. I will try to stay away from the "high-level" wrapper API as much as I can. |
@jerryzh168 merged this pull request in 0db7346. |
Summary: This fix allows the calibration function to take in more than one positional argument. Pull Request resolved: pytorch#48537 Reviewed By: zhangguanheng66 Differential Revision: D25255764 Pulled By: jerryzh168 fbshipit-source-id: 3ce20dbed95fd26664a186bd4a992ab406bba827
Note that this is a BC-breaking and it breaks the quantization tutorials. |
This fix allows the calibration function to take in more than one positional argument.