Skip to content

Commit c3d20c4

Browse files
committed
Test the IOQuantization pass does not have Q/DQ nodes
Change-Id: Ie3b466af5671f575d2b09e7775ce0b9a11920f2a
1 parent d06097c commit c3d20c4

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

backends/arm/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ pytest -c /dev/null -v -n auto backends/arm/test --arm_run_corstoneFVP
124124

125125
## Passes
126126

127-
With the default passes in the Arm Ethos-U backend, assuming the model lowers fully to the
128-
Ethos-U, the exported program is composed of a Quantize node, Ethos-U custom delegate
127+
With the default passes in the Arm Ethos-U backend, assuming the model lowers fully to the
128+
Ethos-U, the exported program is composed of a Quantize node, Ethos-U custom delegate
129129
and a Dequantize node. In some circumstances, you may want to feed quantized input to the Neural
130-
Network straight away, e.g. if you have a camera sensor outputting (u)int8 data and keep all the
131-
arithmetic of the application in the int8 domain. For these cases, you can apply the
130+
Network straight away, e.g. if you have a camera sensor outputting (u)int8 data and keep all the
131+
arithmetic of the application in the int8 domain. For these cases, you can apply the
132132
`exir/passes/quantize_io_pass.py`. See the unit test in `executorch/backends/arm/
133-
test/passes/test_ioquantization_pass.py`for an example how to feed quantized inputs and
133+
test/passes/test_ioquantization_pass.py`for an example how to feed quantized inputs and
134134
obtain quantized outputs.
135135

136136

backends/arm/test/passes/test_ioquantization_pass.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,27 @@ def test_ioquantisation_pass(self):
4040
.quantize()
4141
.export()
4242
.to_edge()
43+
.check_count(
44+
{
45+
"executorch_exir_dialects_edge__ops_quantized_decomposed_quantize_per_tensor_default": 3
46+
}
47+
)
48+
.check_count(
49+
{
50+
"executorch_exir_dialects_edge__ops_quantized_decomposed_dequantize_per_tensor_default": 3
51+
}
52+
)
4353
.partition()
54+
.check_count(
55+
{
56+
"executorch_exir_dialects_edge__ops_quantized_decomposed_quantize_per_tensor_default": 2
57+
}
58+
)
59+
.check_count(
60+
{
61+
"executorch_exir_dialects_edge__ops_quantized_decomposed_dequantize_per_tensor_default": 1
62+
}
63+
)
4464
)
4565
edge = tester.get_artifact()
4666
edge.transform(

0 commit comments

Comments
 (0)