Skip to content

Commit fd0adb6

Browse files
psiddhGithub Executorch
andauthored
Reverts the addition of RemoveNoopPass to the Cortex-M pass manager… (#17407)
… (introduced in #17300) which broke 8 quantization tests. After #17300 merged, the following tests started failing: - `test_shared_qspec_quantizer[input_fork_x_shared]` - `test_shared_qspec_quantizer[input_fork_y_shared]` - `test_shared_qspec_quantizer[surrounded_quantized_op]` - `test_shared_qspec_quantizer[output_fork_shared]` - `test_shared_qspec_quantizer[many_forks]` - `test_dialect_mv2[mobilenet_v2]` (+ 2 more) `RemoveNoopPass` removes `clone_dim_order` operators that are functionally necessary for shared quantization specs. It only checks dtype equality, not dim_order/layout changes, causing it to incorrectly remove clones needed for: - Tensor forking in quantized graphs - Shared quantization parameter propagation - Correct quantization fusion Remove `RemoveNoopPass` from the Cortex-M pass pipeline. The MobileNetV2 `clone_dim_order` issue it was meant to address needs a more targeted solution. ```bash pytest -c backends/arm/test/pytest.ini backends/cortex_m/test/misc/test_quantization.py::test_shared_qspec_quantizer -v pytest -c backends/arm/test/pytest.ini backends/cortex_m/test/models/test_mobilenet_v2.py::test_dialect_mv2 -v Co-authored-by: Github Executorch <github_executorch@arm.com>
1 parent 29625e8 commit fd0adb6

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

backends/cortex_m/passes/cortex_m_pass_manager.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from executorch.backends.arm._passes import (
1010
FoldAndAnnotateQParamsPass,
11-
RemoveNoopPass,
1211
ScalarsToAttributePass,
1312
)
1413
from executorch.backends.transforms.remove_getitem_op import RemoveGetItemPass
@@ -35,7 +34,6 @@ class CortexMPassManager(PassManager):
3534
# Run before folding so qparams attach to max_pool2d values, not tuple + getitem.
3635
RemoveGetItemPass,
3736
FoldAndAnnotateQParamsPass,
38-
RemoveNoopPass,
3937
ReplaceScalarWithTensorArgPass,
4038
ReplaceQuantNodesPass,
4139
ActivationFusionPass,

backends/cortex_m/test/models/test_mobilenet_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"executorch_exir_dialects_edge__ops_cortex_m_quantized_conv2d_default": 35,
3535
"executorch_exir_dialects_edge__ops_cortex_m_quantized_depthwise_conv2d_default": 17,
3636
"executorch_exir_dialects_edge__ops_cortex_m_quantized_linear_default": 1,
37+
"executorch_exir_dialects_edge__ops_dim_order_ops__clone_dim_order_default": 1,
3738
}
3839

3940
# Use larger sample set for calibration to get better quantization

0 commit comments

Comments
 (0)