Skip to content

Commit dae7a02

Browse files
Arm backend: Further adjust quantization test thresholds (#17777)
Signed-off-by: Adrian Lundell <adrian.lundell@arm.com>
1 parent 28fc8b3 commit dae7a02

9 files changed

Lines changed: 34 additions & 32 deletions

File tree

backends/arm/test/ops/test_eq.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def test_eq_scalar_tosa_INT_tensor(test_module):
146146
test_module().get_inputs(),
147147
Equal.aten_op_Tensor,
148148
Equal.exir_op,
149-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
150-
cosine_threshold=0.8,
149+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
150+
cosine_threshold=None,
151151
)
152152
pipeline.run()
153153

@@ -159,8 +159,8 @@ def test_eq_scalar_tosa_INT(test_module):
159159
test_module().get_inputs(),
160160
Equal.aten_op_Tensor,
161161
Equal.exir_op,
162-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
163-
cosine_threshold=0.8,
162+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
163+
cosine_threshold=None,
164164
)
165165
pipeline.run()
166166

backends/arm/test/ops/test_floor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_floor_tosa_INT(test_data: input_t1):
8787
module.exir_op,
8888
atol=0.06,
8989
rtol=0.01,
90-
frobenius_threshold=0.2,
90+
frobenius_threshold=0.3,
9191
)
9292
pipeline.run()
9393

backends/arm/test/ops/test_ge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def test_ge_tensor_tosa_INT(test_module):
148148
test_module().get_inputs(),
149149
GreaterEqual.aten_op_tensor,
150150
GreaterEqual.exir_op,
151-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
152-
cosine_threshold=0.8,
151+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
152+
cosine_threshold=None,
153153
)
154154
pipeline.run()
155155

@@ -161,8 +161,8 @@ def test_ge_scalar_tosa_INT(test_module):
161161
test_module().get_inputs(),
162162
GreaterEqual.aten_op_tensor,
163163
GreaterEqual.exir_op,
164-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
165-
cosine_threshold=0.8,
164+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
165+
cosine_threshold=None,
166166
)
167167
pipeline.run()
168168

backends/arm/test/ops/test_gt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ def test_gt_tensor_tosa_INT(test_module):
149149
test_module().get_inputs(),
150150
Greater.aten_op_tensor,
151151
Greater.exir_op,
152-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
153-
cosine_threshold=0.8,
152+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
153+
cosine_threshold=None,
154154
)
155155
pipeline.run()
156156

@@ -162,8 +162,8 @@ def test_gt_scalar_tosa_INT(test_module):
162162
test_module().get_inputs(),
163163
Greater.aten_op_tensor,
164164
Greater.exir_op,
165-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
166-
cosine_threshold=0.8,
165+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
166+
cosine_threshold=None,
167167
)
168168
pipeline.run()
169169

backends/arm/test/ops/test_le.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def test_le_tensor_tosa_INT(test_module):
125125
test_module().get_inputs(),
126126
LessEqual.aten_op_tensor,
127127
LessEqual.exir_op,
128-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
129-
cosine_threshold=0.8,
128+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
129+
cosine_threshold=None,
130130
)
131131
pipeline.run()
132132

@@ -138,8 +138,8 @@ def test_le_scalar_tosa_INT(test_module):
138138
test_module().get_inputs(),
139139
LessEqual.aten_op_tensor,
140140
LessEqual.exir_op,
141-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
142-
cosine_threshold=0.8,
141+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
142+
cosine_threshold=None,
143143
)
144144
pipeline.run()
145145

backends/arm/test/ops/test_logit.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,16 @@ def test_logit_tosa_FP(test_data: Tuple):
5252
pipeline.run()
5353

5454

55-
@common.parametrize(
56-
"test_data", test_data_suite, xfails={"uniform_valid": "Numerical error in TFA"}
57-
)
55+
@common.parametrize("test_data", test_data_suite)
5856
def test_logit_tosa_INT(test_data: Tuple):
5957
pipeline = TosaPipelineINT[input_t1](
6058
Logit(),
6159
(*test_data,),
6260
aten_op=[],
6361
exir_op=exir_op,
6462
# Quantization issues when logit(x) -> inf
65-
frobenius_threshold=1.0,
66-
cosine_threshold=0.8,
63+
frobenius_threshold=None,
64+
cosine_threshold=None,
6765
)
6866
pipeline.run()
6967

backends/arm/test/ops/test_lt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def test_lt_tensor_tosa_INT(test_module):
125125
test_module().get_inputs(),
126126
LessThan.aten_op_tensor,
127127
LessThan.exir_op,
128-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
129-
cosine_threshold=0.8,
128+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
129+
cosine_threshold=None,
130130
)
131131
pipeline.run()
132132

@@ -138,8 +138,8 @@ def test_lt_scalar_tosa_INT(test_module):
138138
test_module().get_inputs(),
139139
LessThan.aten_op_tensor,
140140
LessThan.exir_op,
141-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
142-
cosine_threshold=0.8,
141+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
142+
cosine_threshold=None,
143143
)
144144
pipeline.run()
145145

backends/arm/test/ops/test_ne.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def test_ne_tensor_tosa_INT(test_module):
111111
test_module.get_inputs(),
112112
NotEqual.decomposed_ops,
113113
NotEqual.exir_op,
114-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
115-
cosine_threshold=0.8,
114+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
115+
cosine_threshold=None,
116116
)
117117
pipeline.run()
118118

@@ -124,8 +124,8 @@ def test_ne_scalar_tosa_INT(test_module):
124124
test_module.get_inputs(),
125125
NotEqual.decomposed_ops,
126126
NotEqual.exir_op,
127-
frobenius_threshold=0.6, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
128-
cosine_threshold=0.8,
127+
frobenius_threshold=None, # Quantized comparisons with small diffs can be inaccurate, leading to large errors in unlucky cases.
128+
cosine_threshold=None,
129129
)
130130
pipeline.run()
131131

backends/arm/test/ops/test_scalars.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def test_div_scalar_tosa_FP(test_data):
401401
def test_div_tensor_tosa_INT_scalar(test_data):
402402
"""Tests regular div with one scalar input."""
403403
pipeline = TosaPipelineINT[input_t1](
404-
Div(), test_data, aten_op=[], frobenius_threshold=0.5
404+
Div(), test_data, aten_op=[], frobenius_threshold=None, cosine_threshold=None
405405
)
406406
pipeline.run()
407407

@@ -410,7 +410,11 @@ def test_div_tensor_tosa_INT_scalar(test_data):
410410
def test_div_tensor_tosa_INT_inplace(test_data):
411411
"""Tests inplace div with one scalar input."""
412412
pipeline = TosaPipelineINT[input_t1](
413-
DivInplace(), test_data, aten_op=[], frobenius_threshold=0.5
413+
DivInplace(),
414+
test_data,
415+
aten_op=[],
416+
frobenius_threshold=None,
417+
cosine_threshold=None,
414418
)
415419
pipeline.run()
416420

0 commit comments

Comments
 (0)