Skip to content

Commit e7421e1

Browse files
committed
Arm backend: Handle extension for int16 in tests
The sigmoid tests uses the EXT-INT16 of the TOSA 1.0 specification, so the extension must be used in the tests. Signed-off-by: Per Åstrand <[email protected]> Change-Id: Ie0d1a03d73e46139c6b6a0822736e2270e716650
1 parent ef76d08 commit e7421e1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

backends/arm/test/ops/test_sigmoid_16bit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_16bit_sigmoid_quantizer(u55_config=False):
4141
tosa_version = conftest.get_option("tosa_version")
4242
tosa_profiles = {
4343
"1.0": TosaSpecification.create_from_string(
44-
"TOSA-1.0+INT" + ("+u55" if u55_config else "")
44+
"TOSA-1.0+INT+int16" + ("+u55" if u55_config else "")
4545
),
4646
}
4747

@@ -94,6 +94,7 @@ def test_sigmoid_tosa_INT(test_data):
9494
Sigmoid.aten_op,
9595
Sigmoid.exir_op,
9696
qtol=1,
97+
tosa_extensions=["int16"],
9798
)
9899
pipeline.change_args("quantize", get_16bit_sigmoid_quantizer())
99100
pipeline.run()
@@ -114,7 +115,9 @@ def test_sigmoid_tosa_INT_add_sigmoid(test_data):
114115
Sigmoid.aten_op,
115116
Sigmoid.exir_op,
116117
qtol=1,
118+
tosa_extensions=["int16"],
117119
)
120+
pipeline.change_args("quantize", get_16bit_sigmoid_quantizer())
118121
pipeline.run()
119122

120123

@@ -154,6 +157,7 @@ def test_sigmoid_u55_INT_add_sigmoid(test_data):
154157
n_expected_delegates=1,
155158
quantize=True,
156159
u55_subset=True,
160+
tosa_extensions=["int16"],
157161
)
158162
pipeline.change_args("quantize", get_16bit_sigmoid_quantizer(True))
159163
pipeline.run()

backends/arm/test/ops/test_sigmoid_32bit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_32bit_sigmoid_quantizer(u55_config=False):
5757
tosa_version = conftest.get_option("tosa_version")
5858
tosa_profiles = {
5959
"1.0": TosaSpecification.create_from_string(
60-
"TOSA-1.0+INT" + ("+u55" if u55_config else "")
60+
"TOSA-1.0+INT+int16" + ("+u55" if u55_config else "")
6161
),
6262
}
6363

@@ -110,6 +110,7 @@ def test_sigmoid_tosa_INT(test_data):
110110
Sigmoid.aten_op,
111111
Sigmoid.exir_op,
112112
qtol=1,
113+
tosa_extensions=["int16"],
113114
)
114115
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer())
115116
pipeline.run()
@@ -123,6 +124,7 @@ def test_sigmoid_tosa_INT_add_sigmoid(test_data):
123124
Sigmoid.aten_op,
124125
Sigmoid.exir_op,
125126
qtol=1,
127+
tosa_extensions=["int16"],
126128
)
127129
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer())
128130
pipeline.run()
@@ -136,6 +138,7 @@ def test_sigmoid_u55_INT(test_data):
136138
{Sigmoid.exir_op: 1},
137139
quantize=True,
138140
u55_subset=True,
141+
tosa_extensions=["int16"],
139142
)
140143
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer(True))
141144
pipeline.run()
@@ -150,6 +153,7 @@ def test_sigmoid_u55_INT_add_sigmoid(test_data):
150153
n_expected_delegates=1,
151154
quantize=True,
152155
u55_subset=True,
156+
tosa_extensions=["int16"],
153157
)
154158
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer(True))
155159
pipeline.run()

0 commit comments

Comments
 (0)