diff --git a/backends/xnnpack/BUCK b/backends/xnnpack/BUCK index 1e8cc179228..1e12548bc4c 100644 --- a/backends/xnnpack/BUCK +++ b/backends/xnnpack/BUCK @@ -1,8 +1,47 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain xplat-only targets. load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/backends/xnnpack/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) + +fbcode_target(_kind = runtime.python_library, + name = "xnnpack_preprocess", + srcs = [ + "xnnpack_preprocess.py", + ], + visibility = ["PUBLIC"], + deps = [ + "//executorch/backends/transforms:lib", + "//executorch/backends/transforms:remove_getitem_op", + "//executorch/backends/xnnpack/_passes:xnnpack_passes", + "//executorch/backends/xnnpack/operators:operators", + "//executorch/backends/xnnpack/serialization:xnnpack_serializer", + "//executorch/exir:graph_module", + "//executorch/exir/backend:backend_details", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "xnnpack_delegate", + srcs = [ + "__init__.py", + ], + visibility = ["PUBLIC"], + deps = [ + ":xnnpack_preprocess", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + ], +) diff --git a/backends/xnnpack/TARGETS b/backends/xnnpack/TARGETS deleted file mode 100644 index 4a9fc70cc97..00000000000 --- a/backends/xnnpack/TARGETS +++ /dev/null @@ -1,36 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -runtime.python_library( - name = "xnnpack_preprocess", - srcs = [ - "xnnpack_preprocess.py", - ], - visibility = ["PUBLIC"], - deps = [ - "//executorch/backends/transforms:lib", - "//executorch/backends/transforms:remove_getitem_op", - "//executorch/backends/xnnpack/_passes:xnnpack_passes", - "//executorch/backends/xnnpack/operators:operators", - "//executorch/backends/xnnpack/serialization:xnnpack_serializer", - "//executorch/exir:graph_module", - "//executorch/exir/backend:backend_details", - ], -) - -runtime.python_library( - name = "xnnpack_delegate", - srcs = [ - "__init__.py", - ], - visibility = ["PUBLIC"], - deps = [ - ":xnnpack_preprocess", - "//executorch/backends/xnnpack/partition:xnnpack_partitioner", - "//executorch/backends/xnnpack/utils:xnnpack_utils", - ], -) diff --git a/backends/xnnpack/_passes/TARGETS b/backends/xnnpack/_passes/BUCK similarity index 86% rename from backends/xnnpack/_passes/TARGETS rename to backends/xnnpack/_passes/BUCK index 4977ad08936..2edf294fa4e 100644 --- a/backends/xnnpack/_passes/TARGETS +++ b/backends/xnnpack/_passes/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "xnnpack_passes", srcs = native.glob(["*.py"]), deps = [ diff --git a/backends/xnnpack/operators/TARGETS b/backends/xnnpack/operators/BUCK similarity index 71% rename from backends/xnnpack/operators/TARGETS rename to backends/xnnpack/operators/BUCK index f6d48a8a45f..fdc2ed1db49 100644 --- a/backends/xnnpack/operators/TARGETS +++ b/backends/xnnpack/operators/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "operators", srcs = glob(["*.py"]), visibility = ["PUBLIC"], diff --git a/backends/xnnpack/partition/TARGETS b/backends/xnnpack/partition/BUCK similarity index 81% rename from backends/xnnpack/partition/TARGETS rename to backends/xnnpack/partition/BUCK index bb052902fed..2581043d5b2 100644 --- a/backends/xnnpack/partition/TARGETS +++ b/backends/xnnpack/partition/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "xnnpack_partitioner", srcs = [ "xnnpack_partitioner.py", @@ -20,7 +21,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "partitioner_graphs", srcs = glob([ "graphs/*.py",