From de8ce2532cdff925245942e62607d2fb7e44fba3 Mon Sep 17 00:00:00 2001 From: Sebastian Larsson Date: Tue, 10 Jun 2025 13:47:10 +0200 Subject: [PATCH] Arm backend: Create ethosu directory Move EthosU related files to its own directory. Change-Id: I9302c9dfbf6a486c3d744427356cb452ec6ceaf3 Signed-off-by: Sebastian Larsson --- backends/arm/ethosu/__init__.py | 14 ++++++++++++++ .../arm/{ethosu_backend.py => ethosu/backend.py} | 0 .../partitioner.py} | 2 +- backends/arm/test/tester/arm_tester.py | 2 +- docs/source/backends-arm-ethos-u.md | 2 +- examples/arm/aot_arm_compiler.py | 2 +- examples/arm/ethos_u_minimal_example.ipynb | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 backends/arm/ethosu/__init__.py rename backends/arm/{ethosu_backend.py => ethosu/backend.py} (100%) rename backends/arm/{ethosu_partitioner.py => ethosu/partitioner.py} (94%) diff --git a/backends/arm/ethosu/__init__.py b/backends/arm/ethosu/__init__.py new file mode 100644 index 00000000000..f6cc1329dfe --- /dev/null +++ b/backends/arm/ethosu/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2025 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. +# +# pyre-unsafe + +from .backend import EthosUBackend # noqa: F401 +from .partitioner import EthosUPartitioner # noqa: F401 + +__all__ = [ + "EthosUBackend", + "EthosUPartitioner", +] diff --git a/backends/arm/ethosu_backend.py b/backends/arm/ethosu/backend.py similarity index 100% rename from backends/arm/ethosu_backend.py rename to backends/arm/ethosu/backend.py diff --git a/backends/arm/ethosu_partitioner.py b/backends/arm/ethosu/partitioner.py similarity index 94% rename from backends/arm/ethosu_partitioner.py rename to backends/arm/ethosu/partitioner.py index 27102592e15..efbd6705615 100644 --- a/backends/arm/ethosu_partitioner.py +++ b/backends/arm/ethosu/partitioner.py @@ -10,7 +10,7 @@ from executorch.backends.arm.arm_backend import ( is_ethosu, ) # usort: skip -from executorch.backends.arm.ethosu_backend import EthosUBackend +from executorch.backends.arm.ethosu import EthosUBackend from executorch.backends.arm.tosa_partitioner import TOSAPartitioner from executorch.exir.backend.compile_spec_schema import CompileSpec from executorch.exir.backend.partitioner import DelegationSpec diff --git a/backends/arm/test/tester/arm_tester.py b/backends/arm/test/tester/arm_tester.py index 56a89d9b589..6986f9c0fa8 100644 --- a/backends/arm/test/tester/arm_tester.py +++ b/backends/arm/test/tester/arm_tester.py @@ -37,7 +37,7 @@ is_ethosu, is_tosa, ) -from executorch.backends.arm.ethosu_partitioner import EthosUPartitioner +from executorch.backends.arm.ethosu import EthosUPartitioner from executorch.backends.arm.quantizer import ( EthosUQuantizer, get_symmetric_quantization_config, diff --git a/docs/source/backends-arm-ethos-u.md b/docs/source/backends-arm-ethos-u.md index d4531668c36..5960e4f5c59 100644 --- a/docs/source/backends-arm-ethos-u.md +++ b/docs/source/backends-arm-ethos-u.md @@ -23,7 +23,7 @@ The example below demonstrates the lowering processs of a MobileNet V2 model fro ```python import torch from executorch.backends.arm.arm_backend import ArmCompileSpecBuilder -from executorch.backends.arm.ethosu_partitioner import EthosUPartitioner +from executorch.backends.arm.ethosu import EthosUPartitioner from executorch.backends.arm.quantizer.arm_quantizer import ( EthosUQuantizer, get_symmetric_quantization_config, diff --git a/examples/arm/aot_arm_compiler.py b/examples/arm/aot_arm_compiler.py index 148f9c1d477..d687fdb2f1a 100644 --- a/examples/arm/aot_arm_compiler.py +++ b/examples/arm/aot_arm_compiler.py @@ -24,7 +24,7 @@ is_tosa, is_vgf, ) -from executorch.backends.arm.ethosu_partitioner import EthosUPartitioner +from executorch.backends.arm.ethosu import EthosUPartitioner from executorch.backends.arm.quantizer import ( EthosUQuantizer, get_symmetric_quantization_config, diff --git a/examples/arm/ethos_u_minimal_example.ipynb b/examples/arm/ethos_u_minimal_example.ipynb index 1e8116b3f36..91c1dce5033 100644 --- a/examples/arm/ethos_u_minimal_example.ipynb +++ b/examples/arm/ethos_u_minimal_example.ipynb @@ -138,7 +138,7 @@ "outputs": [], "source": [ "import os\n", - "from executorch.backends.arm.ethosu_partitioner import EthosUPartitioner\n", + "from executorch.backends.arm.ethosu import EthosUPartitioner\n", "from executorch.exir import (\n", " EdgeCompileConfig,\n", " ExecutorchBackendConfig,\n",