From 4f65280b9bb71a3d5cf3fdb412306b03616f872f Mon Sep 17 00:00:00 2001 From: TARGETS Exterminator Date: Wed, 14 Jan 2026 21:30:23 -0800 Subject: [PATCH] Rename build files from TARGETS to BUCK (group ID: -7315335610904582381) (#16608) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/16608 Reviewed By: bigfootjon Differential Revision: D90696781 --- backends/vulkan/tools/gpuinfo/BUCK | 59 +++++++- backends/vulkan/tools/gpuinfo/TARGETS | 50 ------- backends/xnnpack/BUCK | 43 +++++- backends/xnnpack/TARGETS | 36 ----- backends/xnnpack/_passes/{TARGETS => BUCK} | 3 +- backends/xnnpack/operators/{TARGETS => BUCK} | 3 +- backends/xnnpack/partition/{TARGETS => BUCK} | 5 +- .../partition/config/{TARGETS => BUCK} | 3 +- backends/xnnpack/quantizer/{TARGETS => BUCK} | 5 +- backends/xnnpack/recipes/{TARGETS => BUCK} | 7 +- backends/xnnpack/serialization/BUCK | 35 ++++- backends/xnnpack/serialization/TARGETS | 29 ---- backends/xnnpack/test/BUCK | 133 +++++++++++++++++- backends/xnnpack/test/TARGETS | 127 ----------------- .../xnnpack/test/tester/{TARGETS => BUCK} | 3 +- backends/xnnpack/utils/{TARGETS => BUCK} | 3 +- codegen/BUCK | 12 +- codegen/TARGETS | 5 - codegen/test/BUCK | 15 +- codegen/test/TARGETS | 8 -- codegen/tools/BUCK | 12 +- codegen/tools/TARGETS | 5 - configurations/BUCK | 15 +- configurations/TARGETS | 8 -- devtools/{TARGETS => BUCK} | 3 +- devtools/backend_debug/{TARGETS => BUCK} | 3 +- .../backend_debug/tests/{TARGETS => BUCK} | 3 +- devtools/bundled_program/BUCK | 49 ++++++- devtools/bundled_program/TARGETS | 44 ------ devtools/bundled_program/schema/BUCK | 31 +++- devtools/bundled_program/schema/TARGETS | 24 ---- 31 files changed, 412 insertions(+), 369 deletions(-) delete mode 100644 backends/vulkan/tools/gpuinfo/TARGETS delete mode 100644 backends/xnnpack/TARGETS rename backends/xnnpack/_passes/{TARGETS => BUCK} (86%) rename backends/xnnpack/operators/{TARGETS => BUCK} (71%) rename backends/xnnpack/partition/{TARGETS => BUCK} (81%) rename backends/xnnpack/partition/config/{TARGETS => BUCK} (75%) rename backends/xnnpack/quantizer/{TARGETS => BUCK} (74%) rename backends/xnnpack/recipes/{TARGETS => BUCK} (80%) delete mode 100644 backends/xnnpack/serialization/TARGETS delete mode 100644 backends/xnnpack/test/TARGETS rename backends/xnnpack/test/tester/{TARGETS => BUCK} (88%) rename backends/xnnpack/utils/{TARGETS => BUCK} (75%) delete mode 100644 codegen/TARGETS delete mode 100644 codegen/test/TARGETS delete mode 100644 codegen/tools/TARGETS delete mode 100644 configurations/TARGETS rename devtools/{TARGETS => BUCK} (68%) rename devtools/backend_debug/{TARGETS => BUCK} (76%) rename devtools/backend_debug/tests/{TARGETS => BUCK} (76%) delete mode 100644 devtools/bundled_program/TARGETS delete mode 100644 devtools/bundled_program/schema/TARGETS diff --git a/backends/vulkan/tools/gpuinfo/BUCK b/backends/vulkan/tools/gpuinfo/BUCK index 7477875096e..7830ee4e1f5 100644 --- a/backends/vulkan/tools/gpuinfo/BUCK +++ b/backends/vulkan/tools/gpuinfo/BUCK @@ -1,3 +1,4 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbcode_macros//build_defs:native_rules.bzl", "buck_filegroup") load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary") load( @@ -11,7 +12,7 @@ load( oncall("executorch") -buck_filegroup( +non_fbcode_target(_kind = buck_filegroup, name = "gpuinfo_shaders", srcs = glob([ "glsl/*", @@ -21,14 +22,14 @@ buck_filegroup( ], ) -vulkan_spv_shader_lib( +non_fbcode_target(_kind = vulkan_spv_shader_lib, name = "gpuinfo_shader_lib", spv_filegroups = { ":gpuinfo_shaders": "glsl", }, ) -fb_xplat_cxx_binary( +non_fbcode_target(_kind = fb_xplat_cxx_binary, name = "vulkan_gpuinfo", srcs = glob([ "**/*.cpp", @@ -56,3 +57,55 @@ fb_xplat_cxx_binary( "//xplat/folly:json", ], ) + +# !!!! fbcode/executorch/backends/vulkan/tools/gpuinfo/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbcode_macros//build_defs:native_rules.bzl", "buck_filegroup") +load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary") +load( + "@fbsource//tools/build_defs:platform_defs.bzl", + "ANDROID", +) +load( + "@fbsource//xplat/executorch/backends/vulkan:targets.bzl", + "vulkan_spv_shader_lib", +) + + +fbcode_target(_kind = buck_filegroup, + name = "gpuinfo_shaders", + srcs = glob([ + "glsl/*", + ]), + visibility = [ + "PUBLIC", + ], +) + +fbcode_target(_kind = vulkan_spv_shader_lib, + name = "gpuinfo_shader_lib", + is_fbcode = True, + spv_filegroups = { + ":gpuinfo_shaders": "glsl", + }, +) + +fbcode_target(_kind = fb_xplat_cxx_binary, + name = "vulkan_gpuinfo", + srcs = glob([ + "**/*.cpp", + ]), + headers = glob([ + "**/*.h", + ]), + header_namespace = "/include", + include_directories = ["/include"], + platforms = ANDROID, + raw_headers = glob([ + "**/*.h", + ]), + deps = [ + ":gpuinfo_shader_lib", + "//executorch/backends/vulkan:vulkan_graph_runtime", + ], +) diff --git a/backends/vulkan/tools/gpuinfo/TARGETS b/backends/vulkan/tools/gpuinfo/TARGETS deleted file mode 100644 index 10e3acb4b8c..00000000000 --- a/backends/vulkan/tools/gpuinfo/TARGETS +++ /dev/null @@ -1,50 +0,0 @@ -load("@fbcode_macros//build_defs:native_rules.bzl", "buck_filegroup") -load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary") -load( - "@fbsource//tools/build_defs:platform_defs.bzl", - "ANDROID", -) -load( - "@fbsource//xplat/executorch/backends/vulkan:targets.bzl", - "vulkan_spv_shader_lib", -) - -oncall("executorch") - -buck_filegroup( - name = "gpuinfo_shaders", - srcs = glob([ - "glsl/*", - ]), - visibility = [ - "PUBLIC", - ], -) - -vulkan_spv_shader_lib( - name = "gpuinfo_shader_lib", - is_fbcode = True, - spv_filegroups = { - ":gpuinfo_shaders": "glsl", - }, -) - -fb_xplat_cxx_binary( - name = "vulkan_gpuinfo", - srcs = glob([ - "**/*.cpp", - ]), - headers = glob([ - "**/*.h", - ]), - header_namespace = "/include", - include_directories = ["/include"], - platforms = ANDROID, - raw_headers = glob([ - "**/*.h", - ]), - deps = [ - ":gpuinfo_shader_lib", - "//executorch/backends/vulkan:vulkan_graph_runtime", - ], -) 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", diff --git a/backends/xnnpack/partition/config/TARGETS b/backends/xnnpack/partition/config/BUCK similarity index 75% rename from backends/xnnpack/partition/config/TARGETS rename to backends/xnnpack/partition/config/BUCK index af6472634b5..ad7aea48b99 100644 --- a/backends/xnnpack/partition/config/TARGETS +++ b/backends/xnnpack/partition/config/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_configs", srcs = glob([ "*.py", diff --git a/backends/xnnpack/quantizer/TARGETS b/backends/xnnpack/quantizer/BUCK similarity index 74% rename from backends/xnnpack/quantizer/TARGETS rename to backends/xnnpack/quantizer/BUCK index 0a30773923d..94b3614d0bc 100644 --- a/backends/xnnpack/quantizer/TARGETS +++ b/backends/xnnpack/quantizer/BUCK @@ -1,6 +1,7 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_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 +12,7 @@ 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..afae0a1982e 100644 --- a/backends/xnnpack/recipes/TARGETS +++ b/backends/xnnpack/recipes/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_recipes", srcs = [ "__init__.py", @@ -15,7 +16,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "xnnpack_recipe_provider", srcs = [ "xnnpack_recipe_provider.py", @@ -31,7 +32,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "xnnpack_recipe_types", srcs = [ "xnnpack_recipe_types.py", diff --git a/backends/xnnpack/serialization/BUCK b/backends/xnnpack/serialization/BUCK index c0b4f27eb52..9c4bee922b8 100644 --- a/backends/xnnpack/serialization/BUCK +++ b/backends/xnnpack/serialization/BUCK @@ -1,3 +1,36 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load(":targets.bzl", "define_common_targets") -define_common_targets() +oncall("executorch") +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/backends/xnnpack/serialization/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_schema", + srcs = [ + "xnnpack_graph_schema.py", + ], + visibility = ["PUBLIC"], +) + +fbcode_target(_kind = 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/backends/xnnpack/test/BUCK b/backends/xnnpack/test/BUCK index 1399eb0e8a7..5e3e255f48c 100644 --- a/backends/xnnpack/test/BUCK +++ b/backends/xnnpack/test/BUCK @@ -1,3 +1,4 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary") load( "@fbsource//tools/build_defs:platform_defs.bzl", @@ -8,9 +9,10 @@ load( "get_pt_ops_deps", ) +oncall("executorch") # As fb_xplat_cxx_test (using target.bzl) fails to compile for # android-arm64. -fb_xplat_cxx_binary( +non_fbcode_target(_kind = fb_xplat_cxx_binary, name = "dynamic_quant_utils_test", srcs = ["runtime/test_runtime_utils.cpp"], platforms = (ANDROID,), @@ -31,3 +33,132 @@ fb_xplat_cxx_binary( ], ), ) + +# !!!! fbcode/executorch/backends/xnnpack/test/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_test, + name = "test_xnnpack_passes", + srcs = glob([ + "passes/*.py", + ]) + [ + "test_xnnpack_utils_classes.py", + ], + deps = [ + "//executorch/backends/transforms:remove_getitem_op", + "//executorch/backends/xnnpack/_passes:xnnpack_passes", + "//executorch/backends/xnnpack/test/tester:tester", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + "//executorch/exir:lib", + "//executorch/exir:pass_base", + "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir/dialects:lib", + ], + external_deps = [ + "libtorch", + ], +) + +fbcode_target(_kind = runtime.python_test, + name = "test_xnnpack_ops", + srcs = glob([ + "ops/*.py", + ]) + [ + "test_xnnpack_utils.py", + ], + deps = [ + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", + "//executorch/backends/xnnpack/test/tester:tester", + "//executorch/devtools:lib", + "//executorch/devtools/bundled_program:config", + "//executorch/devtools/bundled_program/serialize:lib", + "//executorch/exir/passes:constant_prop_pass", + "//pytorch/ao:torchao", # @manual + ], + external_deps = [ + "libtorch", + ], +) + +fbcode_target(_kind = runtime.python_test, + name = "test_xnnpack_models", + srcs = glob([ + "models/*.py", + ]), + labels = ["long_running"], + deps = [ + "fbsource//third-party/pypi/timm:timm", + "fbsource//third-party/pypi/torchsr:torchsr", # @manual + "fbsource//third-party/pypi/transformers:transformers", # @manual + "//executorch/backends/xnnpack/test/tester:tester", + "//executorch/examples/models/llama:llama2_model", + "//pytorch/audio/src:torchaudio_core", + "//pytorch/vision:torchvision", # @manual + ], + external_deps = [ + "libtorch", + ], +) + +fbcode_target(_kind = runtime.python_test, + name = "test_xnnpack_serialization", + srcs = glob([ + "serialization/*.py", + ]), + deps = [ + "//executorch/backends/xnnpack:xnnpack_preprocess", + ], +) + +fbcode_target(_kind = runtime.python_test, + name = "test_xnnpack_quantizer", + srcs = glob([ + "quantizer/*.py", + ]), + deps = [ + "//executorch/backends/xnnpack:xnnpack_preprocess", + "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", + "//pytorch/ao:torchao", # @manual + "//caffe2:torch", + ], + external_deps = [ + "libtorch", + ], +) + +fbcode_target(_kind = runtime.python_test, + name = "test_xnnpack_recipes", + srcs = glob([ + "recipes/*.py", + ]), + env = { + "HTTP_PROXY": "http://fwdproxy:8080", + "HTTPS_PROXY": "http://fwdproxy:8080", + }, + deps = [ + "//executorch/backends/xnnpack/recipes:xnnpack_recipes", + "//executorch/export:lib", + "//executorch/runtime:runtime", # @manual + "//pytorch/vision:torchvision", # @manual + "//executorch/backends/xnnpack/test/tester:tester", + "//executorch/examples/models:models", # @manual + "//executorch/examples/xnnpack:models", # @manual + ], +) + +fbcode_target(_kind = runtime.python_test, + name = "test_xnnpack_partitioner", + srcs = ["test_xnnpack_partitioner.py"], + deps = [ + "//caffe2:torch", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/exir:lib", + "//executorch/extension/pybindings:portable_lib", + ], +) diff --git a/backends/xnnpack/test/TARGETS b/backends/xnnpack/test/TARGETS deleted file mode 100644 index 1729a893ff4..00000000000 --- a/backends/xnnpack/test/TARGETS +++ /dev/null @@ -1,127 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -runtime.python_test( - name = "test_xnnpack_passes", - srcs = glob([ - "passes/*.py", - ]) + [ - "test_xnnpack_utils_classes.py", - ], - deps = [ - "//executorch/backends/transforms:remove_getitem_op", - "//executorch/backends/xnnpack/_passes:xnnpack_passes", - "//executorch/backends/xnnpack/test/tester:tester", - "//executorch/backends/xnnpack/utils:xnnpack_utils", - "//executorch/exir:lib", - "//executorch/exir:pass_base", - "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", - "//executorch/exir/dialects:lib", - ], - external_deps = [ - "libtorch", - ], -) - -runtime.python_test( - name = "test_xnnpack_ops", - srcs = glob([ - "ops/*.py", - ]) + [ - "test_xnnpack_utils.py", - ], - deps = [ - "//executorch/backends/xnnpack/partition:xnnpack_partitioner", - "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", - "//executorch/backends/xnnpack/test/tester:tester", - "//executorch/devtools:lib", - "//executorch/devtools/bundled_program:config", - "//executorch/devtools/bundled_program/serialize:lib", - "//executorch/exir/passes:constant_prop_pass", - "//pytorch/ao:torchao", # @manual - ], - external_deps = [ - "libtorch", - ], -) - -runtime.python_test( - name = "test_xnnpack_models", - srcs = glob([ - "models/*.py", - ]), - labels = ["long_running"], - deps = [ - "fbsource//third-party/pypi/timm:timm", - "fbsource//third-party/pypi/torchsr:torchsr", # @manual - "fbsource//third-party/pypi/transformers:transformers", # @manual - "//executorch/backends/xnnpack/test/tester:tester", - "//executorch/examples/models/llama:llama2_model", - "//pytorch/audio/src:torchaudio_core", - "//pytorch/vision:torchvision", # @manual - ], - external_deps = [ - "libtorch", - ], -) - -runtime.python_test( - name = "test_xnnpack_serialization", - srcs = glob([ - "serialization/*.py", - ]), - deps = [ - "//executorch/backends/xnnpack:xnnpack_preprocess", - ], -) - -runtime.python_test( - name = "test_xnnpack_quantizer", - srcs = glob([ - "quantizer/*.py", - ]), - deps = [ - "//executorch/backends/xnnpack:xnnpack_preprocess", - "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", - "//pytorch/ao:torchao", # @manual - "//caffe2:torch", - ], - external_deps = [ - "libtorch", - ], -) - -runtime.python_test( - name = "test_xnnpack_recipes", - srcs = glob([ - "recipes/*.py", - ]), - env = { - "HTTP_PROXY": "http://fwdproxy:8080", - "HTTPS_PROXY": "http://fwdproxy:8080", - }, - deps = [ - "//executorch/backends/xnnpack/recipes:xnnpack_recipes", - "//executorch/export:lib", - "//executorch/runtime:runtime", # @manual - "//pytorch/vision:torchvision", # @manual - "//executorch/backends/xnnpack/test/tester:tester", - "//executorch/examples/models:models", # @manual - "//executorch/examples/xnnpack:models", # @manual - ], -) - -runtime.python_test( - name = "test_xnnpack_partitioner", - srcs = ["test_xnnpack_partitioner.py"], - deps = [ - "//caffe2:torch", - "//executorch/backends/xnnpack/partition:xnnpack_partitioner", - "//executorch/exir:lib", - "//executorch/extension/pybindings:portable_lib", - ], -) diff --git a/backends/xnnpack/test/tester/TARGETS b/backends/xnnpack/test/tester/BUCK similarity index 88% rename from backends/xnnpack/test/tester/TARGETS rename to backends/xnnpack/test/tester/BUCK index 00662e4a934..c9b0239de02 100644 --- a/backends/xnnpack/test/tester/TARGETS +++ b/backends/xnnpack/test/tester/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 = "tester", srcs = [ "__init__.py", diff --git a/backends/xnnpack/utils/TARGETS b/backends/xnnpack/utils/BUCK similarity index 75% rename from backends/xnnpack/utils/TARGETS rename to backends/xnnpack/utils/BUCK index d018f294c17..0c64e1103db 100644 --- a/backends/xnnpack/utils/TARGETS +++ b/backends/xnnpack/utils/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_utils", srcs = glob(["*.py"]), deps = [ diff --git a/codegen/BUCK b/codegen/BUCK index 1e8cc179228..9e3bda48ed1 100644 --- a/codegen/BUCK +++ b/codegen/BUCK @@ -1,8 +1,16 @@ +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/codegen/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) diff --git a/codegen/TARGETS b/codegen/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/codegen/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/codegen/test/BUCK b/codegen/test/BUCK index 1e8cc179228..56dd9b231dc 100644 --- a/codegen/test/BUCK +++ b/codegen/test/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") + + +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/codegen/test/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 xplat-only targets. load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +fbcode_target(_kind = 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/codegen/tools/BUCK b/codegen/tools/BUCK index 1e8cc179228..85546a21e03 100644 --- a/codegen/tools/BUCK +++ b/codegen/tools/BUCK @@ -1,8 +1,16 @@ +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/codegen/tools/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,is_fbcode = True) 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/configurations/BUCK b/configurations/BUCK index 1e8cc179228..a54b37a4147 100644 --- a/configurations/BUCK +++ b/configurations/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/configurations/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/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/devtools/TARGETS b/devtools/BUCK similarity index 68% rename from devtools/TARGETS rename to devtools/BUCK index 2236702fbc7..bc1ff53e271 100644 --- a/devtools/TARGETS +++ b/devtools/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 = "lib", srcs = ["__init__.py"], deps = [ diff --git a/devtools/backend_debug/TARGETS b/devtools/backend_debug/BUCK similarity index 76% rename from devtools/backend_debug/TARGETS rename to devtools/backend_debug/BUCK index 00fde3ee3b4..e1b4d77d2c7 100644 --- a/devtools/backend_debug/TARGETS +++ b/devtools/backend_debug/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 = "delegation_info", srcs = [ "__init__.py", diff --git a/devtools/backend_debug/tests/TARGETS b/devtools/backend_debug/tests/BUCK similarity index 76% rename from devtools/backend_debug/tests/TARGETS rename to devtools/backend_debug/tests/BUCK index ae234df8ce4..4e02fff7471 100644 --- a/devtools/backend_debug/tests/TARGETS +++ b/devtools/backend_debug/tests/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_delegation_info", srcs = [ "test_delegation_info.py", diff --git a/devtools/bundled_program/BUCK b/devtools/bundled_program/BUCK index 0a42614a385..ec6a05df0f2 100644 --- a/devtools/bundled_program/BUCK +++ b/devtools/bundled_program/BUCK @@ -1,5 +1,52 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load(":targets.bzl", "define_common_targets") oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/devtools/bundled_program/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 = "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", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "config", + srcs = [ + "config.py", + ], + visibility = ["PUBLIC"], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + "//caffe2:torch", + ], +) + +fbcode_target(_kind = 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..84ac296c4e5 100644 --- a/devtools/bundled_program/schema/BUCK +++ b/devtools/bundled_program/schema/BUCK @@ -1,8 +1,35 @@ +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/devtools/bundled_program/schema/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("@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 = "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", - ], -)