Skip to content

Commit 8f97a34

Browse files
authored
Revert "Milestone3.1: Support tanh op in XNNPACK backend (#11364)" (#11535)
### Summary This reverts commit deb63ec (#11364). Edit: May not need to land this as the schema looks BC. Waiting for internal tests. ### Test plan CI
1 parent cbd3874 commit 8f97a34

File tree

10 files changed

+0
-145
lines changed

10 files changed

+0
-145
lines changed

backends/xnnpack/operators/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,5 @@
5050
op_static_constant_pad,
5151
op_static_resize_bilinear_2d,
5252
op_sub,
53-
op_tanh,
5453
op_to_copy,
5554
)

backends/xnnpack/operators/op_tanh.py

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

backends/xnnpack/partition/config/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
SoftmaxConfig,
5050
SquareRootConfig,
5151
SubConfig,
52-
TanhConfig,
5352
UpsampleBilinear2dConfig,
5453
)
5554
from executorch.backends.xnnpack.partition.config.node_configs import (
@@ -100,7 +99,6 @@
10099
PreluConfig,
101100
ReciprocalSquareRootConfig,
102101
ReLUConfig,
103-
TanhConfig,
104102
# SDPAConfig, TODO: D60553559: preserving SDPA for fairseq fails
105103
SigmoidConfig,
106104
SliceCopyConfig,

backends/xnnpack/partition/config/generic_node_configs.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,6 @@ def supported_precision_types(self) -> List[ConfigPrecisionType]:
371371
return [ConfigPrecisionType.FP32]
372372

373373

374-
class TanhConfig(GenericNodePartitionerConfig):
375-
target_name = "tanh.default"
376-
377-
def supported_precision_types(self) -> List[ConfigPrecisionType]:
378-
return [ConfigPrecisionType.FP32]
379-
380-
381374
class MeanDimConfig(GenericNodePartitionerConfig):
382375
target_name = "mean.dim"
383376

backends/xnnpack/partition/configs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
exir_ops.edge.aten.rsqrt.default,
6767
exir_ops.edge.aten.log.default,
6868
exir_ops.edge.aten.gelu.default,
69-
exir_ops.edge.aten.tanh.default,
7069
]
7170

7271
SUPPORTED_MODULES = [

backends/xnnpack/runtime/XNNCompiler.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,36 +1521,6 @@ Error defineGeluNode(
15211521
return Error::Ok;
15221522
}
15231523

1524-
/*
1525-
Define serialized tanh node into the subgraph, using the remapped ids
1526-
to map the serialized ids, to the new ids generated when defining the
1527-
tensor value
1528-
*/
1529-
Error defineTanhNode(
1530-
xnn_subgraph_t subgraph_ptr,
1531-
const std::unordered_map<uint32_t, uint32_t>& remapped_ids,
1532-
const NodePtr node,
1533-
const fb_xnnpack::XNNGraph* graph) noexcept {
1534-
MAYBE_UNUSED(graph);
1535-
1536-
auto graph_node = node->xnode_union_as_XNNTanh();
1537-
1538-
xnn_status status = xnn_define_tanh(
1539-
subgraph_ptr,
1540-
remapped_ids.at(graph_node->input_id()),
1541-
remapped_ids.at(graph_node->output_id()),
1542-
graph_node->flags());
1543-
1544-
ET_CHECK_OR_RETURN_ERROR(
1545-
status == xnn_status_success,
1546-
Internal,
1547-
"Failed to create tanh node %i with code: %s",
1548-
node->debug_handle(),
1549-
xnn_status_to_string(status));
1550-
1551-
return Error::Ok;
1552-
}
1553-
15541524
/*
15551525
Define serialized ceiling node into the subgraph, using the remapped ids
15561526
to map the serialized ids, to the new ids generated when defining the
@@ -2116,7 +2086,6 @@ DefineNodeFunc getDefineNodeFunc(fb_xnnpack::XNodeUnion nodeType) {
21162086
_DEFINE(Hardswish)
21172087
_DEFINE(LeakyReLU)
21182088
_DEFINE(Log)
2119-
_DEFINE(Tanh)
21202089
_DEFINE(Maximum)
21212090
_DEFINE(Negate)
21222091
_DEFINE(Square)

backends/xnnpack/serialization/runtime_schema.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ union XNodeUnion {
154154
XNNReciprocalSquareRoot: _XNNNode1x1,
155155
XNNLog: _XNNNode1x1,
156156
XNNGelu: _XNNNode1x1,
157-
XNNTanh: _XNNNode1x1,
158157
}
159158

160159
union XValueUnion {

backends/xnnpack/serialization/schema.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ union XNodeUnion {
150150
XNNReciprocalSquareRoot: _XNNNode1x1,
151151
XNNLog: _XNNNode1x1,
152152
XNNGelu: _XNNNode1x1,
153-
XNNTanh: _XNNNode1x1,
154153
}
155154

156155
union XValueUnion {

backends/xnnpack/serialization/xnnpack_graph_schema.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,6 @@ class XNNLog(XNNNode1x1):
319319
pass
320320

321321

322-
@dataclass
323-
class XNNTanh(XNNNode1x1):
324-
pass
325-
326-
327322
@dataclass
328323
class XNNMaximum(XNNNode2x1):
329324
pass
@@ -396,7 +391,6 @@ class XNNScaledDotProductAttention:
396391
XNNReciprocalSquareRoot,
397392
XNNLog,
398393
XNNGelu,
399-
XNNTanh,
400394
]
401395

402396

backends/xnnpack/test/ops/test_tanh.py

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

0 commit comments

Comments
 (0)