From ac3f9672df3821b2292e993442eb9c22fd4b2d44 Mon Sep 17 00:00:00 2001 From: "fbsource/fbsource_targets_to_buck.json Bot" Date: Fri, 30 Jan 2026 00:34:03 -0800 Subject: [PATCH] Rename build files from TARGETS to BUCK (group ID: 3296782885624562797) (#17054) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/17054 Reviewed By: bigfootjon Differential Revision: D91839137 --- backends/cortex_m/quantizer/{TARGETS => BUCK} | 5 +-- backends/cortex_m/test/BUCK | 32 +++++++++++++++++-- backends/cortex_m/test/TARGETS | 25 --------------- backends/cuda/{TARGETS => BUCK} | 11 ++++--- backends/cuda/runtime/{TARGETS => BUCK} | 15 +++++---- 5 files changed, 47 insertions(+), 41 deletions(-) rename backends/cortex_m/quantizer/{TARGETS => BUCK} (82%) delete mode 100644 backends/cortex_m/test/TARGETS rename backends/cuda/{TARGETS => BUCK} (83%) rename backends/cuda/runtime/{TARGETS => BUCK} (90%) diff --git a/backends/cortex_m/quantizer/TARGETS b/backends/cortex_m/quantizer/BUCK similarity index 82% rename from backends/cortex_m/quantizer/TARGETS rename to backends/cortex_m/quantizer/BUCK index 0af105efef0..45962e65ee5 100644 --- a/backends/cortex_m/quantizer/TARGETS +++ b/backends/cortex_m/quantizer/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("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -python_library( +fbcode_target(_kind = python_library, name = "quantizer", srcs = [ "__init__.py", @@ -23,7 +24,7 @@ python_library( ], ) -python_library( +fbcode_target(_kind = python_library, name = "quantization_configs", srcs = [ "quantization_configs.py", diff --git a/backends/cortex_m/test/BUCK b/backends/cortex_m/test/BUCK index 5630c928299..a715de08a4b 100644 --- a/backends/cortex_m/test/BUCK +++ b/backends/cortex_m/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. # @@ -6,6 +8,32 @@ load("targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/backends/cortex_m/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. + +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load("targets.bzl", "define_common_targets") + +fbcode_target(_kind = python_unittest, + name="test_replace_quant_nodes", + srcs=[ + "test_helpers_passes_utils.py", + "test_replace_quant_nodes.py", + ], + deps=[ + "//pytorch/ao:torchao", # @manual + "//caffe2:torch", + "//executorch/backends/cortex_m/passes:replace_quant_nodes_pass", + "//executorch/backends/cortex_m/ops:ops", + ], +) + +fbcode_target(_kind = define_common_targets,) diff --git a/backends/cortex_m/test/TARGETS b/backends/cortex_m/test/TARGETS deleted file mode 100644 index 292a087a88a..00000000000 --- a/backends/cortex_m/test/TARGETS +++ /dev/null @@ -1,25 +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. - -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") -load("targets.bzl", "define_common_targets") - -oncall("executorch") -python_unittest( - name="test_replace_quant_nodes", - srcs=[ - "test_helpers_passes_utils.py", - "test_replace_quant_nodes.py", - ], - deps=[ - "//pytorch/ao:torchao", # @manual - "//caffe2:torch", - "//executorch/backends/cortex_m/passes:replace_quant_nodes_pass", - "//executorch/backends/cortex_m/ops:ops", - ], -) - -define_common_targets() diff --git a/backends/cuda/TARGETS b/backends/cuda/BUCK similarity index 83% rename from backends/cuda/TARGETS rename to backends/cuda/BUCK index 3892d5e1742..8afb90ed69c 100644 --- a/backends/cuda/TARGETS +++ b/backends/cuda/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 = "cuda_passes", srcs = [ "passes/__init__.py", @@ -16,7 +17,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "cuda_backend", srcs = [ "cuda_backend.py", @@ -36,7 +37,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "cuda_partitioner", srcs = [ "cuda_partitioner.py", @@ -50,7 +51,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "triton_kernels", srcs = [ "triton/kernels/__init__.py", @@ -64,7 +65,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "triton_replacement_pass", srcs = [ "triton/__init__.py", diff --git a/backends/cuda/runtime/TARGETS b/backends/cuda/runtime/BUCK similarity index 90% rename from backends/cuda/runtime/TARGETS rename to backends/cuda/runtime/BUCK index ad5baa8d83f..f13c953fcc2 100644 --- a/backends/cuda/runtime/TARGETS +++ b/backends/cuda/runtime/BUCK @@ -1,9 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load("//tools/build/buck:nvcc_flags.bzl", "get_nvcc_arch_args") +load("@fbcode//tools/build/buck:nvcc_flags.bzl", "get_nvcc_arch_args") oncall("executorch") -runtime.cxx_library( +fbcode_target(_kind = runtime.cxx_library, name = "guard", srcs = [ "guard.cpp", @@ -25,7 +26,7 @@ runtime.cxx_library( ], ) -runtime.cxx_library( +fbcode_target(_kind = runtime.cxx_library, name = "cuda_platform", srcs = [ "platform/platform.cpp", @@ -49,7 +50,7 @@ runtime.cxx_library( ], ) -runtime.cxx_library( +fbcode_target(_kind = runtime.cxx_library, name = "tensor_maker", srcs = [ "tensor/tensor_maker.cpp", @@ -68,7 +69,7 @@ runtime.cxx_library( ], ) -runtime.cxx_library( +fbcode_target(_kind = runtime.cxx_library, name = "runtime_shims", srcs = [ "guard.cpp", @@ -109,7 +110,7 @@ runtime.cxx_library( ], ) -runtime.cxx_library( +fbcode_target(_kind = runtime.cxx_library, name = "runtime_shims_slim", srcs = [ "shims/memory_slim.cpp", @@ -139,7 +140,7 @@ runtime.cxx_library( ], ) -runtime.cxx_library( +fbcode_target(_kind = runtime.cxx_library, name = "cuda_backend", srcs = [ "cuda_backend.cpp",