Skip to content

Commit aaf663c

Browse files
committed
Revert "Milestone3.1: Support tanh op in XNNPACK backend (#11364)"
This reverts commit deb63ec.
1 parent 120eb85 commit aaf663c

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
@@ -51,6 +51,5 @@
5151
op_static_constant_pad,
5252
op_static_resize_bilinear_2d,
5353
op_sub,
54-
op_tanh,
5554
op_to_copy,
5655
)

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
@@ -50,7 +50,6 @@
5050
SoftmaxConfig,
5151
SquareRootConfig,
5252
SubConfig,
53-
TanhConfig,
5453
UpsampleBilinear2dConfig,
5554
)
5655
from executorch.backends.xnnpack.partition.config.node_configs import (
@@ -102,7 +101,6 @@
102101
PreluConfig,
103102
ReciprocalSquareRootConfig,
104103
ReLUConfig,
105-
TanhConfig,
106104
# SDPAConfig, TODO: D60553559: preserving SDPA for fairseq fails
107105
SigmoidConfig,
108106
SliceCopyConfig,

backends/xnnpack/partition/config/generic_node_configs.py

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

380380

381-
class TanhConfig(GenericNodePartitionerConfig):
382-
target_name = "tanh.default"
383-
384-
def supported_precision_types(self) -> List[ConfigPrecisionType]:
385-
return [ConfigPrecisionType.FP32]
386-
387-
388381
class MeanDimConfig(GenericNodePartitionerConfig):
389382
target_name = "mean.dim"
390383

backends/xnnpack/partition/configs.py

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

7372
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
@@ -2146,7 +2116,6 @@ DefineNodeFunc getDefineNodeFunc(fb_xnnpack::XNodeUnion nodeType) {
21462116
_DEFINE(Hardswish)
21472117
_DEFINE(LeakyReLU)
21482118
_DEFINE(Log)
2149-
_DEFINE(Tanh)
21502119
_DEFINE(Maximum)
21512120
_DEFINE(Negate)
21522121
_DEFINE(Square)

backends/xnnpack/serialization/runtime_schema.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ union XNodeUnion {
155155
XNNReciprocalSquareRoot: _XNNNode1x1,
156156
XNNLog: _XNNNode1x1,
157157
XNNGelu: _XNNNode1x1,
158-
XNNTanh: _XNNNode1x1,
159158
}
160159

161160
union XValueUnion {

backends/xnnpack/serialization/schema.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ union XNodeUnion {
151151
XNNReciprocalSquareRoot: _XNNNode1x1,
152152
XNNLog: _XNNNode1x1,
153153
XNNGelu: _XNNNode1x1,
154-
XNNTanh: _XNNNode1x1,
155154
}
156155

157156
union XValueUnion {

backends/xnnpack/serialization/xnnpack_graph_schema.py

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

326326

327-
@dataclass
328-
class XNNTanh(XNNNode1x1):
329-
pass
330-
331-
332327
@dataclass
333328
class XNNMaximum(XNNNode2x1):
334329
pass
@@ -401,7 +396,6 @@ class XNNScaledDotProductAttention:
401396
XNNReciprocalSquareRoot,
402397
XNNLog,
403398
XNNGelu,
404-
XNNTanh,
405399
]
406400

407401

backends/xnnpack/test/ops/test_tanh.py

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

0 commit comments

Comments
 (0)