Skip to content

Commit

Permalink
Update on "[ExecuTorch] Arm Ethos: Add pass tests"
Browse files Browse the repository at this point in the history
As title.

Adds pytest.test_option["tosa_ref_model"] similar to "corestone_fvp". This is a hack. Once we buckify the reference model, we should remove this. It shouldn't have impact on the OSS test coverage.

Differential Revision: [D69714010](https://our.internmc.facebook.com/intern/diff/D69714010/)

[ghstack-poisoned]
  • Loading branch information
digantdesai committed Feb 25, 2025
2 parents affaee6 + d9e8e21 commit 700e72e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
15 changes: 9 additions & 6 deletions backends/arm/test/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ load(":targets.bzl", "define_arm_tests")
oncall("executorch")

python_library(
name = "common",
srcs = ["common.py"],
name = "conftest",
srcs = ["conftest.py"],
deps = [
"//executorch/backends/xnnpack/test/tester:tester",
"//executorch/backends/arm:arm_backend",
"//executorch/exir:lib",
"//executorch/exir/backend:compile_spec_schema",
"fbsource//third-party/pypi/pytest:pytest",
Expand All @@ -20,6 +18,7 @@ python_library(
name = "runner_utils",
srcs = ["runner_utils.py"],
deps = [
":conftest",
"//executorch/backends/xnnpack/test/tester:tester",
"//executorch/backends/arm:arm_backend",
"//executorch/exir:lib",
Expand All @@ -28,10 +27,14 @@ python_library(
)

python_library(
name = "conftest",
srcs = ["conftest.py"],
name = "common",
srcs = ["common.py"],
deps = [
":runner_utils",
"//executorch/backends/xnnpack/test/tester:tester",
"//executorch/backends/arm:arm_backend",
"//executorch/exir:lib",
"//executorch/exir/backend:compile_spec_schema",
"fbsource//third-party/pypi/pytest:pytest",
]
)
Expand Down
38 changes: 20 additions & 18 deletions backends/arm/test/targets.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("//caffe2/test/fb:defs.bzl", "define_tests")
# load("//caffe2/test/fb:defs.bzl", "define_tests")
load("@fbcode_macros//build_defs:python_pytest.bzl", "python_pytest")
load("@bazel_skylib//lib:paths.bzl", "paths")

def define_arm_tests():
Expand All @@ -13,21 +14,22 @@ def define_arm_tests():
for test_file in test_files:
test_file_name = paths.basename(test_file)
test_name = test_file_name.replace("test_", "").replace(".py", "")
TESTS[test_name] = [test_file]

define_tests(
pytest = True,
tests = TESTS,
pytest_config = "pytest.ini",
resources = ["conftest.py"],
preload_deps = [
"//executorch/kernels/quantized:custom_ops_generated_lib",
],
deps = [
":arm_tester",
":conftest",
"//executorch/exir:lib",
"fbsource//third-party/pypi/pytest:pytest",
"fbsource//third-party/pypi/parameterized:parameterized",
],
)
python_pytest(
name = test_name,
srcs = [test_file],
pytest_config = "pytest.ini",
resources = ["conftest.py"],
compile = "with-source",
typing = False,
preload_deps = [
"//executorch/kernels/quantized:custom_ops_generated_lib",
],
deps = [
":arm_tester",
":conftest",
"//executorch/exir:lib",
"fbsource//third-party/pypi/pytest:pytest",
"fbsource//third-party/pypi/parameterized:parameterized",
],
)

0 comments on commit 700e72e

Please sign in to comment.