-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[Quant] [PT2] Enable batchnorm in _move_exported_model_to_eval #114547
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
[Quant] [PT2] Enable batchnorm in _move_exported_model_to_eval #114547
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/114547
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1248a8f with merge base 7bbc19a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
**Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
…eval" **Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
ghstack-source-id: e967970 Pull Request resolved: pytorch#114547
|
cc @andrewor14 please take a look |
…eval" **Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
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.
Hi @leslie-fang-intel, thanks for working on this. Could you also add a check for batchnorm in the existing test?
|
Actually, can you paste here what the graphs look like before and after the switch? I would expect to see |
UT added as
|
…eval" **Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d python -u -m pytest -s -v test_quantize_pt2e.py -k test_bn_move_exported_model_to_eval ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
#114547)" This reverts commit bab0540. Reverted #114547 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally ([comment](#114547 (comment)))
…eval" **Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d python -u -m pytest -s -v test_quantize_pt2e.py -k test_bn_move_exported_model_to_eval ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
…eval" **Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d python -u -m pytest -s -v test_quantize_pt2e.py -k test_bn_move_exported_model_to_eval ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
|
Thanks @andrewor14, reopen this PR with additional changes in #114927. Could you help to check if it fixes the internal failures? |
|
Hi @andrewor14, could you help to check if it fixes the internal failure? |
|
@andrewor14 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
Hi @leslie-fang-intel, we're running the tests now. Please don't merge this one yet. I will merge it once all the internal tests pass / once we figure out all the test failures. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Thanks @andrewor14, BTW: we also plan to port it back to 2.2 branch, does it sound good to you? |
…ch#114547) **Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d python -u -m pytest -s -v test_quantize_pt2e.py -k test_bn_move_exported_model_to_eval ``` Pull Request resolved: pytorch#114547 Approved by: https://github.com/jgong5, https://github.com/andrewor14
…ytorch#114725) **Summary** Enable Inplace Dropout replacement in `_move_exported_model_to_eval` **Test Plan** ``` python -u -m pytest -s -v test_quantize_pt2e.py -k test_move_exported_model_to_eval ``` Pull Request resolved: pytorch#114725 Approved by: https://github.com/andrewor14, https://github.com/jgong5 ghstack dependencies: pytorch#114547
pytorch#114547)" This reverts commit bab0540. Reverted pytorch#114547 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally ([comment](pytorch#114547 (comment)))
…ch#114547) **Summary** Add standalone batchnorm into `_move_exported_model_to_eval` to move it from training mode into eval mode **Test Plan** ``` python -m pytest test_mkldnn_pattern_matcher.py -k test_qat_bn_conv2d python -u -m pytest -s -v test_quantize_pt2e.py -k test_bn_move_exported_model_to_eval ``` Differential Revision: [D51853407](https://our.internmc.facebook.com/intern/diff/D51853407) Pull Request resolved: pytorch#114547 Approved by: https://github.com/jgong5, https://github.com/andrewor14
Stack from ghstack (oldest at bottom):
Summary
Add standalone batchnorm into
_move_exported_model_to_evalto move it from training mode into eval modeTest Plan
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
Differential Revision: D51853407