Skip to content

Conversation

andrewor14
Copy link
Contributor

@andrewor14 andrewor14 commented Apr 7, 2023

Stack from ghstack (oldest at bottom):

Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
nniqat.ConvBn2d. Note this is not the end-to-end flow yet.
In particular, the convert flow needs to swap the new subgraph
with another one that merges the batchnorm stats back into conv.

The Conv + BN fusion is implemented in the following steps:

  1. Annotate all nodes in the pattern [conv - bn - getitem]

  2. Match and replace this pattern with the fused QAT pattern
    (note that this is a larger subgraph than the original one)

  3. Copy over metadata from the original nodes to the
    corresponding nodes in the new subgraph, to ensure the
    stack traces and dtype annotations are preserved

  4. Prepare will insert fake quantizes in the right places
    based on the annotations

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

Reviewers: jerryzh168, kimishpatel, yanboliang

cc @soumith @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire

Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

[ghstack-poisoned]
@andrewor14 andrewor14 requested a review from jerryzh168 as a code owner April 7, 2023 03:01
@pytorch-bot pytorch-bot bot added the release notes: quantization release notes category label Apr 7, 2023
@pytorch-bot
Copy link

pytorch-bot bot commented Apr 7, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/98568

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit bc04d11:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

andrewor14 added a commit that referenced this pull request Apr 7, 2023
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

ghstack-source-id: 3f39bce
Pull Request resolved: #98568
@andrewor14 andrewor14 marked this pull request as draft April 7, 2023 03:03
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 7, 2023
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

ghstack-source-id: 349db4d
Pull Request resolved: #98568
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 7, 2023
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

ghstack-source-id: d2374ac
Pull Request resolved: #98568
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 12, 2023
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

ghstack-source-id: b2e3e49
Pull Request resolved: #98568
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 13, 2023
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

ghstack-source-id: fd1d3dc
Pull Request resolved: #98568
@andrewor14 andrewor14 requested a review from kimishpatel April 13, 2023 16:49
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 13, 2023
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

ghstack-source-id: 7deee75
Pull Request resolved: #98568
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 13, 2023
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

ghstack-source-id: fccf1a0
Pull Request resolved: #98568
Summary: This commit adds the prepare_qat_pt2e API and the
fusion logic for Conv + BN. We use the subgraph rewriter to
match and replace the pattern with the existing logic in
`nniqat.ConvBn2d`. Note this is not the end-to-end flow yet.
In particular, the following things are still missing and
will be added in future PRs:

1) Weight fake quantize after scaled weight
2) Convert flow needs to swap the new subgraph with another
   one that merges the batchnorm stats back into conv

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_qat_conv_bn_fusion

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 28, 2023
…or prepare QAT"


Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [D45360792](https://our.internmc.facebook.com/intern/diff/D45360792)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 28, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [D45360792](https://our.internmc.facebook.com/intern/diff/D45360792)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 28, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_numerics

Reviewers: kimishpatel, jerryzh168

ghstack-source-id: d4ef3ac
Pull Request resolved: #99695
andrewor14 added a commit that referenced this pull request Apr 28, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_numerics

Reviewers: kimishpatel, jerryzh168

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 28, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 28, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request Apr 28, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

ghstack-source-id: 77f6094
Pull Request resolved: #100283
andrewor14 added a commit that referenced this pull request May 3, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

ghstack-source-id: 77f6094
Pull Request resolved: #100283
andrewor14 added a commit that referenced this pull request May 3, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 3, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 3, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 3, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 3, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 3, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 3, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 3, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 4, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 4, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 4, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

ghstack-source-id: 7c8f018
Pull Request resolved: #100283
andrewor14 added a commit that referenced this pull request May 4, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 4, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 5, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 5, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 7, 2023
…or prepare QAT"

Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
andrewor14 added a commit that referenced this pull request May 7, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request May 7, 2023
Summary: This follows #98568,
which lays all the groundwork for Conv + BN fusion in prepare QAT.
Conv + BN + ReLU fusion can reuse the same match and replace
patterns and is handled similarly.

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_fusion
python test/test_quantization.py TestQuantizePT2E.test_prepare_qat_conv_bn_relu_numerics

Reviewers: kimishpatel, jerryzh168

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D45515494](https://our.internmc.facebook.com/intern/diff/D45515494)
Pull Request resolved: #100283
Approved by: https://github.com/jerryzh168
@facebook-github-bot facebook-github-bot deleted the gh/andrewor14/49/head branch June 8, 2023 15:13
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.

5 participants