diff --git a/backends/arm/TARGETS b/backends/arm/TARGETS index 45c49724c80..2d201f8a0e3 100644 --- a/backends/arm/TARGETS +++ b/backends/arm/TARGETS @@ -1,3 +1,8 @@ +# 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. + # @noautodeps load("@fbcode_macros//build_defs:python_library.bzl", "python_library") @@ -12,6 +17,17 @@ python_library( ":arm_partitioner", ] ) +python_library( + name = "vgf_partitioner", + srcs = [ + "vgf/__init__.py", + "vgf/backend.py", + "vgf/partitioner.py" + ], + deps = [ + ":arm_partitioner", + ] +) python_library( name = "constants", srcs = [ @@ -39,8 +55,6 @@ python_library( srcs = [ "tosa/backend.py", "tosa/partitioner.py", - "vgf_backend.py", - "vgf_partitioner.py", ], deps = [ ":arm_backend", diff --git a/backends/arm/test/misc/test_extract_io_params_tosa.py b/backends/arm/test/misc/test_extract_io_params_tosa.py index 2399a41e201..da471b0bb74 100644 --- a/backends/arm/test/misc/test_extract_io_params_tosa.py +++ b/backends/arm/test/misc/test_extract_io_params_tosa.py @@ -17,7 +17,7 @@ from executorch.backends.arm.test.common import SkipIfNoModelConverter from executorch.backends.arm.tosa import TosaSpecification from executorch.backends.arm.tosa.partitioner import TOSAPartitioner -from executorch.backends.arm.vgf_partitioner import VgfPartitioner +from executorch.backends.arm.vgf import VgfPartitioner from executorch.exir import to_edge_transform_and_lower from executorch.exir.passes.quantize_io_pass import extract_io_quant_params from torchao.quantization.pt2e.quantize_pt2e import convert_pt2e, prepare_pt2e diff --git a/backends/arm/test/tester/arm_tester.py b/backends/arm/test/tester/arm_tester.py index 1a3fe082d7f..fe17bd3f448 100644 --- a/backends/arm/test/tester/arm_tester.py +++ b/backends/arm/test/tester/arm_tester.py @@ -63,7 +63,7 @@ from executorch.backends.arm.tosa.partitioner import TOSAPartitioner from executorch.backends.arm.tosa.specification import get_tosa_spec -from executorch.backends.arm.vgf_partitioner import VgfPartitioner +from executorch.backends.arm.vgf import VgfPartitioner from executorch.backends.test.harness.stages import Stage, StageType from executorch.backends.xnnpack.test.tester import Tester diff --git a/backends/arm/vgf/__init__.py b/backends/arm/vgf/__init__.py new file mode 100644 index 00000000000..4ab8144cbd6 --- /dev/null +++ b/backends/arm/vgf/__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 VgfBackend # noqa: F401 +from .partitioner import VgfPartitioner # noqa: F401 + +__all__ = [ + "VgfBackend", + "VgfPartitioner", +] diff --git a/backends/arm/vgf_backend.py b/backends/arm/vgf/backend.py similarity index 100% rename from backends/arm/vgf_backend.py rename to backends/arm/vgf/backend.py diff --git a/backends/arm/vgf_partitioner.py b/backends/arm/vgf/partitioner.py similarity index 94% rename from backends/arm/vgf_partitioner.py rename to backends/arm/vgf/partitioner.py index 48f8b560d8f..f6dab597487 100644 --- a/backends/arm/vgf_partitioner.py +++ b/backends/arm/vgf/partitioner.py @@ -11,7 +11,7 @@ is_vgf, ) # usort: skip from executorch.backends.arm.tosa.partitioner import TOSAPartitioner -from executorch.backends.arm.vgf_backend import VgfBackend +from executorch.backends.arm.vgf import VgfBackend from executorch.exir.backend.compile_spec_schema import CompileSpec from executorch.exir.backend.partitioner import DelegationSpec from torch.fx.passes.operator_support import OperatorSupportBase diff --git a/examples/arm/aot_arm_compiler.py b/examples/arm/aot_arm_compiler.py index 9c65109ab13..d7e1b64e3ca 100644 --- a/examples/arm/aot_arm_compiler.py +++ b/examples/arm/aot_arm_compiler.py @@ -40,7 +40,7 @@ MobileNetV2Evaluator, ) -from executorch.backends.arm.vgf_partitioner import VgfPartitioner +from executorch.backends.arm.vgf import VgfPartitioner # To use Cortex-M backend from executorch.backends.cortex_m.passes.quantized_op_fusion_pass import ( diff --git a/examples/arm/vgf_minimal_example.ipynb b/examples/arm/vgf_minimal_example.ipynb index 0c0a4469d75..35378817a7d 100644 --- a/examples/arm/vgf_minimal_example.ipynb +++ b/examples/arm/vgf_minimal_example.ipynb @@ -181,7 +181,7 @@ "outputs": [], "source": [ "import os\n", - "from executorch.backends.arm.vgf_partitioner import VgfPartitioner\n", + "from executorch.backends.arm.vgf import VgfPartitioner\n", "from executorch.exir import (\n", " EdgeCompileConfig,\n", " ExecutorchBackendConfig,\n",