From ce3df09d9835f9f746c4c39528fdd367829d953b Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Thu, 18 Jun 2026 15:49:40 -0700 Subject: [PATCH 1/4] drop redundant TARGETS files that duplicate sister BUCK files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Initial chunk of fbcode/executorch TARGETS->BUCK migration. Removes 40 TARGETS files where: - 7 are byte-identical to their sister BUCK file, OR - 33 contain only a no-arg `define_common_targets()` call matching a sister BUCK that also calls `define_common_targets()` with no args In both cases fbcode falls through to the BUCK file (via `name_v2 = TARGETS,BUCK`) and evaluates the exact same content it did before. Any TARGETS that passes any argument to define_common_targets (positional or keyword) is intentionally excluded — those are the `is_fbcode = True` cases that need a separate, more careful treatment. Differential Revision: D109082060 --- backends/qualcomm/aot/wrappers/TARGETS | 5 ----- backends/qualcomm/builders/TARGETS | 5 ----- codegen/test/TARGETS | 8 -------- configurations/TARGETS | 8 -------- examples/devtools/example_runner/TARGETS | 8 -------- examples/qualcomm/executor_runner/TARGETS | 8 -------- extension/aten_util/TARGETS | 8 -------- extension/aten_util/test/TARGETS | 8 -------- extension/cuda/TARGETS | 8 -------- extension/image/TARGETS | 5 ----- extension/image/benchmark/TARGETS | 5 ----- extension/image/test/TARGETS | 5 ----- extension/pytree/aten_util/TARGETS | 7 ------- extension/pytree/aten_util/test/TARGETS | 8 -------- extension/runner_util/TARGETS | 8 -------- extension/tensor/TARGETS | 8 -------- extension/tensor/test/TARGETS | 8 -------- extension/testing_util/TARGETS | 8 -------- extension/testing_util/test/TARGETS | 8 -------- extension/threadpool/TARGETS | 8 -------- extension/threadpool/test/TARGETS | 8 -------- kernels/optimized/cpu/TARGETS | 8 -------- kernels/optimized/test/TARGETS | 8 -------- kernels/portable/cpu/util/TARGETS | 8 -------- kernels/portable/cpu/util/test/TARGETS | 8 -------- kernels/prim_ops/TARGETS | 7 ------- runtime/backend/TARGETS | 8 -------- runtime/backend/test/TARGETS | 8 -------- runtime/core/TARGETS | 8 -------- runtime/core/exec_aten/TARGETS | 8 -------- runtime/core/exec_aten/testing_util/TARGETS | 8 -------- runtime/core/exec_aten/testing_util/test/TARGETS | 8 -------- runtime/core/exec_aten/util/TARGETS | 8 -------- runtime/platform/TARGETS | 8 -------- runtime/platform/test/TARGETS | 8 -------- schema/TARGETS | 8 -------- schema/test/TARGETS | 8 -------- test/TARGETS | 8 -------- 38 files changed, 287 deletions(-) delete mode 100644 backends/qualcomm/aot/wrappers/TARGETS delete mode 100644 backends/qualcomm/builders/TARGETS delete mode 100644 codegen/test/TARGETS delete mode 100644 configurations/TARGETS delete mode 100644 examples/devtools/example_runner/TARGETS delete mode 100644 examples/qualcomm/executor_runner/TARGETS delete mode 100644 extension/aten_util/TARGETS delete mode 100644 extension/aten_util/test/TARGETS delete mode 100644 extension/cuda/TARGETS delete mode 100644 extension/image/TARGETS delete mode 100644 extension/image/benchmark/TARGETS delete mode 100644 extension/image/test/TARGETS delete mode 100644 extension/pytree/aten_util/TARGETS delete mode 100644 extension/pytree/aten_util/test/TARGETS delete mode 100644 extension/runner_util/TARGETS delete mode 100644 extension/tensor/TARGETS delete mode 100644 extension/tensor/test/TARGETS delete mode 100644 extension/testing_util/TARGETS delete mode 100644 extension/testing_util/test/TARGETS delete mode 100644 extension/threadpool/TARGETS delete mode 100644 extension/threadpool/test/TARGETS delete mode 100644 kernels/optimized/cpu/TARGETS delete mode 100644 kernels/optimized/test/TARGETS delete mode 100644 kernels/portable/cpu/util/TARGETS delete mode 100644 kernels/portable/cpu/util/test/TARGETS delete mode 100644 kernels/prim_ops/TARGETS delete mode 100644 runtime/backend/TARGETS delete mode 100644 runtime/backend/test/TARGETS delete mode 100644 runtime/core/TARGETS delete mode 100644 runtime/core/exec_aten/TARGETS delete mode 100644 runtime/core/exec_aten/testing_util/TARGETS delete mode 100644 runtime/core/exec_aten/testing_util/test/TARGETS delete mode 100644 runtime/core/exec_aten/util/TARGETS delete mode 100644 runtime/platform/TARGETS delete mode 100644 runtime/platform/test/TARGETS delete mode 100644 schema/TARGETS delete mode 100644 schema/test/TARGETS delete mode 100644 test/TARGETS diff --git a/backends/qualcomm/aot/wrappers/TARGETS b/backends/qualcomm/aot/wrappers/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/backends/qualcomm/aot/wrappers/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/backends/qualcomm/builders/TARGETS b/backends/qualcomm/builders/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/backends/qualcomm/builders/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/codegen/test/TARGETS b/codegen/test/TARGETS deleted file mode 100644 index 1e8cc179228..00000000000 --- a/codegen/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# 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() diff --git a/configurations/TARGETS b/configurations/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/configurations/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/examples/devtools/example_runner/TARGETS b/examples/devtools/example_runner/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/examples/devtools/example_runner/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/examples/qualcomm/executor_runner/TARGETS b/examples/qualcomm/executor_runner/TARGETS deleted file mode 100644 index 1e8cc179228..00000000000 --- a/examples/qualcomm/executor_runner/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# 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() diff --git a/extension/aten_util/TARGETS b/extension/aten_util/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/aten_util/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/aten_util/test/TARGETS b/extension/aten_util/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/aten_util/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/cuda/TARGETS b/extension/cuda/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/cuda/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/image/TARGETS b/extension/image/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/extension/image/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/image/benchmark/TARGETS b/extension/image/benchmark/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/extension/image/benchmark/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/image/test/TARGETS b/extension/image/test/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/extension/image/test/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/pytree/aten_util/TARGETS b/extension/pytree/aten_util/TARGETS deleted file mode 100644 index 77b38349334..00000000000 --- a/extension/pytree/aten_util/TARGETS +++ /dev/null @@ -1,7 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/pytree/aten_util/test/TARGETS b/extension/pytree/aten_util/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/pytree/aten_util/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/runner_util/TARGETS b/extension/runner_util/TARGETS deleted file mode 100644 index 1e8cc179228..00000000000 --- a/extension/runner_util/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# 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() diff --git a/extension/tensor/TARGETS b/extension/tensor/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/tensor/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/tensor/test/TARGETS b/extension/tensor/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/tensor/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/testing_util/TARGETS b/extension/testing_util/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/testing_util/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/testing_util/test/TARGETS b/extension/testing_util/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/testing_util/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/threadpool/TARGETS b/extension/threadpool/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/threadpool/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/threadpool/test/TARGETS b/extension/threadpool/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/threadpool/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/kernels/optimized/cpu/TARGETS b/kernels/optimized/cpu/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/kernels/optimized/cpu/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/kernels/optimized/test/TARGETS b/kernels/optimized/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/kernels/optimized/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/kernels/portable/cpu/util/TARGETS b/kernels/portable/cpu/util/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/kernels/portable/cpu/util/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/kernels/portable/cpu/util/test/TARGETS b/kernels/portable/cpu/util/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/kernels/portable/cpu/util/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/kernels/prim_ops/TARGETS b/kernels/prim_ops/TARGETS deleted file mode 100644 index 77b38349334..00000000000 --- a/kernels/prim_ops/TARGETS +++ /dev/null @@ -1,7 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/backend/TARGETS b/runtime/backend/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/backend/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/backend/test/TARGETS b/runtime/backend/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/backend/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/core/TARGETS b/runtime/core/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/core/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/core/exec_aten/TARGETS b/runtime/core/exec_aten/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/core/exec_aten/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/core/exec_aten/testing_util/TARGETS b/runtime/core/exec_aten/testing_util/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/core/exec_aten/testing_util/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/core/exec_aten/testing_util/test/TARGETS b/runtime/core/exec_aten/testing_util/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/core/exec_aten/testing_util/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/core/exec_aten/util/TARGETS b/runtime/core/exec_aten/util/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/core/exec_aten/util/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/platform/TARGETS b/runtime/platform/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/platform/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/runtime/platform/test/TARGETS b/runtime/platform/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/runtime/platform/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/schema/TARGETS b/schema/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/schema/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/schema/test/TARGETS b/schema/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/schema/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/test/TARGETS b/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() From d42b8c87d0fe8468662e513f9fe62ec70e3ea416 Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Thu, 18 Jun 2026 15:49:40 -0700 Subject: [PATCH 2/4] migrate is_fbcode-flagged TARGETS files to BUCK with runtime detection Summary: Chunk 2 of fbcode/executorch TARGETS->BUCK migration. 5 directories where TARGETS called `define_common_targets(is_fbcode = True)` and the sister BUCK called `define_common_targets()`. The shared targets.bzl actually branches on is_fbcode, so the flag must be preserved. Replaces the BUCK call with `define_common_targets(is_fbcode = is_fbcode())` using `fbsource_utils.is_fbcode()` for runtime cell detection, then deletes TARGETS. fbcode falls through to BUCK and gets the True branch as before; xplat keeps getting the False branch. Directories migrated: - backends/vulkan/test/custom_ops - backends/vulkan/test/op_tests - codegen/tools - extension/runner_util/test - kernels/optimized Differential Revision: D109082061 --- backends/vulkan/test/custom_ops/BUCK | 5 +++-- backends/vulkan/test/custom_ops/TARGETS | 5 ----- backends/vulkan/test/op_tests/BUCK | 5 +++-- backends/vulkan/test/op_tests/TARGETS | 5 ----- codegen/tools/BUCK | 5 +++-- codegen/tools/TARGETS | 5 ----- extension/runner_util/test/BUCK | 5 +++-- extension/runner_util/test/TARGETS | 8 -------- kernels/optimized/BUCK | 5 +++-- kernels/optimized/TARGETS | 8 -------- 10 files changed, 15 insertions(+), 41 deletions(-) delete mode 100644 backends/vulkan/test/custom_ops/TARGETS delete mode 100644 backends/vulkan/test/op_tests/TARGETS delete mode 100644 codegen/tools/TARGETS delete mode 100644 extension/runner_util/test/TARGETS delete mode 100644 kernels/optimized/TARGETS diff --git a/backends/vulkan/test/custom_ops/BUCK b/backends/vulkan/test/custom_ops/BUCK index 1e8cc179228..f559a6f1cfe 100644 --- a/backends/vulkan/test/custom_ops/BUCK +++ b/backends/vulkan/test/custom_ops/BUCK @@ -1,8 +1,9 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets() +define_common_targets(is_fbcode = is_fbcode()) diff --git a/backends/vulkan/test/custom_ops/TARGETS b/backends/vulkan/test/custom_ops/TARGETS deleted file mode 100644 index e84397dc20e..00000000000 --- a/backends/vulkan/test/custom_ops/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets(is_fbcode = True) diff --git a/backends/vulkan/test/op_tests/BUCK b/backends/vulkan/test/op_tests/BUCK index 1e8cc179228..f559a6f1cfe 100644 --- a/backends/vulkan/test/op_tests/BUCK +++ b/backends/vulkan/test/op_tests/BUCK @@ -1,8 +1,9 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets() +define_common_targets(is_fbcode = is_fbcode()) diff --git a/backends/vulkan/test/op_tests/TARGETS b/backends/vulkan/test/op_tests/TARGETS deleted file mode 100644 index e84397dc20e..00000000000 --- a/backends/vulkan/test/op_tests/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets(is_fbcode = True) diff --git a/codegen/tools/BUCK b/codegen/tools/BUCK index 1e8cc179228..f559a6f1cfe 100644 --- a/codegen/tools/BUCK +++ b/codegen/tools/BUCK @@ -1,8 +1,9 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets() +define_common_targets(is_fbcode = is_fbcode()) diff --git a/codegen/tools/TARGETS b/codegen/tools/TARGETS deleted file mode 100644 index e84397dc20e..00000000000 --- a/codegen/tools/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets(is_fbcode = True) diff --git a/extension/runner_util/test/BUCK b/extension/runner_util/test/BUCK index 1e8cc179228..f559a6f1cfe 100644 --- a/extension/runner_util/test/BUCK +++ b/extension/runner_util/test/BUCK @@ -1,8 +1,9 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets() +define_common_targets(is_fbcode = is_fbcode()) diff --git a/extension/runner_util/test/TARGETS b/extension/runner_util/test/TARGETS deleted file mode 100644 index 7ace4add7f9..00000000000 --- a/extension/runner_util/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# 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(is_fbcode = True) diff --git a/kernels/optimized/BUCK b/kernels/optimized/BUCK index 1e8cc179228..f559a6f1cfe 100644 --- a/kernels/optimized/BUCK +++ b/kernels/optimized/BUCK @@ -1,8 +1,9 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets() +define_common_targets(is_fbcode = is_fbcode()) diff --git a/kernels/optimized/TARGETS b/kernels/optimized/TARGETS deleted file mode 100644 index beaebb81eeb..00000000000 --- a/kernels/optimized/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets(True) From 6af83bef1ff81441f7598cc1f2cccc857d15a9ce Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Thu, 18 Jun 2026 15:49:40 -0700 Subject: [PATCH 3/4] rename pure-boilerplate fbcode-only TARGETS to BUCK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Chunk 3 of fbcode/executorch TARGETS->BUCK migration. 8 directories where only a TARGETS file existed (no sister BUCK). Each TARGETS is a no-arg `define_common_targets()` call, and each shared `targets.bzl` was verified to be xplat-compatible (no fbcode_macros loads, no fbcode-only kwargs like keep_gpu_sections or re_test_utils). Renaming TARGETS -> BUCK exposes these directories to xplat via dirsync. Because the targets.bzl is xplat-compatible, the rules will materialize in xplat for the first time — that is a deliberate side effect of the migration to a single canonical build file per directory. Directories migrated: - backends/aoti - backends/aoti/slim/c10/core - backends/aoti/slim/util - backends/aoti/slim/util/test - backends/qualcomm/partition - devtools/etdump/data_sinks/tests - examples/models/llama/experimental - extension/kernel_util/test extension/training/examples/CIFAR was excluded after a trial run — its targets.bzl uses a runtime.python_binary srcs attribute that the xplat python_binary macro rejects ("default_only is not allowed to be specified, but got [data_utils.py]"). It needs a manual fix to the targets.bzl before it can be migrated. Differential Revision: D109082059 --- backends/aoti/{TARGETS => BUCK} | 0 backends/aoti/slim/c10/core/{TARGETS => BUCK} | 0 backends/aoti/slim/util/{TARGETS => BUCK} | 0 backends/aoti/slim/util/test/{TARGETS => BUCK} | 0 backends/qualcomm/partition/{TARGETS => BUCK} | 0 devtools/etdump/data_sinks/tests/{TARGETS => BUCK} | 0 examples/models/llama/experimental/{TARGETS => BUCK} | 0 extension/kernel_util/test/{TARGETS => BUCK} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename backends/aoti/{TARGETS => BUCK} (100%) rename backends/aoti/slim/c10/core/{TARGETS => BUCK} (100%) rename backends/aoti/slim/util/{TARGETS => BUCK} (100%) rename backends/aoti/slim/util/test/{TARGETS => BUCK} (100%) rename backends/qualcomm/partition/{TARGETS => BUCK} (100%) rename devtools/etdump/data_sinks/tests/{TARGETS => BUCK} (100%) rename examples/models/llama/experimental/{TARGETS => BUCK} (100%) rename extension/kernel_util/test/{TARGETS => BUCK} (100%) diff --git a/backends/aoti/TARGETS b/backends/aoti/BUCK similarity index 100% rename from backends/aoti/TARGETS rename to backends/aoti/BUCK diff --git a/backends/aoti/slim/c10/core/TARGETS b/backends/aoti/slim/c10/core/BUCK similarity index 100% rename from backends/aoti/slim/c10/core/TARGETS rename to backends/aoti/slim/c10/core/BUCK diff --git a/backends/aoti/slim/util/TARGETS b/backends/aoti/slim/util/BUCK similarity index 100% rename from backends/aoti/slim/util/TARGETS rename to backends/aoti/slim/util/BUCK diff --git a/backends/aoti/slim/util/test/TARGETS b/backends/aoti/slim/util/test/BUCK similarity index 100% rename from backends/aoti/slim/util/test/TARGETS rename to backends/aoti/slim/util/test/BUCK diff --git a/backends/qualcomm/partition/TARGETS b/backends/qualcomm/partition/BUCK similarity index 100% rename from backends/qualcomm/partition/TARGETS rename to backends/qualcomm/partition/BUCK diff --git a/devtools/etdump/data_sinks/tests/TARGETS b/devtools/etdump/data_sinks/tests/BUCK similarity index 100% rename from devtools/etdump/data_sinks/tests/TARGETS rename to devtools/etdump/data_sinks/tests/BUCK diff --git a/examples/models/llama/experimental/TARGETS b/examples/models/llama/experimental/BUCK similarity index 100% rename from examples/models/llama/experimental/TARGETS rename to examples/models/llama/experimental/BUCK diff --git a/extension/kernel_util/test/TARGETS b/extension/kernel_util/test/BUCK similarity index 100% rename from extension/kernel_util/test/TARGETS rename to extension/kernel_util/test/BUCK From 6655b42e28318234c9ead9922ec008419ed6c722 Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Thu, 18 Jun 2026 15:57:41 -0700 Subject: [PATCH 4/4] promote TARGETS content into placeholder BUCK files Summary: Chunk 4 of fbcode/executorch TARGETS->BUCK migration. 9 directories where TARGETS contained the real fbcode-side build rules and BUCK was a tiny placeholder (most were 4-8 lines like 'empty BUCK file to unblock landing'). Each TARGETS was scanned for fbcode-only constructs (`fbcode_macros`, `fbcode_target(`, `cpp_unittest(`, `cpp_library(`, `cpp_binary(`, `re_test_utils`, `keep_gpu_sections`, `buck_genrule`, `//tools/build/buck/`) and only those without any of those flags are migrated here. The TARGETS content is copied into BUCK (overwriting the placeholder) and the TARGETS file is deleted. fbcode now resolves these dirs via BUCK instead of TARGETS; the rules also become visible to xplat for the first time via dirsync. Directories migrated: - backends/apple/mps - backends/xnnpack/serialization - devtools/bundled_program - devtools/bundled_program/schema - devtools/etdump/fb - exir/emit - extension/pytree - extension/training - kernels/portable/test 8 PROMOTE candidates remain on TARGETS for follow-up: backends/cortex_m/test, examples/models/llama/fb, examples/qualcomm/oss_scripts/{llama,whisper}, exir/dialects/edge/test, exir/tests, kernels/fb/custom_ops, test/end2end. They have fbcode-only loads (`fbcode_macros`) or kwargs and need `is_fbcode()` gating. Differential Revision: D109082058 --- backends/apple/mps/BUCK | 91 +++++++++++++++++++++-- backends/apple/mps/TARGETS | 98 ------------------------- backends/xnnpack/serialization/BUCK | 26 +++++++ backends/xnnpack/serialization/TARGETS | 29 -------- devtools/bundled_program/BUCK | 39 ++++++++++ devtools/bundled_program/TARGETS | 44 ----------- devtools/bundled_program/schema/BUCK | 18 ++++- devtools/bundled_program/schema/TARGETS | 24 ------ exir/emit/BUCK | 38 +++++++++- exir/emit/TARGETS | 38 ---------- extension/pytree/BUCK | 43 ++++++++++- extension/pytree/TARGETS | 49 ------------- extension/training/BUCK | 14 +++- extension/training/TARGETS | 20 ----- kernels/portable/test/BUCK | 22 +++++- kernels/portable/test/TARGETS | 28 ------- 16 files changed, 280 insertions(+), 341 deletions(-) delete mode 100644 backends/apple/mps/TARGETS delete mode 100644 backends/xnnpack/serialization/TARGETS delete mode 100644 devtools/bundled_program/TARGETS delete mode 100644 devtools/bundled_program/schema/TARGETS delete mode 100644 exir/emit/TARGETS delete mode 100644 extension/pytree/TARGETS delete mode 100644 extension/training/TARGETS delete mode 100644 kernels/portable/test/TARGETS diff --git a/backends/apple/mps/BUCK b/backends/apple/mps/BUCK index 00fc5dd178c..d138b02e991 100644 --- a/backends/apple/mps/BUCK +++ b/backends/apple/mps/BUCK @@ -4,14 +4,95 @@ # # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. This file can contain fbcode-only targets. -load("@fbsource//tools/build_defs:default_platform_defs.bzl", "APPLE") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets( - is_xplat = True, - platforms = [APPLE], +define_common_targets() + +runtime.python_library( + name = "backend", + srcs = [ + "__init__.py", + "mps_preprocess.py", + ], + visibility = ["PUBLIC"], + deps = [ + ":operators", + ":serialization", + ":utils", + "//caffe2:torch", + "//executorch/exir/backend:backend_details", + "//executorch/exir/backend:compile_spec_schema", + ], +) + +runtime.python_library( + name = "operators", + srcs = glob([ + "operators/*.py", + ]), + deps = [ + ":serialization", + ":utils", + "//executorch/backends/transforms:lib", + ], +) + +runtime.python_library( + name = "partitioner", + srcs = glob([ + "partition/*.py", + ]), + visibility = ["PUBLIC"], + deps = [ + ":backend", + "//caffe2:torch", + "//executorch/exir/backend:compile_spec_schema", + "//executorch/exir/backend:partitioner", + "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", + ], +) + +runtime.python_library( + name = "serialization", + srcs = glob([ + "serialization/*.py", + ]), + resources = [ + "serialization/schema.fbs", + ], +) + +runtime.python_library( + name = "utils", + srcs = glob([ + "utils/*.py", + ]), + deps = [ + ":serialization", + "//caffe2:torch", + "//executorch/exir:lib", + ], +) + +runtime.python_test( + name = "test", + srcs = glob([ + "test/*.py", + ]), + deps = [ + ":backend", + ":partitioner", + "//caffe2:torch", + "//executorch/examples/models:models", + "//executorch/exir/tests:models", + "//executorch/extension/export_util:export_util", + "//executorch/devtools:lib", + "//executorch/devtools/bundled_program/serialize:lib", + "fbsource//third-party/pypi/pytest:pytest", + ], ) diff --git a/backends/apple/mps/TARGETS b/backends/apple/mps/TARGETS deleted file mode 100644 index d138b02e991..00000000000 --- a/backends/apple/mps/TARGETS +++ /dev/null @@ -1,98 +0,0 @@ -# -# Copyright (c) 2023 Apple Inc. All rights reserved. -# Provided subject to the LICENSE file in the top level directory. -# - -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -runtime.python_library( - name = "backend", - srcs = [ - "__init__.py", - "mps_preprocess.py", - ], - visibility = ["PUBLIC"], - deps = [ - ":operators", - ":serialization", - ":utils", - "//caffe2:torch", - "//executorch/exir/backend:backend_details", - "//executorch/exir/backend:compile_spec_schema", - ], -) - -runtime.python_library( - name = "operators", - srcs = glob([ - "operators/*.py", - ]), - deps = [ - ":serialization", - ":utils", - "//executorch/backends/transforms:lib", - ], -) - -runtime.python_library( - name = "partitioner", - srcs = glob([ - "partition/*.py", - ]), - visibility = ["PUBLIC"], - deps = [ - ":backend", - "//caffe2:torch", - "//executorch/exir/backend:compile_spec_schema", - "//executorch/exir/backend:partitioner", - "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", - ], -) - -runtime.python_library( - name = "serialization", - srcs = glob([ - "serialization/*.py", - ]), - resources = [ - "serialization/schema.fbs", - ], -) - -runtime.python_library( - name = "utils", - srcs = glob([ - "utils/*.py", - ]), - deps = [ - ":serialization", - "//caffe2:torch", - "//executorch/exir:lib", - ], -) - -runtime.python_test( - name = "test", - srcs = glob([ - "test/*.py", - ]), - deps = [ - ":backend", - ":partitioner", - "//caffe2:torch", - "//executorch/examples/models:models", - "//executorch/exir/tests:models", - "//executorch/extension/export_util:export_util", - "//executorch/devtools:lib", - "//executorch/devtools/bundled_program/serialize:lib", - "fbsource//third-party/pypi/pytest:pytest", - ], -) diff --git a/backends/xnnpack/serialization/BUCK b/backends/xnnpack/serialization/BUCK index c0b4f27eb52..a644520ac64 100644 --- a/backends/xnnpack/serialization/BUCK +++ b/backends/xnnpack/serialization/BUCK @@ -1,3 +1,29 @@ +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_schema", + srcs = [ + "xnnpack_graph_schema.py", + ], + visibility = ["PUBLIC"], +) + +runtime.python_library( + name = "xnnpack_serializer", + srcs = [ + "xnnpack_graph_serialize.py", + ], + resources = [ + "schema.fbs", + ], + visibility = ["PUBLIC"], + deps = [ + ":xnnpack_schema", + "//executorch/exir/_serialize:lib", + ], +) diff --git a/backends/xnnpack/serialization/TARGETS b/backends/xnnpack/serialization/TARGETS deleted file mode 100644 index a644520ac64..00000000000 --- a/backends/xnnpack/serialization/TARGETS +++ /dev/null @@ -1,29 +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_schema", - srcs = [ - "xnnpack_graph_schema.py", - ], - visibility = ["PUBLIC"], -) - -runtime.python_library( - name = "xnnpack_serializer", - srcs = [ - "xnnpack_graph_serialize.py", - ], - resources = [ - "schema.fbs", - ], - visibility = ["PUBLIC"], - deps = [ - ":xnnpack_schema", - "//executorch/exir/_serialize:lib", - ], -) diff --git a/devtools/bundled_program/BUCK b/devtools/bundled_program/BUCK index 0a42614a385..10d4d0b9154 100644 --- a/devtools/bundled_program/BUCK +++ b/devtools/bundled_program/BUCK @@ -1,5 +1,44 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") define_common_targets() + +runtime.python_library( + name = "core", + srcs = [ + "core.py", + ], + visibility = ["PUBLIC"], + deps = [ + ":config", + ":version", + "//caffe2:torch", + "//executorch/devtools/bundled_program/schema:bundled_program_schema_py", + "//executorch/exir:schema", + "//executorch/exir:tensor", + ], +) + +runtime.python_library( + name = "config", + srcs = [ + "config.py", + ], + visibility = ["PUBLIC"], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + "//caffe2:torch", + ], +) + +runtime.python_library( + name = "version", + srcs = [ + "version.py", + ], + visibility = [ + "//executorch/devtools/...", + ], +) diff --git a/devtools/bundled_program/TARGETS b/devtools/bundled_program/TARGETS deleted file mode 100644 index 10d4d0b9154..00000000000 --- a/devtools/bundled_program/TARGETS +++ /dev/null @@ -1,44 +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 = "core", - srcs = [ - "core.py", - ], - visibility = ["PUBLIC"], - deps = [ - ":config", - ":version", - "//caffe2:torch", - "//executorch/devtools/bundled_program/schema:bundled_program_schema_py", - "//executorch/exir:schema", - "//executorch/exir:tensor", - ], -) - -runtime.python_library( - name = "config", - srcs = [ - "config.py", - ], - visibility = ["PUBLIC"], - deps = [ - "fbsource//third-party/pypi/typing-extensions:typing-extensions", - "//caffe2:torch", - ], -) - -runtime.python_library( - name = "version", - srcs = [ - "version.py", - ], - visibility = [ - "//executorch/devtools/...", - ], -) diff --git a/devtools/bundled_program/schema/BUCK b/devtools/bundled_program/schema/BUCK index 1e8cc179228..51c004cbec0 100644 --- a/devtools/bundled_program/schema/BUCK +++ b/devtools/bundled_program/schema/BUCK @@ -1,8 +1,24 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. This file can contain fbcode-only targets. +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") define_common_targets() + +runtime.python_library( + name = "bundled_program_schema_py", + srcs = [ + "__init__.py", + "bundled_program_schema.py", + ], + visibility = [ + "//executorch/devtools/bundled_program/...", + "//executorch/devtools/etrecord/...", + ], + deps = [ + "//executorch/exir:scalar_type", + ], +) diff --git a/devtools/bundled_program/schema/TARGETS b/devtools/bundled_program/schema/TARGETS deleted file mode 100644 index 51c004cbec0..00000000000 --- a/devtools/bundled_program/schema/TARGETS +++ /dev/null @@ -1,24 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -runtime.python_library( - name = "bundled_program_schema_py", - srcs = [ - "__init__.py", - "bundled_program_schema.py", - ], - visibility = [ - "//executorch/devtools/bundled_program/...", - "//executorch/devtools/etrecord/...", - ], - deps = [ - "//executorch/exir:scalar_type", - ], -) diff --git a/exir/emit/BUCK b/exir/emit/BUCK index 51846daef65..0adee10e82e 100644 --- a/exir/emit/BUCK +++ b/exir/emit/BUCK @@ -1,4 +1,38 @@ -# add this empty BUCK file to unblock landing. Without this, we get land error: -# "No build file at xplat/executorch/exir/BUCK when resolving target fbsource//xplat/executorch/exir:." +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") + +runtime.python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + ":emit", + ], +) + +runtime.python_library( + name = "emit", + srcs = [ + "_emit_program.py", + "_emitter.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:error", + "//executorch/exir:memory", + "//executorch/exir:print_program", + "//executorch/exir:schema", + "//executorch/exir:tensor", + "//executorch/exir:types", + "//executorch/exir:version", + "//executorch/exir/dialects/backend:lib", + "//executorch/exir/dialects/edge:lib", + "//executorch/exir/operator:convert", + "//executorch/exir/passes:prim_ops_py_registry", + "//executorch/extension/pytree:pylib", + ], +) diff --git a/exir/emit/TARGETS b/exir/emit/TARGETS deleted file mode 100644 index 0adee10e82e..00000000000 --- a/exir/emit/TARGETS +++ /dev/null @@ -1,38 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -runtime.python_library( - name = "lib", - srcs = [ - "__init__.py", - ], - deps = [ - ":emit", - ], -) - -runtime.python_library( - name = "emit", - srcs = [ - "_emit_program.py", - "_emitter.py", - ], - deps = [ - "fbsource//third-party/pypi/typing-extensions:typing-extensions", - "//caffe2:torch", - "//executorch/exir:delegate", - "//executorch/exir:error", - "//executorch/exir:memory", - "//executorch/exir:print_program", - "//executorch/exir:schema", - "//executorch/exir:tensor", - "//executorch/exir:types", - "//executorch/exir:version", - "//executorch/exir/dialects/backend:lib", - "//executorch/exir/dialects/edge:lib", - "//executorch/exir/operator:convert", - "//executorch/exir/passes:prim_ops_py_registry", - "//executorch/extension/pytree:pylib", - ], -) diff --git a/extension/pytree/BUCK b/extension/pytree/BUCK index 1e8cc179228..79c4d2b8b3f 100644 --- a/extension/pytree/BUCK +++ b/extension/pytree/BUCK @@ -1,8 +1,49 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. This file can contain fbcode-only targets. +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") define_common_targets() + +runtime.cxx_python_extension( + name = "pybindings", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +runtime.cxx_python_extension( + name = "pybindings_debug", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +runtime.python_library( + name = "pylib", + srcs = [ + "__init__.py", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pybindings", + "//caffe2:torch", + ], +) diff --git a/extension/pytree/TARGETS b/extension/pytree/TARGETS deleted file mode 100644 index 79c4d2b8b3f..00000000000 --- a/extension/pytree/TARGETS +++ /dev/null @@ -1,49 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -runtime.cxx_python_extension( - name = "pybindings", - srcs = [ - "pybindings.cpp", - ], - base_module = "executorch.extension.pytree", - deps = [ - ":pytree", - ], - external_deps = [ - "pybind11", - ], -) - -runtime.cxx_python_extension( - name = "pybindings_debug", - srcs = [ - "pybindings.cpp", - ], - base_module = "executorch.extension.pytree", - deps = [ - ":pytree", - ], - external_deps = [ - "pybind11", - ], -) - -runtime.python_library( - name = "pylib", - srcs = [ - "__init__.py", - ], - base_module = "executorch.extension.pytree", - deps = [ - ":pybindings", - "//caffe2:torch", - ], -) diff --git a/extension/training/BUCK b/extension/training/BUCK index 1e8cc179228..eeed302c339 100644 --- a/extension/training/BUCK +++ b/extension/training/BUCK @@ -1,8 +1,20 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. This file can contain fbcode-only targets. +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") define_common_targets() + +runtime.python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + "//executorch/extension/training/pybindings:_training_lib", + "//executorch/extension/training/pybindings:_training_module", + ], +) diff --git a/extension/training/TARGETS b/extension/training/TARGETS deleted file mode 100644 index eeed302c339..00000000000 --- a/extension/training/TARGETS +++ /dev/null @@ -1,20 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -runtime.python_library( - name = "lib", - srcs = [ - "__init__.py", - ], - deps = [ - "//executorch/extension/training/pybindings:_training_lib", - "//executorch/extension/training/pybindings:_training_module", - ], -) diff --git a/kernels/portable/test/BUCK b/kernels/portable/test/BUCK index 1e8cc179228..44c5697729e 100644 --- a/kernels/portable/test/BUCK +++ b/kernels/portable/test/BUCK @@ -1,8 +1,28 @@ # Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain xplat-only targets. +# targets.bzl. This file can contain fbcode-only targets. load(":targets.bzl", "define_common_targets") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") define_common_targets() + +runtime.cxx_library( + name = "aot_ops_test_lib", + srcs = [ + "register_ops_aot_for_test.cpp", + ], + visibility = ["PUBLIC"], + deps = [ + "//executorch/extension/aten_util:aten_bridge", + "//executorch/kernels/portable/cpu:op_grid_sampler_2d", + "//executorch/kernels/portable/cpu:op_upsample_bilinear2d", + "//executorch/kernels/portable/cpu:op_upsample_bilinear2d_aa", + "//executorch/kernels/portable/cpu:op_upsample_nearest2d", + "//executorch/runtime/core/exec_aten:lib", + ], + external_deps = [ + "libtorch", + ], +) diff --git a/kernels/portable/test/TARGETS b/kernels/portable/test/TARGETS deleted file mode 100644 index 44c5697729e..00000000000 --- a/kernels/portable/test/TARGETS +++ /dev/null @@ -1,28 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -define_common_targets() - -runtime.cxx_library( - name = "aot_ops_test_lib", - srcs = [ - "register_ops_aot_for_test.cpp", - ], - visibility = ["PUBLIC"], - deps = [ - "//executorch/extension/aten_util:aten_bridge", - "//executorch/kernels/portable/cpu:op_grid_sampler_2d", - "//executorch/kernels/portable/cpu:op_upsample_bilinear2d", - "//executorch/kernels/portable/cpu:op_upsample_bilinear2d_aa", - "//executorch/kernels/portable/cpu:op_upsample_nearest2d", - "//executorch/runtime/core/exec_aten:lib", - ], - external_deps = [ - "libtorch", - ], -)