From 6a4b1d1d2dc4dc0083c5cc117376fde0f1a2f7c2 Mon Sep 17 00:00:00 2001 From: TARGETS Exterminator Date: Thu, 29 Jan 2026 20:37:36 -0800 Subject: [PATCH] Rename build files from TARGETS to BUCK (group ID: 3330812368427006721) (#17051) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/17051 Reviewed By: bigfootjon Differential Revision: D91839248 --- examples/selective_build/BUCK | 15 +++++++-- .../{selective_build/TARGETS => xnnpack/BUCK} | 3 +- examples/xnnpack/TARGETS | 8 ----- examples/xnnpack/executor_runner/BUCK | 15 +++++++-- examples/xnnpack/executor_runner/TARGETS | 8 ----- examples/xnnpack/quantization/BUCK | 31 +++++++++++++++++++ 6 files changed, 59 insertions(+), 21 deletions(-) rename examples/{selective_build/TARGETS => xnnpack/BUCK} (59%) delete mode 100644 examples/xnnpack/TARGETS delete mode 100644 examples/xnnpack/executor_runner/TARGETS create mode 100644 examples/xnnpack/quantization/BUCK diff --git a/examples/selective_build/BUCK b/examples/selective_build/BUCK index 1e8cc179228..47bc3844aea 100644 --- a/examples/selective_build/BUCK +++ b/examples/selective_build/BUCK @@ -1,8 +1,19 @@ +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/examples/selective_build/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +# 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") + + +fbcode_target(_kind = define_common_targets,) diff --git a/examples/selective_build/TARGETS b/examples/xnnpack/BUCK similarity index 59% rename from examples/selective_build/TARGETS rename to examples/xnnpack/BUCK index 2341af9282f..f488cf7ec94 100644 --- a/examples/selective_build/TARGETS +++ b/examples/xnnpack/BUCK @@ -1,3 +1,4 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain fbcode-only targets. @@ -5,4 +6,4 @@ load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets() +fbcode_target(_kind = define_common_targets,) diff --git a/examples/xnnpack/TARGETS b/examples/xnnpack/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/examples/xnnpack/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/xnnpack/executor_runner/BUCK b/examples/xnnpack/executor_runner/BUCK index 2341af9282f..19e6c63c305 100644 --- a/examples/xnnpack/executor_runner/BUCK +++ b/examples/xnnpack/executor_runner/BUCK @@ -1,8 +1,19 @@ +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 fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/examples/xnnpack/executor_runner/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + # 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() +fbcode_target(_kind = define_common_targets,) diff --git a/examples/xnnpack/executor_runner/TARGETS b/examples/xnnpack/executor_runner/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/examples/xnnpack/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 fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/examples/xnnpack/quantization/BUCK b/examples/xnnpack/quantization/BUCK new file mode 100644 index 00000000000..e04a6ef93c0 --- /dev/null +++ b/examples/xnnpack/quantization/BUCK @@ -0,0 +1,31 @@ +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") + +fbcode_target(_kind = runtime.python_binary, + name = "example", + main_function = ".example.main", + main_src = "example.py", + preload_deps = ["//executorch/kernels/quantized:aot_lib"], + deps = [ + ":quant_utils", + "//caffe2:torch", + "//executorch/examples/xnnpack:models", + "//executorch/extension/export_util:export_util", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "quant_utils", + srcs = [ + "utils.py", + ], + visibility = [ + "//executorch/examples/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", + ], +)