From dceb75ea57e06e1f20d4e4139c6fd6bc33867a25 Mon Sep 17 00:00:00 2001 From: TARGETS Exterminator Date: Thu, 29 Jan 2026 20:25:05 -0800 Subject: [PATCH] Rename build files from TARGETS to BUCK (group ID: -8592229998765765034) (#17055) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/17055 Reviewed By: bigfootjon Differential Revision: D91838004 --- .../spinquant/third-party/FFHT/BUCK | 12 +- .../spinquant/third-party/FFHT/TARGETS | 5 - extension/llm/export/BUCK | 103 +++++++++++++++++- extension/llm/export/TARGETS | 96 ---------------- extension/llm/export/config/BUCK | 6 + extension/llm/export/config/TARGETS | 5 - extension/llm/export/test/{TARGETS => BUCK} | 3 +- 7 files changed, 119 insertions(+), 111 deletions(-) delete mode 100644 extension/llm/custom_ops/spinquant/third-party/FFHT/TARGETS delete mode 100644 extension/llm/export/TARGETS create mode 100644 extension/llm/export/config/BUCK delete mode 100644 extension/llm/export/config/TARGETS rename extension/llm/export/test/{TARGETS => BUCK} (76%) diff --git a/extension/llm/custom_ops/spinquant/third-party/FFHT/BUCK b/extension/llm/custom_ops/spinquant/third-party/FFHT/BUCK index 1e8cc179228..86f97f163e7 100644 --- a/extension/llm/custom_ops/spinquant/third-party/FFHT/BUCK +++ b/extension/llm/custom_ops/spinquant/third-party/FFHT/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/extension/llm/custom_ops/spinquant/third-party/FFHT/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/extension/llm/custom_ops/spinquant/third-party/FFHT/TARGETS b/extension/llm/custom_ops/spinquant/third-party/FFHT/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/extension/llm/custom_ops/spinquant/third-party/FFHT/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() diff --git a/extension/llm/export/BUCK b/extension/llm/export/BUCK index 1e8cc179228..1cbeb0d41e5 100644 --- a/extension/llm/export/BUCK +++ b/extension/llm/export/BUCK @@ -1,8 +1,107 @@ +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/extension/llm/export/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 = "export_lib", + srcs = [ + "builder.py", + "export_passes.py", + "partitioner_lib.py", + "quantizer_lib.py", + ], + _is_external_target = True, + base_module = "executorch.extension.llm.export", + visibility = [ + "//bento/...", + "//bento_kernels/...", + "//executorch/examples/...", + "//executorch/extension/llm/...", + "//meta_intern_odllm/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/apple/coreml:backend", + "//executorch/backends/apple/coreml:partitioner", + "//executorch/backends/apple/mps:partitioner", + "//executorch/backends/qualcomm/partition:partition", + "//executorch/backends/qualcomm/quantizer:quantizer", + "//executorch/backends/transforms:duplicate_dynamic_quant_chain", + "//executorch/backends/vulkan/partitioner:vulkan_partitioner", + "//executorch/backends/vulkan/quantizer:vulkan_quantizer", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", + "//executorch/exir:delegate", + "//executorch/exir:lib", + "//executorch/exir/backend:backend_details", + "//executorch/extension/export_util:export_util", + "//executorch/extension/llm/custom_ops:custom_ops_aot_lib", + "//executorch/extension/llm/custom_ops:custom_ops_aot_py", + "//pytorch/tokenizers/pytorch_tokenizers:tokenizers", + ], +) + +fbcode_target(_kind = runtime.python_binary, + name = "export_llm", + srcs = [ + "export_llm.py", + ], + main_function = "executorch.extension.llm.export.export_llm.main", + preload_deps = [ + "//executorch/extension/llm/custom_ops:model_sharding_py", + "//executorch/extension/llm/custom_ops:custom_ops_aot_lib", + "//executorch/kernels/quantized:aot_lib", + ], + deps = [ + "fbsource//third-party/pypi/hydra-core:hydra-core", + "fbsource//third-party/pypi/omegaconf:omegaconf", + "//executorch/examples/models/llama:export_library", + "//executorch/extension/pybindings:aten_lib", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "export_llm_lib", + srcs = [ + "export_llm.py", + ], + deps = [ + "fbsource//third-party/pypi/hydra-core:hydra-core", + "fbsource//third-party/pypi/omegaconf:omegaconf", + "//executorch/examples/models/llama:export_library", + ], + visibility = [ + "//executorch/examples/...", + "//executorch/extension/llm/...", + ], +) + +fbcode_target(_kind = runtime.python_test, + name = "export_passes_test", + srcs = [ + "test_export_passes.py", + ], + preload_deps = [ + "//executorch/extension/llm/custom_ops:custom_ops_aot_lib", + ], + deps = [ + ":export_lib", + ], +) diff --git a/extension/llm/export/TARGETS b/extension/llm/export/TARGETS deleted file mode 100644 index 7acf026a8da..00000000000 --- a/extension/llm/export/TARGETS +++ /dev/null @@ -1,96 +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 = "export_lib", - srcs = [ - "builder.py", - "export_passes.py", - "partitioner_lib.py", - "quantizer_lib.py", - ], - _is_external_target = True, - base_module = "executorch.extension.llm.export", - visibility = [ - "//bento/...", - "//bento_kernels/...", - "//executorch/examples/...", - "//executorch/extension/llm/...", - "//meta_intern_odllm/...", - ], - deps = [ - "//caffe2:torch", - "//executorch/backends/apple/coreml:backend", - "//executorch/backends/apple/coreml:partitioner", - "//executorch/backends/apple/mps:partitioner", - "//executorch/backends/qualcomm/partition:partition", - "//executorch/backends/qualcomm/quantizer:quantizer", - "//executorch/backends/transforms:duplicate_dynamic_quant_chain", - "//executorch/backends/vulkan/partitioner:vulkan_partitioner", - "//executorch/backends/vulkan/quantizer:vulkan_quantizer", - "//executorch/backends/xnnpack/partition:xnnpack_partitioner", - "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", - "//executorch/exir:delegate", - "//executorch/exir:lib", - "//executorch/exir/backend:backend_details", - "//executorch/extension/export_util:export_util", - "//executorch/extension/llm/custom_ops:custom_ops_aot_lib", - "//executorch/extension/llm/custom_ops:custom_ops_aot_py", - "//pytorch/tokenizers/pytorch_tokenizers:tokenizers", - ], -) - -runtime.python_binary( - name = "export_llm", - srcs = [ - "export_llm.py", - ], - main_function = "executorch.extension.llm.export.export_llm.main", - preload_deps = [ - "//executorch/extension/llm/custom_ops:model_sharding_py", - "//executorch/extension/llm/custom_ops:custom_ops_aot_lib", - "//executorch/kernels/quantized:aot_lib", - ], - deps = [ - "fbsource//third-party/pypi/hydra-core:hydra-core", - "fbsource//third-party/pypi/omegaconf:omegaconf", - "//executorch/examples/models/llama:export_library", - "//executorch/extension/pybindings:aten_lib", - ], -) - -runtime.python_library( - name = "export_llm_lib", - srcs = [ - "export_llm.py", - ], - deps = [ - "fbsource//third-party/pypi/hydra-core:hydra-core", - "fbsource//third-party/pypi/omegaconf:omegaconf", - "//executorch/examples/models/llama:export_library", - ], - visibility = [ - "//executorch/examples/...", - "//executorch/extension/llm/...", - ], -) - -runtime.python_test( - name = "export_passes_test", - srcs = [ - "test_export_passes.py", - ], - preload_deps = [ - "//executorch/extension/llm/custom_ops:custom_ops_aot_lib", - ], - deps = [ - ":export_lib", - ], -) diff --git a/extension/llm/export/config/BUCK b/extension/llm/export/config/BUCK new file mode 100644 index 00000000000..f5029903c21 --- /dev/null +++ b/extension/llm/export/config/BUCK @@ -0,0 +1,6 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +fbcode_target(_kind = define_common_targets,) diff --git a/extension/llm/export/config/TARGETS b/extension/llm/export/config/TARGETS deleted file mode 100644 index bf8d13dcf37..00000000000 --- a/extension/llm/export/config/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() \ No newline at end of file diff --git a/extension/llm/export/test/TARGETS b/extension/llm/export/test/BUCK similarity index 76% rename from extension/llm/export/test/TARGETS rename to extension/llm/export/test/BUCK index 63efce84119..5537a8c5f29 100644 --- a/extension/llm/export/test/TARGETS +++ b/extension/llm/export/test/BUCK @@ -1,3 +1,4 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # @@ -8,7 +9,7 @@ load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_test( +fbcode_target(_kind = runtime.python_test, name = "test_builder", srcs = ["test_builder.py"], deps = [