-
Notifications
You must be signed in to change notification settings - Fork 25.6k
qat syncbn: add test coverage #38738
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
Summary: Adds test coverage for swapping BN -> SyncBN on a fused ConvBN module. Test Plan: ``` python test/test_quantization.py TestDistributed.test_qat_convbn_fused_syncbn_replacement ``` Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit e6ae36e (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis 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 7 times. |
fused_model.qconfig = torch.quantization.get_default_qconfig('fbgemm') | ||
torch.quantization.prepare_qat(fused_model, inplace=True) | ||
# replace with DDP | ||
fused_model = nn.SyncBatchNorm.convert_sync_batchnorm(fused_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.
Does the convert logic need to be modified after training ? How about a test to check that convert works with sync bn module?
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.
yep, sounds good. let's save that for a separate PR? I don't plan to get to that until we verify SyncBN accuracy with QAT, and it would be great to land this in the meanwhile.
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.
Sure, approving it now.
Summary: Adds test coverage for swapping BN -> SyncBN on a fused ConvBN module. Test Plan: ``` python test/test_quantization.py TestDistributed.test_qat_convbn_fused_syncbn_replacement ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D21648320](https://our.internmc.facebook.com/intern/diff/D21648320) [ghstack-poisoned]
This pull request has been merged in 4d5d9c0. |
Stack from ghstack:
Summary:
Adds test coverage for swapping BN -> SyncBN on a fused ConvBN module.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D21648320