pytorch
4434b9af - [quant][pt2] Handle constant conv args in prepare QAT fusion (#100525)

Commit
2 years ago
[quant][pt2] Handle constant conv args in prepare QAT fusion (#100525) Summary: Previously, we would only match and replace conv + BN patterns with default constant args for conv (stride, padding, dilation etc.). If the user sets one of these args to values that are different from the default, we would simply not fuse the pattern. This is due to a limitation in the subgraph rewriter: see https://github.com/pytorch/pytorch/issues/100419. This commit works around the above limitation by first configuring the subgraph rewriter to ignore literals when matching, and then manually copy over the constant args to the new subgraph after `replace_pattern`. Test Plan: python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_fusion_constant_args Reviewers: jerryzh168, kimishpatel Differential Revision: [D45515437](https://our.internmc.facebook.com/intern/diff/D45515437) Pull Request resolved: https://github.com/pytorch/pytorch/pull/100525 Approved by: https://github.com/jerryzh168
Author
Committer
Parents
Loading