From 08a774924578c421623d1fe67ea3954e68390eaf Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Wed, 8 Jul 2026 13:02:12 -0700 Subject: [PATCH] rename TARGETS-only fbcode dirs with rules to BUCK (xplat-safe) Summary: Chunk 5 of fbcode/executorch TARGETS->BUCK migration. 26 directories that had only a TARGETS file (no sister BUCK) and define real top-level rules. 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 are migrated here. The `runtime.*` macros they use are routed by runtime_wrapper.bzl to the right cell-native rule. Renaming TARGETS -> BUCK exposes these directories to xplat via dirsync. 4 dirs were attempted but reverted because their `runtime.python_binary` kwargs (e.g. `main_src`) are accepted by fbcode_macros' python_binary but not by xplat's. They need a small targets.bzl tweak before they can land: - devtools/inspector - examples/devtools/scripts - extension/pybindings/fb/test - runtime/test Reviewed By: mzlee Differential Revision: D109082056 --- backends/aoti/passes/{TARGETS => BUCK} | 6 ++- backends/arm/{TARGETS => BUCK} | 37 +++++++++++++------ backends/arm/_passes/{TARGETS => BUCK} | 13 +++++-- backends/arm/debug/{TARGETS => BUCK} | 4 +- .../arm/operator_support/{TARGETS => BUCK} | 4 +- backends/arm/operators/{TARGETS => BUCK} | 13 +++++-- backends/arm/quantizer/{TARGETS => BUCK} | 19 +++++++--- backends/cuda/{TARGETS => BUCK} | 19 +++++++--- backends/mediatek/quantizer/{TARGETS => BUCK} | 4 +- backends/qualcomm/debugger/{TARGETS => BUCK} | 7 +++- .../partition/config/{TARGETS => BUCK} | 4 +- backends/xnnpack/quantizer/{TARGETS => BUCK} | 7 +++- backends/xnnpack/recipes/{TARGETS => BUCK} | 10 +++-- devtools/{TARGETS => BUCK} | 4 +- devtools/backend_debug/{TARGETS => BUCK} | 4 +- .../numerical_comparator/{TARGETS => BUCK} | 16 +++++--- .../intermediate_output_tap/{TARGETS => BUCK} | 25 +++++++++---- devtools/visualization/{TARGETS => BUCK} | 7 +++- examples/models/gemma/BUCK | 25 +++++++++++++ examples/models/gemma2/BUCK | 25 +++++++++++++ .../models/llama/params/{TARGETS => BUCK} | 4 +- export/{TARGETS => BUCK} | 28 +++++++++----- export/tests/{TARGETS => BUCK} | 10 +++-- extension/pybindings/test/{TARGETS => BUCK} | 16 +++++--- runtime/{TARGETS => BUCK} | 4 +- 25 files changed, 234 insertions(+), 81 deletions(-) rename backends/aoti/passes/{TARGETS => BUCK} (62%) rename backends/arm/{TARGETS => BUCK} (86%) rename backends/arm/_passes/{TARGETS => BUCK} (87%) rename backends/arm/debug/{TARGETS => BUCK} (68%) rename backends/arm/operator_support/{TARGETS => BUCK} (81%) rename backends/arm/operators/{TARGETS => BUCK} (77%) rename backends/arm/quantizer/{TARGETS => BUCK} (81%) rename backends/cuda/{TARGETS => BUCK} (84%) rename backends/mediatek/quantizer/{TARGETS => BUCK} (73%) rename backends/qualcomm/debugger/{TARGETS => BUCK} (83%) rename backends/xnnpack/partition/config/{TARGETS => BUCK} (77%) rename backends/xnnpack/quantizer/{TARGETS => BUCK} (75%) rename backends/xnnpack/recipes/{TARGETS => BUCK} (80%) rename devtools/{TARGETS => BUCK} (71%) rename devtools/backend_debug/{TARGETS => BUCK} (78%) rename devtools/inspector/numerical_comparator/{TARGETS => BUCK} (77%) rename devtools/intermediate_output_tap/{TARGETS => BUCK} (74%) rename devtools/visualization/{TARGETS => BUCK} (77%) create mode 100644 examples/models/gemma/BUCK create mode 100644 examples/models/gemma2/BUCK rename examples/models/llama/params/{TARGETS => BUCK} (66%) rename export/{TARGETS => BUCK} (79%) rename export/tests/{TARGETS => BUCK} (89%) rename extension/pybindings/test/{TARGETS => BUCK} (84%) rename runtime/{TARGETS => BUCK} (66%) diff --git a/backends/aoti/passes/TARGETS b/backends/aoti/passes/BUCK similarity index 62% rename from backends/aoti/passes/TARGETS rename to backends/aoti/passes/BUCK index 82f3b40dc54..2069d609d2a 100644 --- a/backends/aoti/passes/TARGETS +++ b/backends/aoti/passes/BUCK @@ -1,11 +1,13 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "passes", srcs = [ - "replace_view_copy_with_view.py", + "replace_view_copy_with_view.py", ], visibility = [ "//executorch/...", diff --git a/backends/arm/TARGETS b/backends/arm/BUCK similarity index 86% rename from backends/arm/TARGETS rename to backends/arm/BUCK index 6254c73e188..53e77d976fc 100644 --- a/backends/arm/TARGETS +++ b/backends/arm/BUCK @@ -4,9 +4,11 @@ # LICENSE file in the root directory of this source tree. # @noautodeps +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "constants", srcs = [ "constants.py", @@ -15,7 +17,8 @@ runtime.python_library( "//executorch/exir/dialects:lib", ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "ao_ext", srcs = glob([ "ao_ext/*.py", @@ -28,7 +31,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "lib", srcs = [ "__init__.py", @@ -40,7 +44,8 @@ runtime.python_library( "//executorch/backends/arm/quantizer:lib", ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "common", srcs = glob(["common/*.py"]), deps = [ @@ -50,7 +55,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "arm_compile_spec", srcs = [ "common/arm_compile_spec.py", @@ -67,7 +73,8 @@ runtime.python_library( "//executorch/backends/arm/_passes:passes", ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "ethosu", srcs = [ "ethosu/__init__.py", @@ -83,7 +90,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "vgf", srcs = [ "vgf/__init__.py", @@ -119,7 +127,8 @@ runtime.python_library( "//executorch/exir:lib", ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "public_api", srcs = ["__init__.py"], deps = [ @@ -129,7 +138,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "process_node", srcs = ["process_node.py"], deps = [ @@ -141,7 +151,8 @@ runtime.python_library( "//executorch/exir:lib", ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "arm_vela", srcs = [ "arm_vela.py", @@ -150,7 +161,8 @@ runtime.python_library( "fbsource//third-party/pypi/ethos-u-vela:ethos-u-vela", ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "arm_model_evaluator", srcs = [ "util/arm_model_evaluator.py", @@ -159,7 +171,8 @@ runtime.python_library( "//caffe2:torch", ] ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "_factory", srcs = [ "util/_factory.py" diff --git a/backends/arm/_passes/TARGETS b/backends/arm/_passes/BUCK similarity index 87% rename from backends/arm/_passes/TARGETS rename to backends/arm/_passes/BUCK index 8b7340fc56b..3ce0fe5aeba 100644 --- a/backends/arm/_passes/TARGETS +++ b/backends/arm/_passes/BUCK @@ -1,6 +1,8 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "core", srcs = [ "arm_pass.py", @@ -17,7 +19,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "arm_pass_manager_base", srcs = ["arm_pass_manager.py"], deps = [ @@ -32,7 +35,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "arm_pass_manager_fb", srcs = [], deps = [ @@ -41,7 +45,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "passes", srcs = glob(["*.py"], exclude = [ "arm_pass.py", diff --git a/backends/arm/debug/TARGETS b/backends/arm/debug/BUCK similarity index 68% rename from backends/arm/debug/TARGETS rename to backends/arm/debug/BUCK index a88e3b077cd..8374fab364e 100644 --- a/backends/arm/debug/TARGETS +++ b/backends/arm/debug/BUCK @@ -1,7 +1,9 @@ # @noautodeps +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "schema", srcs = [ "__init__.py", diff --git a/backends/arm/operator_support/TARGETS b/backends/arm/operator_support/BUCK similarity index 81% rename from backends/arm/operator_support/TARGETS rename to backends/arm/operator_support/BUCK index 88e112feac5..b0a908b3fd5 100644 --- a/backends/arm/operator_support/TARGETS +++ b/backends/arm/operator_support/BUCK @@ -1,6 +1,8 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "operator_support", srcs = glob(["*.py"]), deps = [ diff --git a/backends/arm/operators/TARGETS b/backends/arm/operators/BUCK similarity index 77% rename from backends/arm/operators/TARGETS rename to backends/arm/operators/BUCK index e4efa27e683..2555aa78035 100644 --- a/backends/arm/operators/TARGETS +++ b/backends/arm/operators/BUCK @@ -1,7 +1,9 @@ # @noautodeps +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "node_visitor", srcs = [ "node_visitor.py", @@ -15,12 +17,14 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "operator_validation_utils", srcs = ["operator_validation_utils.py"], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "ops", srcs = glob(["op_*.py", "ops_*.py"]), deps = [ @@ -34,7 +38,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/backends/arm/quantizer/TARGETS b/backends/arm/quantizer/BUCK similarity index 81% rename from backends/arm/quantizer/TARGETS rename to backends/arm/quantizer/BUCK index 52c3a1b1158..632a38523e2 100644 --- a/backends/arm/quantizer/TARGETS +++ b/backends/arm/quantizer/BUCK @@ -1,7 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") # Exposed through __init__.py -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "quantization_config", srcs = ["quantization_config.py"], deps = [ @@ -10,7 +12,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "arm_quantizer", srcs = ["arm_quantizer.py"], deps = [ @@ -29,7 +32,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "quantization_annotator", srcs = ["quantization_annotator.py"], deps = [ @@ -40,7 +44,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "arm_quantizer_utils", srcs = ["arm_quantizer_utils.py"], deps = [ @@ -52,7 +57,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "quantizer_support", srcs = ["quantizer_support.py"], deps = [ @@ -62,7 +68,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/backends/cuda/TARGETS b/backends/cuda/BUCK similarity index 84% rename from backends/cuda/TARGETS rename to backends/cuda/BUCK index feb758a16ed..86bf0e64369 100644 --- a/backends/cuda/TARGETS +++ b/backends/cuda/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "int4_dispatch", srcs = [ "int4_dispatch.py", @@ -16,7 +18,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "cuda_passes", srcs = [ "passes/__init__.py", @@ -32,7 +35,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "cuda_backend", srcs = [ "cuda_backend.py", @@ -52,7 +56,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "cuda_partitioner", srcs = [ "cuda_partitioner.py", @@ -66,7 +71,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "triton_kernels", srcs = [ "triton/kernels/__init__.py", @@ -83,7 +89,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "triton_replacement_pass", srcs = [ "triton/__init__.py", diff --git a/backends/mediatek/quantizer/TARGETS b/backends/mediatek/quantizer/BUCK similarity index 73% rename from backends/mediatek/quantizer/TARGETS rename to backends/mediatek/quantizer/BUCK index 09be73cd172..847bfc547b2 100644 --- a/backends/mediatek/quantizer/TARGETS +++ b/backends/mediatek/quantizer/BUCK @@ -1,6 +1,8 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "quantizer", srcs = [ "__init__.py", diff --git a/backends/qualcomm/debugger/TARGETS b/backends/qualcomm/debugger/BUCK similarity index 83% rename from backends/qualcomm/debugger/TARGETS rename to backends/qualcomm/debugger/BUCK index 3389dfdfcd9..28b5e68a879 100644 --- a/backends/qualcomm/debugger/TARGETS +++ b/backends/qualcomm/debugger/BUCK @@ -1,6 +1,8 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "utils", srcs = ["utils.py"], deps = [ @@ -11,7 +13,8 @@ runtime.python_library( ] ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "qnn_intermediate_debugger", srcs = [ "format_outputs.py", diff --git a/backends/xnnpack/partition/config/TARGETS b/backends/xnnpack/partition/config/BUCK similarity index 77% rename from backends/xnnpack/partition/config/TARGETS rename to backends/xnnpack/partition/config/BUCK index af6472634b5..a01d3c1b15a 100644 --- a/backends/xnnpack/partition/config/TARGETS +++ b/backends/xnnpack/partition/config/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "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_configs", srcs = glob([ "*.py", diff --git a/backends/xnnpack/quantizer/TARGETS b/backends/xnnpack/quantizer/BUCK similarity index 75% rename from backends/xnnpack/quantizer/TARGETS rename to backends/xnnpack/quantizer/BUCK index 0a30773923d..72dd65c00f8 100644 --- a/backends/xnnpack/quantizer/TARGETS +++ b/backends/xnnpack/quantizer/BUCK @@ -1,6 +1,8 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "xnnpack_quantizer", srcs = ["xnnpack_quantizer.py"], deps = [ @@ -11,7 +13,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "xnnpack_quantizer_utils", srcs = ["xnnpack_quantizer_utils.py"], deps = [ diff --git a/backends/xnnpack/recipes/TARGETS b/backends/xnnpack/recipes/BUCK similarity index 80% rename from backends/xnnpack/recipes/TARGETS rename to backends/xnnpack/recipes/BUCK index 03bdd7230c4..cc2e3c4ca5e 100644 --- a/backends/xnnpack/recipes/TARGETS +++ b/backends/xnnpack/recipes/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "xnnpack_recipes", srcs = [ "__init__.py", @@ -15,7 +17,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "xnnpack_recipe_provider", srcs = [ "xnnpack_recipe_provider.py", @@ -31,7 +34,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "xnnpack_recipe_types", srcs = [ "xnnpack_recipe_types.py", diff --git a/devtools/TARGETS b/devtools/BUCK similarity index 71% rename from devtools/TARGETS rename to devtools/BUCK index 2236702fbc7..a46ee0ae956 100644 --- a/devtools/TARGETS +++ b/devtools/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/devtools/backend_debug/TARGETS b/devtools/backend_debug/BUCK similarity index 78% rename from devtools/backend_debug/TARGETS rename to devtools/backend_debug/BUCK index 00fde3ee3b4..d931baed447 100644 --- a/devtools/backend_debug/TARGETS +++ b/devtools/backend_debug/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "delegation_info", srcs = [ "__init__.py", diff --git a/devtools/inspector/numerical_comparator/TARGETS b/devtools/inspector/numerical_comparator/BUCK similarity index 77% rename from devtools/inspector/numerical_comparator/TARGETS rename to devtools/inspector/numerical_comparator/BUCK index eb2923d924d..7afd49b99d0 100644 --- a/devtools/inspector/numerical_comparator/TARGETS +++ b/devtools/inspector/numerical_comparator/BUCK @@ -1,15 +1,18 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "numerical_comparator_base", srcs = ["numerical_comparator_base.py"], deps = [], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "l1_numerical_comparator", srcs = ["l1_numerical_comparator.py"], deps = [ @@ -18,7 +21,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "mse_numerical_comparator", srcs = ["mse_numerical_comparator.py"], deps = [ @@ -27,7 +31,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "snr_numerical_comparator", srcs = ["snr_numerical_comparator.py"], deps = [ @@ -36,7 +41,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/devtools/intermediate_output_tap/TARGETS b/devtools/intermediate_output_tap/BUCK similarity index 74% rename from devtools/intermediate_output_tap/TARGETS rename to devtools/intermediate_output_tap/BUCK index 5ae2ddc8380..daf5c293801 100644 --- a/devtools/intermediate_output_tap/TARGETS +++ b/devtools/intermediate_output_tap/BUCK @@ -1,13 +1,16 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "spec", srcs = ["_spec.py"], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "custom_ops_lib", srcs = ["custom_ops_lib.py"], deps = [ @@ -15,7 +18,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "selectors", srcs = ["_selectors.py"], deps = [ @@ -23,7 +27,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "reducers", srcs = ["_reducers.py"], deps = [ @@ -32,7 +37,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "tap_pass", srcs = ["_tap_pass.py"], deps = [ @@ -44,7 +50,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "strip_pass", srcs = ["_strip_pass.py"], deps = [ @@ -54,7 +61,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "convenience", srcs = ["_convenience.py"], deps = [ @@ -70,7 +78,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/devtools/visualization/TARGETS b/devtools/visualization/BUCK similarity index 77% rename from devtools/visualization/TARGETS rename to devtools/visualization/BUCK index 88a5ba77107..cb6a883fd8f 100644 --- a/devtools/visualization/TARGETS +++ b/devtools/visualization/BUCK @@ -1,10 +1,12 @@ # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain fbcode-only targets. +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "visualization", srcs = [ "__init__.py", @@ -18,7 +20,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "test", srcs = [ "visualization_utils_test.py", diff --git a/examples/models/gemma/BUCK b/examples/models/gemma/BUCK new file mode 100644 index 00000000000..15fbe143122 --- /dev/null +++ b/examples/models/gemma/BUCK @@ -0,0 +1,25 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +oncall("executorch") + +fbcode_target( + _kind = runtime.python_library, + name = "gemma", + srcs = [ + "__init__.py", + "convert_weights.py", + ], + _is_external_target = True, + base_module = "executorch.examples.models.gemma", + resources = { + "config/2b_config.json": "config/2b_config.json", + }, + deps = [ + "//caffe2:torch", + "//executorch/examples/models/llama:llama2_model", + "fbcode//pytorch/torchtune:lib", + "fbsource//third-party/pypi/safetensors:safetensors", + ], + visibility = ["PUBLIC"], +) diff --git a/examples/models/gemma2/BUCK b/examples/models/gemma2/BUCK new file mode 100644 index 00000000000..ec43867b09d --- /dev/null +++ b/examples/models/gemma2/BUCK @@ -0,0 +1,25 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +oncall("executorch") + +fbcode_target( + _kind = runtime.python_library, + name = "gemma2", + srcs = [ + "__init__.py", + "convert_weights.py", + ], + _is_external_target = True, + base_module = "executorch.examples.models.gemma2", + resources = { + "config/2b_config.json": "config/2b_config.json", + }, + deps = [ + "//caffe2:torch", + "//executorch/examples/models/llama:llama2_model", + "fbcode//pytorch/torchtune:lib", + "fbsource//third-party/pypi/safetensors:safetensors", + ], + visibility = ["PUBLIC"], +) diff --git a/examples/models/llama/params/TARGETS b/examples/models/llama/params/BUCK similarity index 66% rename from examples/models/llama/params/TARGETS rename to examples/models/llama/params/BUCK index e7d4f60f470..40cdaae4fb3 100644 --- a/examples/models/llama/params/TARGETS +++ b/examples/models/llama/params/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.filegroup( +fbcode_target( + _kind = runtime.filegroup, name = "params", srcs = [ "demo_config.json", diff --git a/export/TARGETS b/export/BUCK similarity index 79% rename from export/TARGETS rename to export/BUCK index 71be2259584..b9a932bc365 100644 --- a/export/TARGETS +++ b/export/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "recipe", srcs = [ "recipe.py", @@ -16,7 +18,8 @@ runtime.python_library( ] ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "export", srcs = [ "export.py", @@ -31,7 +34,8 @@ runtime.python_library( ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "stages", srcs = [ "stages.py", @@ -49,7 +53,8 @@ runtime.python_library( ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "lib", srcs = [ "__init__.py", @@ -65,7 +70,8 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "recipe_registry", srcs = [ "recipe_registry.py", @@ -78,7 +84,8 @@ runtime.python_library( ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "recipe_provider", srcs = [ "recipe_provider.py", @@ -88,14 +95,16 @@ runtime.python_library( ] ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "types", srcs = [ "types.py", ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "target_recipes", srcs = [ "target_recipes.py", @@ -110,7 +119,8 @@ runtime.python_library( ] ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "export_utils", srcs = ["utils.py"], deps = [ diff --git a/export/tests/TARGETS b/export/tests/BUCK similarity index 89% rename from export/tests/TARGETS rename to export/tests/BUCK index 7b1578ce508..1ef8e9d8db7 100644 --- a/export/tests/TARGETS +++ b/export/tests/BUCK @@ -1,9 +1,11 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_version") oncall("executorch") -runtime.python_test( +fbcode_target( + _kind = runtime.python_test, name = "executorch_export", srcs = [ "test_executorch_export.py", @@ -16,7 +18,8 @@ runtime.python_test( ] ) -runtime.python_test( +fbcode_target( + _kind = runtime.python_test, name = "test_executorch_export", srcs = [ "test_recipe_provider.py", @@ -33,7 +36,8 @@ runtime.python_test( ] ) -runtime.python_test( +fbcode_target( + _kind = runtime.python_test, name = "test_target_recipes", srcs = [ "test_target_recipes.py", diff --git a/extension/pybindings/test/TARGETS b/extension/pybindings/test/BUCK similarity index 84% rename from extension/pybindings/test/TARGETS rename to extension/pybindings/test/BUCK index c6a77c9d64e..a18abac2382 100644 --- a/extension/pybindings/test/TARGETS +++ b/extension/pybindings/test/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, # autodeps has a real hard time tracking the owner of the pybindings # from portable and the suggested fixes I could find didnt work, so # just disabling for now @@ -30,7 +32,8 @@ runtime.python_library( ], ) -runtime.python_test( +fbcode_target( + _kind = runtime.python_test, name = "test_pybindings_portable_lib", srcs = ["test_pybindings.py"], preload_deps = ["//executorch/kernels/quantized:aot_lib"], @@ -40,7 +43,8 @@ runtime.python_test( ], ) -runtime.python_test( +fbcode_target( + _kind = runtime.python_test, name = "test_pybindings_aten_lib", srcs = ["test_pybindings.py"], preload_deps = ["//executorch/kernels/quantized:aot_lib"], @@ -51,7 +55,8 @@ runtime.python_test( ], ) -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "test_pybindings_lib", srcs = ["test_pybindings.py"], deps = [ @@ -60,7 +65,8 @@ runtime.python_library( ) -runtime.python_test( +fbcode_target( + _kind = runtime.python_test, name = "test_backend_pybinding", srcs = ["test_backend_pybinding.py"], deps = [ diff --git a/runtime/TARGETS b/runtime/BUCK similarity index 66% rename from runtime/TARGETS rename to runtime/BUCK index 9f8f1b9783a..9c148eae246 100644 --- a/runtime/TARGETS +++ b/runtime/BUCK @@ -1,8 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target( + _kind = runtime.python_library, name = "runtime", srcs = ["__init__.py"], deps = [