Skip to content

Conversation

@vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Sep 25, 2020

Stack from ghstack:

Summary:

Eager mode quantization depends on the presence of the config
model attribute. Currently converting a model to use SyncBatchNorm
removes the qconfig - fixing this. This is important if a BN is not
fused to anything during quantization convert.

Test Plan:

python test/test_quantization.py TestDistributed.test_syncbn_preserves_qconfig

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D23922072

Summary:

Eager mode quantization depends on the presence of the `config`
model attribute.  Currently converting a model to use `SyncBatchNorm`
removes the qconfig - fixing this.  This is important if a BN is not
fused to anything during quantization convert.

Test Plan:

```
python test/test_quantization.py TestDistributed.test_syncbn_preserves_qconfig
```

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@vkuzo vkuzo requested a review from apaszke as a code owner September 25, 2020 00:24
vkuzo added a commit that referenced this pull request Sep 25, 2020
Summary:

Eager mode quantization depends on the presence of the `config`
model attribute.  Currently converting a model to use `SyncBatchNorm`
removes the qconfig - fixing this.  This is important if a BN is not
fused to anything during quantization convert.

Test Plan:

```
python test/test_quantization.py TestDistributed.test_syncbn_preserves_qconfig
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 97e74c3
Pull Request resolved: #45317
@vkuzo vkuzo linked an issue Sep 25, 2020 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Sep 25, 2020

Codecov Report

Merging #45317 into gh/vkuzo/152/base will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           gh/vkuzo/152/base   #45317   +/-   ##
==================================================
  Coverage              68.10%   68.11%           
==================================================
  Files                    393      393           
  Lines                  50945    50947    +2     
==================================================
+ Hits                   34697    34700    +3     
+ Misses                 16248    16247    -1     
Impacted Files Coverage Δ
torch/nn/modules/batchnorm.py 74.14% <100.00%> (+0.35%) ⬆️
torch/testing/_internal/expecttest.py 78.57% <0.00%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71e6ce6...68a97ea. Read the comment docs.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in bdf329e.

@facebook-github-bot facebook-github-bot deleted the gh/vkuzo/152/head branch September 28, 2020 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure that QAT + SyncBN work without conv-BN fusion

5 participants