Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backends/arm/_passes/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,7 +75,6 @@
from .decompose_select import DecomposeSelectPass # noqa
from .decompose_select_scatter_pass import DecomposeSelectScatterPass # noqa
from .decompose_sign_pass import DecomposeSignPass # noqa
from .decompose_silu_pass import DecomposeSiluPass # noqa
from .decompose_sinh_pass import DecomposeSinhPass # noqa
from .decompose_softmax_pass import DecomposeSoftmaxPass # noqa
from .decompose_softmax_unstable_pass import DecomposeSoftmaxUnstablePass # noqa
Expand Down
2 changes: 0 additions & 2 deletions backends/arm/_passes/arm_pass_manager.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,7 +76,6 @@
DecomposeSelectPass,
DecomposeSelectScatterPass,
DecomposeSignPass,
DecomposeSiluPass,
DecomposeSinhPass,
DecomposeSoftmaxPass,
DecomposeSoftmaxUnstablePass,
Expand DownExpand Up@@ -434,7 +433,6 @@ def transform_for_annotation_pipeline(self, graph_module: GraphModule):
DecomposeLeakyReLUPass(tfa_pass=True),
DecomposeLinalgVectorNormPass(tfa_pass=True),
DecomposeSqrtPass(tfa_pass=True),
DecomposeSiluPass(tfa_pass=True),
DecomposeAvgPool2dPass(tfa_pass=True),
DecomposeSoftmaxUnstablePass(tfa_pass=True),
DecomposeSoftmaxPass(tfa_pass=True),
Expand Down
41 changes: 0 additions & 41 deletions backends/arm/_passes/decompose_silu_pass.py

This file was deleted.

1 change: 1 addition & 0 deletions backends/arm/_passes/insert_table_ops.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,6 +55,7 @@ class TableOps:
exir_ops.edge.aten.cosh.default: torch.cosh,
exir_ops.edge.aten.acos.default: torch.acos,
exir_ops.edge.aten.tan.default: torch.tan,
exir_ops.edge.aten.silu.default: torch.nn.functional.silu,
}

# Targets that must be treated explicitly
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -123,6 +123,7 @@
exir_ops.edge.aten.copy.default,
exir_ops.edge.aten.tan.default,
exir_ops.edge.aten.index_put.default,
exir_ops.edge.aten.silu.default,
}


Expand Down
2 changes: 2 additions & 0 deletions backends/arm/quantizer/quantization_annotator.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -388,6 +388,7 @@ def _match_pattern(
torch.ops.aten.zeros_like.default,
torch.ops.aten.pow.Tensor_Scalar,
torch.ops.aten.gelu.default,
torch.ops.aten.silu.default,
torch.ops.aten.sinh.default,
torch.ops.aten.atan.default,
torch.ops.aten.log1p.default,
Expand DownExpand Up@@ -468,6 +469,7 @@ def _match_pattern(
torch.ops.aten.hardtanh_.default,
torch.ops.aten.relu.default,
torch.ops.aten.relu_.default,
torch.ops.aten.silu_.default,
torch.ops.aten.mean.default,
torch.ops.aten.mean.dim,
torch.ops.aten.permute.default,
Expand Down
27 changes: 17 additions & 10 deletions backends/arm/test/ops/test_silu.py
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# Copyright 2025 Arm Limited and/or its affiliates.
# Copyright 2025-2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
Expand DownExpand Up@@ -43,7 +43,6 @@ def forward(

aten_op_FP = "torch.ops.aten.silu.default"
aten_op_inplace_FP = "torch.ops.aten.silu_.default"
aten_op_INT = ["torch.ops.aten.sigmoid.default", "torch.ops.aten.mul.Tensor"]


@common.parametrize("test_data", Silu.test_data)
Expand All@@ -63,14 +62,22 @@ def test_silu_tosa_FP_inplace(test_data: input_t):
@common.parametrize("test_data", Silu.test_data)
def test_silu_tosa_INT(test_data: input_t):
silu_data = (test_data(), False)
pipeline = TosaPipelineINT[input_t](Silu(), silu_data, Silu.aten_op_INT)
pipeline = TosaPipelineINT[input_t](
Silu(),
silu_data,
[],
)
pipeline.run()


@common.parametrize("test_data", Silu.test_data)
def test_silu_tosa_INT_inplace(test_data: input_t):
silu_data = (test_data(), True)
pipeline = TosaPipelineINT[input_t](Silu(), silu_data, Silu.aten_op_INT)
pipeline = TosaPipelineINT[input_t](
Silu(),
silu_data,
[],
)
pipeline.run()


Expand All@@ -81,7 +88,7 @@ def test_silu_u55_INT(test_data: input_t):
pipeline = EthosU55PipelineINT[input_t](
Silu(),
silu_data,
Silu.aten_op_INT,
[],
)
pipeline.run()

Expand All@@ -93,7 +100,7 @@ def test_silu_u55_INT_inplace(test_data: input_t):
pipeline = EthosU55PipelineINT[input_t](
Silu(),
silu_data,
Silu.aten_op_INT,
[],
)
pipeline.run()

Expand All@@ -105,7 +112,7 @@ def test_silu_u85_INT(test_data: input_t):
pipeline = EthosU85PipelineINT[input_t](
Silu(),
silu_data,
Silu.aten_op_INT,
[],
)
pipeline.run()

Expand All@@ -117,7 +124,7 @@ def test_silu_u85_INT_inplace(test_data: input_t):
pipeline = EthosU85PipelineINT[input_t](
Silu(),
silu_data,
Silu.aten_op_INT,
[],
)
pipeline.run()

Expand DownExpand Up@@ -155,7 +162,7 @@ def test_silu_vgf_quant(test_data: input_t):
pipeline = VgfPipeline[input_t](
Silu(),
silu_data,
Silu.aten_op_INT,
[],
quantize=True,
)
pipeline.run()
Expand All@@ -168,7 +175,7 @@ def test_silu_vgf_quant_inplace(test_data: input_t):
pipeline = VgfPipeline[input_t](
Silu(),
silu_data,
Silu.aten_op_INT,
[],
quantize=True,
)
pipeline.run()
4 changes: 4 additions & 0 deletions backends/arm/tosa/partitioner.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -369,6 +369,8 @@ def ops_to_not_decompose( # noqa: C901
torch.ops.aten.hardswish.default,
torch.ops.aten.linear.default,
torch.ops.aten.linspace.default,
torch.ops.aten.silu.default,
torch.ops.aten.silu_.default,
}
ops_to_not_decompose_if_fp = {
torch.ops.aten.eye.default,
Expand All@@ -382,6 +384,8 @@ def ops_to_not_decompose( # noqa: C901
ops_to_not_decompose_if_integer = {
torch.ops.aten.eye.default,
torch.ops.aten.linspace.default,
torch.ops.aten.silu.default,
torch.ops.aten.silu_.default,
}

def filter_fn(node: torch.fx.Node) -> bool:
Expand Down
Loading