Skip to content
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

[Quantization 2.0] Insert observer incorrectly for conv add relu fusion in prepare phase #96288

Closed
leslie-fang-intel opened this issue Mar 8, 2023 · 6 comments
Assignees
Labels
oncall: quantization Quantization support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@leslie-fang-intel
Copy link
Collaborator

leslie-fang-intel commented Mar 8, 2023

🐛 Describe the bug

When we define a conv add relu fusion pattern in Quantization 2.0 similarly as we do in Quantization 1.x , we find the observer doesn't insert correctly.
Here is the example code to reproduce this issue.

Test Eager Module

class Mod(torch.nn.Module):
    def __init__(self,) -> None:
        super().__init__()
        self.conv = torch.nn.Conv2d(
            in_channels=3, out_channels=16, kernel_size=3, stride=1, padding=1, bias=False
        )
        self.maxpool = torch.nn.MaxPool2d(2)
        self.conv2 = torch.nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=False)
        self.conv3 = torch.nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True)
        self.relu = torch.nn.ReLU()

    def forward(self, x):
        x1 = self.conv(x)
        return self.relu(self.conv2(x1) + self.conv3(x1))

Current FX Graph after prepare

                                        input
                                          |
                                   Activation_Observer1
                                          |
                                        Conv1 - Weight_Oberser1 - Weight1
                                          |
                                  Activation_Observer2	
                                    /           \
    Weight2 - Weight_Oberser2 - Conv2          Conv3
                                    \            /
                                         ADD
                                          |
                                         ReLU
                                          |
                                Activation_Observer4
                                          |
                                        Output

Expected FX Graph after prepare

                                        input
                                          |
                                   Activation_Observer1
                                          |
                                        Conv1 - Weight_Oberser1 - Weight1
                                          |
                                  Activation_Observer2	
                                    /           \
    Weight2 - Weight_Oberser2 - Conv2          Conv3 - Weight_Oberser3 - Weight3
                                    \            /
                                             Activation_Observer3
                                               /
                                         ADD
                                          |
                                         ReLU
                                          |
                                Activation_Observer4
                                          |
                                        Output

Main 2 issues to convert current FX graph into expected FX graph:

  1. When a conv node has been recognized as extra input node, the inputs(weight) of this conv node has no observer inserted.
  2. Observer is needed between extra input node and the add node.

Versions

Collecting environment information...
PyTorch version: 2.1.0a0+git9e3f173
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: CentOS Linux 7 (Core) (x86_64)
GCC version: (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.17

Python version: 3.8.10 (default, Jun 4 2021, 15:09:15) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-4.19.5-1.el7.elrepo.x86_64-x86_64-with-glibc2.17
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 56
On-line CPU(s) list: 0-55
Thread(s) per core: 1
Core(s) per socket: 28
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel Genuine CPU
Stepping: 10
CPU MHz: 1399.790
CPU max MHz: 2900.0000
CPU min MHz: 1200.0000
BogoMIPS: 5800.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 39424K
NUMA node0 CPU(s): 0-27
NUMA node1 CPU(s): 28-55
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke avx512_vnni flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.22.3
[pip3] torch==2.1.0a0+git9e3f173
[pip3] torchvision==0.15.0a0+5850f37
[conda] mkl 2023.0.0 intel_25398 intel
[conda] mkl-include 2023.0.0 intel_25398 intel
[conda] mkl-service 2.4.0 py38h3605609_14 intel
[conda] mkl_fft 1.3.1 py38hcab1719_22 intel
[conda] mkl_random 1.2.2 py38hbf47bc3_22 intel
[conda] mkl_umath 0.1.1 py38hf66a691_32 intel
[conda] numpy 1.22.3 py38hf0956d0_5 intel
[conda] numpy-base 1.22.3 py38h45c9ace_5 intel

cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen

@leslie-fang-intel
Copy link
Collaborator Author

@jerryzh168 @vkuzo Please help to advise where to be the start point for resolving this issue. Also cc @Xia-Weiwen @jgong5.

@vkuzo
Copy link
Contributor

vkuzo commented Mar 8, 2023

cc @andrewor14 .

just to clarify, does this work as expected in FX graph mode quantization, or is it broken in both FX graph mode quantization and PT2E quantization?

@leslie-fang-intel
Copy link
Collaborator Author

Hi @vkuzo, thanks for the comment. Conv_Add_ReLU fusion works in FX graph mode with 1.X quantization flow. It breaks in PT2E quantization.

@dagitses dagitses added the oncall: quantization Quantization support in PyTorch label Mar 9, 2023
leslie-fang-intel added a commit that referenced this issue Mar 20, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288


[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 20, 2023
leslie-fang-intel added a commit that referenced this issue Mar 20, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288


[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 20, 2023
leslie-fang-intel added a commit that referenced this issue Mar 21, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 21, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 22, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 22, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 22, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 22, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 22, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 22, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 23, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 23, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 23, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 23, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 25, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 25, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 27, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 27, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 27, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 27, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
@jerryzh168
Copy link
Contributor

please wait for the new programmable API for setting quantization configs, I hope to have it soon

leslie-fang-intel added a commit that referenced this issue Mar 29, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 29, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 29, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Mar 29, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 3, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 3, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 10, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 10, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 10, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 10, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 16, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 16, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 17, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 17, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 23, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Apr 23, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue May 6, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue May 6, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue May 10, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue May 10, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue May 24, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue May 24, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Jun 20, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Jun 20, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Jun 25, 2023
…_relu fusion issue"


**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this issue Jun 25, 2023
**Summary**
Fix the issue #97120 and #96288. The main change in this PR is: If a node is an extra input node of a `conv_add_relu` fusion pattern such as the `MatchALL` node below. We will skip add this `MatchALL` node into `match_map` [here](https://github.com/pytorch/pytorch/blob/master/torch/ao/quantization/fx/match_utils.py#L184).
```
    Input
    /  \
Conv   MatchALL
    \   /
     ADD
      |
    ReLU
      |
   Output
```



[ghstack-poisoned]
@andrewor14 andrewor14 self-assigned this Jul 7, 2023
@andrewor14 andrewor14 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jul 7, 2023
@andrewor14
Copy link
Contributor

Hi @leslie-fang-intel, can you verify this is still an issue with the latest master? Also, just to clarify, when you say "FX graph" in your PR description, are you referring to FX graph mode quantization or the new PT2 Export quantization?

@leslie-fang-intel
Copy link
Collaborator Author

Thanks @andrewor14. It works with PT2E path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oncall: quantization Quantization support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

5 participants