Skip to content

Commit fe1b2e7

Browse files
Erik-Lundellfacebook-github-bot
authored andcommitted
Add sigmoid to one-to-one annotator in ArmQuantizer (#6047)
Summary: Instead of fixed qspec, sigmoid then becomes annotated with the q-spec from the Quantization fix, similar to other table implemented operators. This fixes the issues introduced by #5832 Change-Id: I7afccf2036e3bdabea71d3f90b79a04b7f522e1f Pull Request resolved: #6047 Reviewed By: mergennachin Differential Revision: D64426085 Pulled By: digantdesai fbshipit-source-id: 6854e389b94af44d036c25862acb9c46192f62ea
1 parent 500019a commit fe1b2e7

File tree

5 files changed

+2
-68
lines changed

5 files changed

+2
-68
lines changed

backends/arm/quantizer/arm_quantizer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ class ArmQuantizer(Quantizer):
267267
"add",
268268
"sub",
269269
"mul",
270-
"sigmoid",
271270
"mm",
272271
"cat",
273272
"one_to_one",

backends/arm/quantizer/quantization_annotation/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,5 @@ def decorator(annotator: AnnotatorType):
5959
mm_annotator,
6060
mul_annotator,
6161
one_to_one_annotator,
62-
sigmoid_annotator,
6362
sub_annotator,
6463
)

backends/arm/quantizer/quantization_annotation/one_to_one_annotator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def _annotate_one_to_one(
4040
torch.ops.aten.log.default,
4141
torch.ops.aten.reciprocal.default,
4242
torch.ops.aten.rsqrt.default,
43+
torch.ops.aten.sigmoid.default,
4344
)
4445
for node in gm.graph.nodes:
4546
if node.op != "call_function" or node.target not in one_to_one_ops:

backends/arm/quantizer/quantization_annotation/sigmoid_annotator.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

backends/arm/test/ops/test_sigmoid.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,12 @@ def test_sigmoid_tosa_BI(self, test_name: str, test_data: torch.Tensor):
155155
def test_add_sigmoid_tosa_MI(self):
156156
self._test_sigmoid_tosa_MI_pipeline(self.AddSigmoid(), (test_data_suite[0][1],))
157157

158-
@unittest.skip(
159-
reason="Started to fails when PyTorch 2.5->2.6 https://github.com/pytorch/executorch/issues/5832"
160-
)
161158
def test_add_sigmoid_tosa_BI(self):
162-
self._test_sigmoid_tosa_BI_pipeline(self.AddSigmoid(), (test_data_suite[0][1],))
159+
self._test_sigmoid_tosa_BI_pipeline(self.AddSigmoid(), (test_data_suite[5][1],))
163160

164161
def test_sigmoid_add_tosa_MI(self):
165162
self._test_sigmoid_tosa_MI_pipeline(self.SigmoidAdd(), (test_data_suite[0][1],))
166163

167-
@unittest.skip(
168-
reason="Started to fails when PyTorch 2.5->2.6 https://github.com/pytorch/executorch/issues/5832"
169-
)
170164
def test_sigmoid_add_tosa_BI(self):
171165
self._test_sigmoid_tosa_BI_pipeline(self.SigmoidAdd(), (test_data_suite[0][1],))
172166

@@ -175,9 +169,6 @@ def test_sigmoid_add_sigmoid_tosa_MI(self):
175169
self.SigmoidAddSigmoid(), (test_data_suite[4][1], test_data_suite[3][1])
176170
)
177171

178-
@unittest.skip(
179-
reason="Started to fails when PyTorch 2.5->2.6 https://github.com/pytorch/executorch/issues/5832"
180-
)
181172
def test_sigmoid_add_sigmoid_tosa_BI(self):
182173
self._test_sigmoid_tosa_BI_pipeline(
183174
self.SigmoidAddSigmoid(), (test_data_suite[4][1], test_data_suite[3][1])

0 commit comments

Comments
 (0)