Skip to content

Ensure that QAT + SyncBN work without conv-BN fusion #43592

@vkuzo

Description

@vkuzo

🐛 Bug

repro:

  1. have a model with nn.BatchNorm2d which is not intended to be fused
  2. run torch.quantization.prepare_qat on the model to prepare for QAT
  3. run torch.nn.SyncBatchNorm.convert_sync_batchnorm on the model to prepare for DDP
  4. run torch.quantization.convert_qat to sub in the quantized modules

Currently step 3 does not carry over the qconfig, so the BNs never get quantized in step 4. We should make sure that
a. qconfig survives the swaps.
b. either convert works with SyncBN directly, or there is a utility to go from SyncBN back to BN (tracked in #41081)

cc @jerryzh168 @jianyuh @dzhulgakov @raghuramank100 @jamesr66a @vkuzo

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions