diff --git a/extension/llm/custom_ops/spinquant/test/BUCK b/extension/llm/custom_ops/spinquant/test/BUCK index 0a42614a385..685a5bd15ea 100644 --- a/extension/llm/custom_ops/spinquant/test/BUCK +++ b/extension/llm/custom_ops/spinquant/test/BUCK @@ -1,5 +1,13 @@ +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/extension/llm/custom_ops/spinquant/test/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/test/TARGETS b/extension/llm/custom_ops/spinquant/test/TARGETS deleted file mode 100644 index 0a42614a385..00000000000 --- a/extension/llm/custom_ops/spinquant/test/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() 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 = [ diff --git a/extension/llm/modules/TARGETS b/extension/llm/modules/BUCK similarity index 73% rename from extension/llm/modules/TARGETS rename to extension/llm/modules/BUCK index 72cb146ef31..ae9ae42d3c0 100644 --- a/extension/llm/modules/TARGETS +++ b/extension/llm/modules/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 = "kv_cache", srcs = [ "kv_cache.py", @@ -13,7 +14,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "attention", srcs = [ "attention.py", @@ -26,7 +27,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "position_embeddings", srcs = [ "_position_embeddings.py", @@ -36,7 +37,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "module_lib", srcs = [ "__init__.py", diff --git a/extension/llm/runner/BUCK b/extension/llm/runner/BUCK index 2341af9282f..c460fc8e77a 100644 --- a/extension/llm/runner/BUCK +++ b/extension/llm/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/extension/llm/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/extension/llm/runner/TARGETS b/extension/llm/runner/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/llm/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/extension/llm/runner/io_manager/BUCK b/extension/llm/runner/io_manager/BUCK index 2341af9282f..ba81c898113 100644 --- a/extension/llm/runner/io_manager/BUCK +++ b/extension/llm/runner/io_manager/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/extension/llm/runner/io_manager/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/extension/llm/runner/io_manager/TARGETS b/extension/llm/runner/io_manager/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/llm/runner/io_manager/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/llm/runner/io_manager/test/BUCK b/extension/llm/runner/io_manager/test/BUCK index 1e8cc179228..8b4ba7fe0fa 100644 --- a/extension/llm/runner/io_manager/test/BUCK +++ b/extension/llm/runner/io_manager/test/BUCK @@ -1,8 +1,34 @@ +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/runner/io_manager/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 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.cxx_test, + name = "test_io_manager", + srcs = [ + "test_io_manager.cpp", + ], + deps = [ + "//executorch/extension/llm/runner/io_manager:io_manager", + "//executorch/kernels/portable:generated_lib", + ], + env = { + "KVCACHE_CACHE_POS": "$(location fbcode//executorch/test/models:exported_programs[ModuleKVCacheCachePos.pte])", + } +) diff --git a/extension/llm/runner/io_manager/test/TARGETS b/extension/llm/runner/io_manager/test/TARGETS deleted file mode 100644 index e214060942a..00000000000 --- a/extension/llm/runner/io_manager/test/TARGETS +++ /dev/null @@ -1,23 +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_test( - name = "test_io_manager", - srcs = [ - "test_io_manager.cpp", - ], - deps = [ - "//executorch/extension/llm/runner/io_manager:io_manager", - "//executorch/kernels/portable:generated_lib", - ], - env = { - "KVCACHE_CACHE_POS": "$(location fbcode//executorch/test/models:exported_programs[ModuleKVCacheCachePos.pte])", - } -) diff --git a/extension/llm/runner/test/BUCK b/extension/llm/runner/test/BUCK index 97de7abe9b1..9ed85acadb7 100644 --- a/extension/llm/runner/test/BUCK +++ b/extension/llm/runner/test/BUCK @@ -1,3 +1,5 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # @@ -9,6 +11,37 @@ load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/llm/runner/test/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +# 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") + +fbcode_target(_kind = define_common_targets,) + +fbcode_target(_kind = runtime.cxx_test, + name = "test_text_decoder_runner", + srcs = ["test_text_decoder_runner.cpp"], + deps = [ + "//executorch/extension/llm/runner:runner_lib", + "//executorch/extension/llm/runner/io_manager:io_manager", + "//executorch/kernels/portable:generated_lib", + "//executorch/runtime/core/exec_aten/testing_util:tensor_util", + ], + env = { + "KVCACHE_CACHE_POS": "$(location fbcode//executorch/test/models:exported_programs[ModuleKVCacheCachePos.pte])", + "KVCACHE_INPUT_POS": "$(location fbcode//executorch/test/models:exported_programs[ModuleKVCacheInputPos.pte])", + "NO_KVCACHE": "$(location fbcode//executorch/test/models:exported_programs[ModuleNoKVCache.pte])", + } +) diff --git a/extension/llm/runner/test/TARGETS b/extension/llm/runner/test/TARGETS deleted file mode 100644 index 8f758d21ea9..00000000000 --- a/extension/llm/runner/test/TARGETS +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. - -# 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_test( - name = "test_text_decoder_runner", - srcs = ["test_text_decoder_runner.cpp"], - deps = [ - "//executorch/extension/llm/runner:runner_lib", - "//executorch/extension/llm/runner/io_manager:io_manager", - "//executorch/kernels/portable:generated_lib", - "//executorch/runtime/core/exec_aten/testing_util:tensor_util", - ], - env = { - "KVCACHE_CACHE_POS": "$(location fbcode//executorch/test/models:exported_programs[ModuleKVCacheCachePos.pte])", - "KVCACHE_INPUT_POS": "$(location fbcode//executorch/test/models:exported_programs[ModuleKVCacheInputPos.pte])", - "NO_KVCACHE": "$(location fbcode//executorch/test/models:exported_programs[ModuleNoKVCache.pte])", - } -) diff --git a/extension/llm/sampler/BUCK b/extension/llm/sampler/BUCK index 1e8cc179228..9e8abea353f 100644 --- a/extension/llm/sampler/BUCK +++ b/extension/llm/sampler/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/extension/llm/sampler/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/extension/llm/sampler/TARGETS b/extension/llm/sampler/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/llm/sampler/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/llm/sampler/test/BUCK b/extension/llm/sampler/test/BUCK index 1e8cc179228..163d8161700 100644 --- a/extension/llm/sampler/test/BUCK +++ b/extension/llm/sampler/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") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/llm/sampler/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 fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) diff --git a/extension/llm/sampler/test/TARGETS b/extension/llm/sampler/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/llm/sampler/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/memory_allocator/BUCK b/extension/memory_allocator/BUCK index 1e8cc179228..112d2f7c006 100644 --- a/extension/memory_allocator/BUCK +++ b/extension/memory_allocator/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/extension/memory_allocator/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/extension/memory_allocator/TARGETS b/extension/memory_allocator/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/memory_allocator/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/memory_allocator/test/BUCK b/extension/memory_allocator/test/BUCK index 1e8cc179228..f2fe37c9999 100644 --- a/extension/memory_allocator/test/BUCK +++ b/extension/memory_allocator/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") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/memory_allocator/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 fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) diff --git a/extension/memory_allocator/test/TARGETS b/extension/memory_allocator/test/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/memory_allocator/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/module/BUCK b/extension/module/BUCK index 1e8cc179228..7d7ebc67190 100644 --- a/extension/module/BUCK +++ b/extension/module/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/extension/module/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/extension/module/TARGETS b/extension/module/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/module/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/module/test/BUCK b/extension/module/test/BUCK index 1e8cc179228..fcdb37ac830 100644 --- a/extension/module/test/BUCK +++ b/extension/module/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") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/module/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 fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,is_fbcode = True) diff --git a/extension/module/test/TARGETS b/extension/module/test/TARGETS deleted file mode 100644 index a6c52d105f6..00000000000 --- a/extension/module/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(is_fbcode = True) diff --git a/extension/named_data_map/BUCK b/extension/named_data_map/BUCK index 1e8cc179228..97147166be7 100644 --- a/extension/named_data_map/BUCK +++ b/extension/named_data_map/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/extension/named_data_map/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/extension/named_data_map/TARGETS b/extension/named_data_map/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/named_data_map/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/named_data_map/test/BUCK b/extension/named_data_map/test/BUCK index 1e8cc179228..dbb01046a6f 100644 --- a/extension/named_data_map/test/BUCK +++ b/extension/named_data_map/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") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/named_data_map/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 fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,is_fbcode=True) diff --git a/extension/named_data_map/test/TARGETS b/extension/named_data_map/test/TARGETS deleted file mode 100644 index 883ab644309..00000000000 --- a/extension/named_data_map/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(is_fbcode=True) diff --git a/extension/parallel/BUCK b/extension/parallel/BUCK index 1e8cc179228..cd2f3a2e107 100644 --- a/extension/parallel/BUCK +++ b/extension/parallel/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/extension/parallel/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/extension/parallel/TARGETS b/extension/parallel/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/extension/parallel/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/pybindings/TARGETS b/extension/pybindings/BUCK similarity index 87% rename from extension/pybindings/TARGETS rename to extension/pybindings/BUCK index 18323a07bff..878626a1361 100644 --- a/extension/pybindings/TARGETS +++ b/extension/pybindings/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. @@ -8,7 +9,7 @@ oncall("executorch") # Export this so the internal fb/ subdir can create pybindings with custom internal deps # without forking the pybinding source. -runtime.export_file( +fbcode_target(_kind = runtime.export_file, name = "pybindings.cpp", visibility = ["//executorch/extension/pybindings/..."], ) @@ -16,7 +17,7 @@ runtime.export_file( # cxx_python_extension kwarg 'types' can't take export_file rules directly and we need to rename the .pyi # file to match the lib anyway, so we just expose the file like this and then have genrules consume and # rename it before passing it to executorch pybindings. -runtime.filegroup( +fbcode_target(_kind = runtime.filegroup, name = "pybinding_types", srcs = ["pybindings.pyi"], visibility = ["//executorch/extension/pybindings/..."], @@ -25,7 +26,7 @@ runtime.filegroup( # In order to have pyre recognize the pybindings module, the name of the .pyi must exactly match the # name of the lib. To avoid copy pasting the pyi file in tree a whole bunch of times we use genrules # to do it for us -runtime.genrule( +fbcode_target(_kind = runtime.genrule, name = "pybindings_types_gen", srcs = [":pybinding_types"], outs = { @@ -37,7 +38,7 @@ runtime.genrule( visibility = ["//executorch/extension/pybindings/..."], ) -executorch_pybindings( +fbcode_target(_kind = executorch_pybindings, compiler_flags = ["-std=c++17"], cppdeps = PORTABLE_MODULE_DEPS, python_module_name = "core", @@ -45,7 +46,7 @@ executorch_pybindings( visibility = ["PUBLIC"], ) -executorch_pybindings( +fbcode_target(_kind = executorch_pybindings, compiler_flags = ["-std=c++17"], cppdeps = PORTABLE_MODULE_DEPS + MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB, # Give this an underscore prefix because it has a pure python wrapper. @@ -54,7 +55,7 @@ executorch_pybindings( visibility = ["PUBLIC"], ) -executorch_pybindings( +fbcode_target(_kind = executorch_pybindings, compiler_flags = ["-std=c++17"], cppdeps = ATEN_MODULE_DEPS + MODELS_ATEN_OPS_ATEN_MODE_GENERATED_LIB, python_module_name = "aten_lib", @@ -62,7 +63,7 @@ executorch_pybindings( visibility = ["PUBLIC"], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "portable_lib", srcs = ["portable_lib.py"], visibility = ["PUBLIC"], 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..b3d0906dfa0 100644 --- a/extension/pybindings/test/TARGETS +++ b/extension/pybindings/test/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, # 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 +31,7 @@ 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 +41,7 @@ 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 +52,7 @@ runtime.python_test( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "test_pybindings_lib", srcs = ["test_pybindings.py"], deps = [ @@ -60,7 +61,7 @@ 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/extension/pytree/BUCK b/extension/pytree/BUCK index 1e8cc179228..a92ba8a76be 100644 --- a/extension/pytree/BUCK +++ b/extension/pytree/BUCK @@ -1,8 +1,60 @@ +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/pytree/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.cxx_python_extension, + name = "pybindings", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +fbcode_target(_kind = runtime.cxx_python_extension, + name = "pybindings_debug", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.extension.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +fbcode_target(_kind = 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", - ], -)