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
18 changes: 0 additions & 18 deletions backends/arm/TARGETS
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# @noautodeps
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

python_library(
name = "arm_partitioner",
srcs = [
Expand All @@ -9,21 +8,18 @@ python_library(
"tosa_backend.py",
"tosa_partitioner.py",
],
typing = True,
deps = [
":arm_backend",
"//executorch/backends/arm/operator_support:operator_support",
"//executorch/backends/arm/_passes:passes",
"//executorch/exir:lib",
],
)

python_library(
name = "arm_backend",
srcs = [
"arm_backend.py",
],
typing = True,
deps = [
"fbsource//third-party/pypi/flatbuffers:flatbuffers",
"fbsource//third-party/pypi/ml-dtypes:ml-dtypes",
Expand All @@ -36,11 +32,9 @@ python_library(
"//executorch/backends/arm/_passes:passes",
],
)

python_library(
name = "process_node",
srcs = ["process_node.py"],
typing = True,
deps = [
"fbsource//third-party/serialization_lib/python/tosa:tosa",
"//executorch/backends/arm/operators:node_visitor",
Expand All @@ -50,36 +44,30 @@ python_library(
"//executorch/exir:lib",
],
)

python_library(
name = "arm_vela",
srcs = [
"arm_vela.py",
],
typing = True,
deps = [
"fbsource//third-party/pypi/ethos-u-vela:ethos-u-vela",
],
)

python_library(
name = "tosa_mapping",
srcs = [
"tosa_mapping.py",
],
typing = True,
deps = [
"fbsource//third-party/serialization_lib/python/serializer:serializer",
"//caffe2:torch",
],
)

python_library(
name = "tosa_quant_utils",
srcs = [
"tosa_quant_utils.py",
],
typing = True,
deps = [
"fbsource//third-party/pypi/numpy:numpy",
"fbsource//third-party/serialization_lib/python/serializer:serializer",
Expand All @@ -88,38 +76,32 @@ python_library(
"//executorch/exir/dialects:lib",
],
)

python_library(
name = "tosa_specification",
srcs = [
"tosa_specification.py",
],
typing = True,
deps = [
"fbsource//third-party/pypi/packaging:packaging",
"//executorch/exir/backend:compile_spec_schema",
],
)

python_library(
name = "tosa_utils",
srcs = [
"tosa_utils.py",
],
typing = True,
deps = [
"fbsource//third-party/serialization_lib/python/serializer:serializer",
":tosa_quant_utils",
"//executorch/backends/arm/operators:node_visitor",
],
)

python_library(
name = "arm_model_evaluator",
srcs = [
"util/arm_model_evaluator.py",
],
typing = True,
deps = [
"//caffe2:torch",
]
Expand Down
1 change: 0 additions & 1 deletion backends/arm/_passes/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
python_library(
name = "passes",
srcs = glob(["*.py"]),
typing = True,
deps = [
"//executorch/backends/arm:tosa_quant_utils",
"//executorch/backends/arm:tosa_utils",
Expand Down
1 change: 0 additions & 1 deletion backends/arm/operator_support/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
python_library(
name = "operator_support",
srcs = glob(["*.py"]),
typing = True,
deps = [
"//executorch/backends/arm/_passes:passes",
"//executorch/backends/arm:tosa_specification",
Expand Down
3 changes: 0 additions & 3 deletions backends/arm/operators/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
python_library(
name = "node_visitor",
srcs = ["node_visitor.py"],
typing = True,
deps = [
"//executorch/backends/arm:tosa_mapping",
"//executorch/backends/arm:tosa_specification",
Expand All @@ -14,7 +13,6 @@ python_library(
python_library(
name = "ops",
srcs = glob(["op_*.py", "ops_*.py"]),
typing = True,
deps = [
"fbsource//third-party/serialization_lib/python/tosa:tosa",
":node_visitor",
Expand All @@ -29,7 +27,6 @@ python_library(
python_library(
name = "lib",
srcs = ["__init__.py"],
typing = True,
deps = [
":node_visitor",
":ops",
Expand Down
14 changes: 10 additions & 4 deletions backends/arm/test/ops/test_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def forward(self, x):
def _test_linear_tosa_MI_pipeline(
self, module: torch.nn.Module, test_data: Tuple[torch.Tensor]
):
(
tester = (
ArmTester(
module,
example_inputs=test_data,
Expand All @@ -141,13 +141,14 @@ def _test_linear_tosa_MI_pipeline(
.to_edge_transform_and_lower()
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
.to_executorch()
.run_method_and_compare_outputs(inputs=test_data)
)
if conftest.is_option_enabled("tosa_ref_model"):
tester.run_method_and_compare_outputs(inputs=test_data)

def _test_linear_tosa_BI_pipeline(
self, module: torch.nn.Module, test_data: Tuple[torch.Tensor]
):
(
tester = (
ArmTester(
module,
example_inputs=test_data,
Expand All @@ -162,8 +163,9 @@ def _test_linear_tosa_BI_pipeline(
.to_edge_transform_and_lower()
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
.to_executorch()
.run_method_and_compare_outputs(inputs=test_data, qtol=1)
)
if conftest.is_option_enabled("tosa_ref_model"):
tester.run_method_and_compare_outputs(inputs=test_data, qtol=1)

def _test_linear_tosa_ethosu_BI_pipeline(
self,
Expand All @@ -186,9 +188,11 @@ def _test_linear_tosa_ethosu_BI_pipeline(
.to_executorch()
.serialize()
)
# TODO: Add FVP testing support.
return tester

@parameterized.expand(test_data_suite_rank1 + test_data_suite_rank4)
@pytest.mark.tosa_ref_model
def test_linear_tosa_MI(
self,
test_name: str,
Expand All @@ -208,6 +212,7 @@ def test_linear_tosa_MI(
)

@parameterized.expand(test_data_suite_rank1 + test_data_suite_rank4)
@pytest.mark.tosa_ref_model
def test_linear_tosa_BI(
self,
test_name: str,
Expand Down Expand Up @@ -249,6 +254,7 @@ def test_linear_tosa_u55_BI(
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data)

@parameterized.expand(test_data_suite_rank1 + test_data_suite_rank4)
@pytest.mark.corstone_fvp
def test_linear_tosa_u85_BI(
self,
test_name: str,
Expand Down
Loading