diff --git a/backends/aoti/slim/factory/test/BUCK b/backends/aoti/slim/factory/test/BUCK new file mode 100644 index 00000000000..f559a6f1cfe --- /dev/null +++ b/backends/aoti/slim/factory/test/BUCK @@ -0,0 +1,9 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. + +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets(is_fbcode = is_fbcode()) diff --git a/backends/aoti/slim/factory/test/TARGETS b/backends/aoti/slim/factory/test/TARGETS deleted file mode 100644 index 77871de4469..00000000000 --- a/backends/aoti/slim/factory/test/TARGETS +++ /dev/null @@ -1,3 +0,0 @@ -load("targets.bzl", "define_common_targets") - -define_common_targets() diff --git a/backends/aoti/slim/factory/test/targets.bzl b/backends/aoti/slim/factory/test/targets.bzl index 7c0e218d233..2255e76a894 100644 --- a/backends/aoti/slim/factory/test/targets.bzl +++ b/backends/aoti/slim/factory/test/targets.bzl @@ -5,8 +5,15 @@ def get_backend_mode(): """Get the supported backend mode of slimtensor.""" return ["cuda", "cpu"] -def define_common_targets(): - """Define test targets for SlimTensor factory module.""" +def define_common_targets(is_fbcode = False): + """Define test targets for SlimTensor factory module. + + Uses fbcode-only kwargs (keep_gpu_sections, re_test_utils.remote_execution) + so we early-return outside fbcode to preserve pre-migration behavior + (this dir was originally TARGETS-only, never evaluated by xplat). + """ + if not is_fbcode: + return # GPU empty test with CUDA support for backend_mode in get_backend_mode(): diff --git a/backends/aoti/tests/BUCK b/backends/aoti/tests/BUCK new file mode 100644 index 00000000000..f559a6f1cfe --- /dev/null +++ b/backends/aoti/tests/BUCK @@ -0,0 +1,9 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. + +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets(is_fbcode = is_fbcode()) diff --git a/backends/aoti/tests/TARGETS b/backends/aoti/tests/TARGETS deleted file mode 100644 index f41c1bfb517..00000000000 --- a/backends/aoti/tests/TARGETS +++ /dev/null @@ -1,59 +0,0 @@ -load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") -load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") - -oncall("executorch") - -cpp_unittest( - name = "test_resolve_blob_keys", - srcs = [ - "test_resolve_blob_keys.cpp", - ], - deps = [ - "//executorch/backends/aoti:delegate_handle", - "//executorch/runtime/core:core", - "//executorch/runtime/core:evalue", - ], -) - -cpp_unittest( - name = "test_common_shims", - srcs = [ - "test_common_shims.cpp", - ], - headers = [ - "utils.h", - ], - deps = [ - "//executorch/backends/aoti:common_shims", - "//executorch/extension/tensor:tensor", - "//executorch/runtime/core:core", - "//executorch/runtime/platform:platform", - "//executorch/runtime/core/exec_aten/testing_util:tensor_util", - "//executorch/runtime/core/exec_aten:lib", - "//executorch/extension/tensor:tensor", - ], -) - -cpp_unittest( - name = "test_common_shims_slim", - srcs = [ - "test_common_shims_slim.cpp", - ], - deps = [ - "//executorch/backends/aoti:common_shims_slim", - "//executorch/backends/aoti/slim/core:slimtensor", - "//executorch/backends/aoti/slim/factory:empty", - "//executorch/runtime/core:core", - "//executorch/runtime/platform:platform", - ], - external_deps = [ - ("cuda", None, "cuda-lazy"), - ], - preprocessor_flags = [ - "-DCUDA_AVAILABLE=1", - ], - keep_gpu_sections = True, - remote_execution = re_test_utils.remote_execution( - platform = "gpu-remote-execution", - ), -) diff --git a/backends/aoti/tests/targets.bzl b/backends/aoti/tests/targets.bzl new file mode 100644 index 00000000000..59bec93cfca --- /dev/null +++ b/backends/aoti/tests/targets.bzl @@ -0,0 +1,61 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") +load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") + +def define_common_targets(is_fbcode = False): + if not is_fbcode: + return + + cpp_unittest( + name = "test_resolve_blob_keys", + srcs = [ + "test_resolve_blob_keys.cpp", + ], + deps = [ + "//executorch/backends/aoti:delegate_handle", + "//executorch/runtime/core:core", + "//executorch/runtime/core:evalue", + ], + ) + + cpp_unittest( + name = "test_common_shims", + srcs = [ + "test_common_shims.cpp", + ], + headers = [ + "utils.h", + ], + deps = [ + "//executorch/backends/aoti:common_shims", + "//executorch/extension/tensor:tensor", + "//executorch/runtime/core:core", + "//executorch/runtime/platform:platform", + "//executorch/runtime/core/exec_aten/testing_util:tensor_util", + "//executorch/runtime/core/exec_aten:lib", + "//executorch/extension/tensor:tensor", + ], + ) + + cpp_unittest( + name = "test_common_shims_slim", + srcs = [ + "test_common_shims_slim.cpp", + ], + deps = [ + "//executorch/backends/aoti:common_shims_slim", + "//executorch/backends/aoti/slim/core:slimtensor", + "//executorch/backends/aoti/slim/factory:empty", + "//executorch/runtime/core:core", + "//executorch/runtime/platform:platform", + ], + external_deps = [ + ("cuda", None, "cuda-lazy"), + ], + preprocessor_flags = [ + "-DCUDA_AVAILABLE=1", + ], + keep_gpu_sections = True, + remote_execution = re_test_utils.remote_execution( + platform = "gpu-remote-execution", + ), + ) diff --git a/backends/cuda/runtime/BUCK b/backends/cuda/runtime/BUCK new file mode 100644 index 00000000000..f559a6f1cfe --- /dev/null +++ b/backends/cuda/runtime/BUCK @@ -0,0 +1,9 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. + +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets(is_fbcode = is_fbcode()) diff --git a/backends/cuda/runtime/TARGETS b/backends/cuda/runtime/TARGETS deleted file mode 100644 index 122560e98ec..00000000000 --- a/backends/cuda/runtime/TARGETS +++ /dev/null @@ -1,183 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") -load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") -load("//tools/build/buck:nvcc_flags.bzl", "get_nvcc_arch_args") - -oncall("executorch") - -runtime.cxx_library( - name = "cuda_platform", - srcs = [ - "platform/platform.cpp", - ], - headers = [ - "platform/platform.h", - ], - # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) - link_whole = True, - supports_python_dlopen = True, - visibility = ["PUBLIC"], - deps = [ - "//executorch/runtime/core:core", - ], - nvcc_flags = get_nvcc_arch_args() + [ - "-_NVCC_HOST_COMPILER_FLAG_", - "gcc", - ], - external_deps = [ - ("cuda", None, "cuda-lazy"), - ], -) - -runtime.cxx_library( - name = "runtime_shims", - srcs = [ - "shims/cuda_guard.cpp", - "shims/int4mm.cu", - "shims/memory.cpp", - "shims/rand.cu", - "shims/sort.cu", - "shims/tensor_attribute.cpp", - ], - headers = [ - "shims/cuda_guard.h", - "shims/int4mm.cuh", - "shims/int4mm.h", - "shims/memory.h", - "shims/rand.h", - "shims/sort.h", - "shims/tensor_attribute.h", - "utils.h", - ], - # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) - link_whole = True, - supports_python_dlopen = True, - # Constructor needed for backend registration. - compiler_flags = ["-Wno-global-constructors"], - preprocessor_flags = ["-DCUDA_AVAILABLE=1"], - visibility = ["PUBLIC"], - deps = [ - "//executorch/backends/aoti:aoti_common_slim", - "//executorch/backends/aoti/slim/core:slimtensor", - "//executorch/backends/aoti/slim/factory:empty", - "//executorch/backends/aoti/slim/factory:from_blob", - "//executorch/backends/aoti/slim/cuda:guard", - "//executorch/runtime/core:core", - "//executorch/runtime/core/exec_aten:lib", - "//executorch/runtime/core/exec_aten/util:tensor_util", - "//executorch/runtime/platform:platform", - ], - nvcc_flags = get_nvcc_arch_args() + [ - "-_NVCC_HOST_COMPILER_FLAG_", - "gcc", - ], - external_deps = [ - ("cuda", None, "cuda-lazy"), - ], -) - -runtime.cxx_library( - name = "cuda_allocator", - srcs = [ - "cuda_allocator.cpp", - ], - headers = [ - "cuda_allocator.h", - ], - # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) - link_whole = True, - supports_python_dlopen = True, - visibility = ["PUBLIC"], - exported_deps = [ - "//executorch/runtime/core:device_allocator", - ], - deps = [ - "//executorch/extension/cuda:caller_stream", - "//executorch/runtime/platform:platform", - ], - nvcc_flags = get_nvcc_arch_args() + [ - "-_NVCC_HOST_COMPILER_FLAG_", - "gcc", - ], - external_deps = [ - ("cuda", None, "cuda-lazy"), - ], -) - -runtime.cxx_library( - name = "cuda_backend", - srcs = [ - "cuda_backend.cpp", - "cuda_mutable_state.cpp", - ], - headers = [ - "cuda_delegate_handle.h", - "cuda_mutable_state.h", - ], - # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) - link_whole = True, - supports_python_dlopen = True, - # Constructor needed for backend registration. - compiler_flags = ["-Wno-global-constructors"], - preprocessor_flags = ["-DCUDA_AVAILABLE=1"], - visibility = ["PUBLIC"], - deps = [ - ":cuda_platform", - ":runtime_shims", - ":cuda_allocator", - ":cuda_platform", - "//executorch/backends/aoti:aoti_common_slim", - "//executorch/backends/aoti/slim/core:slimtensor", - "//executorch/backends/aoti/slim/factory:empty", - "//executorch/backends/aoti/slim/factory:from_blob", - "//executorch/backends/aoti/slim/factory:from_etensor", - "//executorch/extension/cuda:caller_stream", - "//executorch/extension/tensor:tensor", - "//executorch/runtime/backend:interface", - "//executorch/runtime/core/exec_aten/util:tensor_util", - ], - external_deps = [ - ("cuda", None, "cuda-lazy"), - ], -) - -cpp_unittest( - name = "test_cuda_mutable_state", - srcs = [ - "test/test_cuda_mutable_state.cpp", - ], - deps = [ - ":cuda_backend", - "//executorch/backends/aoti:aoti_common_slim", - "//executorch/backends/aoti/slim/core:slimtensor", - "//executorch/backends/aoti/slim/factory:from_blob", - "//executorch/runtime/core:core", - "//executorch/runtime/core:evalue", - "//executorch/runtime/platform:platform", - ], - external_deps = [ - ("cuda", None, "cuda-lazy"), - ], - preprocessor_flags = ["-DCUDA_AVAILABLE=1"], - keep_gpu_sections = True, - remote_execution = re_test_utils.remote_execution( - platform = "gpu-remote-execution", - ), -) - -cpp_unittest( - name = "test_cuda_allocator", - srcs = ["test/test_cuda_allocator.cpp"], - deps = [ - ":cuda_allocator", - "//executorch/extension/cuda:caller_stream", - "//executorch/runtime/core:core", - "//executorch/runtime/platform:platform", - ], - external_deps = [("cuda", None, "cuda-lazy")], - preprocessor_flags = ["-DCUDA_AVAILABLE=1"], - keep_gpu_sections = True, - remote_execution = re_test_utils.remote_execution( - platform = "gpu-remote-execution", - ), -) diff --git a/backends/cuda/runtime/targets.bzl b/backends/cuda/runtime/targets.bzl new file mode 100644 index 00000000000..85b16c314b6 --- /dev/null +++ b/backends/cuda/runtime/targets.bzl @@ -0,0 +1,185 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") +load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") +load("@fbcode//tools/build/buck:nvcc_flags.bzl", "get_nvcc_arch_args") + +def define_common_targets(is_fbcode = False): + if not is_fbcode: + return + + runtime.cxx_library( + name = "cuda_platform", + srcs = [ + "platform/platform.cpp", + ], + headers = [ + "platform/platform.h", + ], + # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) + link_whole = True, + supports_python_dlopen = True, + visibility = ["PUBLIC"], + deps = [ + "//executorch/runtime/core:core", + ], + nvcc_flags = get_nvcc_arch_args() + [ + "-_NVCC_HOST_COMPILER_FLAG_", + "gcc", + ], + external_deps = [ + ("cuda", None, "cuda-lazy"), + ], + ) + + runtime.cxx_library( + name = "runtime_shims", + srcs = [ + "shims/cuda_guard.cpp", + "shims/int4mm.cu", + "shims/memory.cpp", + "shims/rand.cu", + "shims/sort.cu", + "shims/tensor_attribute.cpp", + ], + headers = [ + "shims/cuda_guard.h", + "shims/int4mm.cuh", + "shims/int4mm.h", + "shims/memory.h", + "shims/rand.h", + "shims/sort.h", + "shims/tensor_attribute.h", + "utils.h", + ], + # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) + link_whole = True, + supports_python_dlopen = True, + # Constructor needed for backend registration. + compiler_flags = ["-Wno-global-constructors"], + preprocessor_flags = ["-DCUDA_AVAILABLE=1"], + visibility = ["PUBLIC"], + deps = [ + "//executorch/backends/aoti:aoti_common_slim", + "//executorch/backends/aoti/slim/core:slimtensor", + "//executorch/backends/aoti/slim/factory:empty", + "//executorch/backends/aoti/slim/factory:from_blob", + "//executorch/backends/aoti/slim/cuda:guard", + "//executorch/runtime/core:core", + "//executorch/runtime/core/exec_aten:lib", + "//executorch/runtime/core/exec_aten/util:tensor_util", + "//executorch/runtime/platform:platform", + ], + nvcc_flags = get_nvcc_arch_args() + [ + "-_NVCC_HOST_COMPILER_FLAG_", + "gcc", + ], + external_deps = [ + ("cuda", None, "cuda-lazy"), + ], + ) + + runtime.cxx_library( + name = "cuda_allocator", + srcs = [ + "cuda_allocator.cpp", + ], + headers = [ + "cuda_allocator.h", + ], + # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) + link_whole = True, + supports_python_dlopen = True, + visibility = ["PUBLIC"], + exported_deps = [ + "//executorch/runtime/core:device_allocator", + ], + deps = [ + "//executorch/extension/cuda:caller_stream", + "//executorch/runtime/platform:platform", + ], + nvcc_flags = get_nvcc_arch_args() + [ + "-_NVCC_HOST_COMPILER_FLAG_", + "gcc", + ], + external_deps = [ + ("cuda", None, "cuda-lazy"), + ], + ) + + runtime.cxx_library( + name = "cuda_backend", + srcs = [ + "cuda_backend.cpp", + "cuda_mutable_state.cpp", + ], + headers = [ + "cuda_delegate_handle.h", + "cuda_mutable_state.h", + ], + # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) + link_whole = True, + supports_python_dlopen = True, + # Constructor needed for backend registration. + compiler_flags = ["-Wno-global-constructors"], + preprocessor_flags = ["-DCUDA_AVAILABLE=1"], + visibility = ["PUBLIC"], + deps = [ + ":cuda_platform", + ":runtime_shims", + ":cuda_allocator", + ":cuda_platform", + "//executorch/backends/aoti:aoti_common_slim", + "//executorch/backends/aoti/slim/core:slimtensor", + "//executorch/backends/aoti/slim/factory:empty", + "//executorch/backends/aoti/slim/factory:from_blob", + "//executorch/backends/aoti/slim/factory:from_etensor", + "//executorch/extension/cuda:caller_stream", + "//executorch/extension/tensor:tensor", + "//executorch/runtime/backend:interface", + "//executorch/runtime/core/exec_aten/util:tensor_util", + ], + external_deps = [ + ("cuda", None, "cuda-lazy"), + ], + ) + + cpp_unittest( + name = "test_cuda_mutable_state", + srcs = [ + "test/test_cuda_mutable_state.cpp", + ], + deps = [ + ":cuda_backend", + "//executorch/backends/aoti:aoti_common_slim", + "//executorch/backends/aoti/slim/core:slimtensor", + "//executorch/backends/aoti/slim/factory:from_blob", + "//executorch/runtime/core:core", + "//executorch/runtime/core:evalue", + "//executorch/runtime/platform:platform", + ], + external_deps = [ + ("cuda", None, "cuda-lazy"), + ], + preprocessor_flags = ["-DCUDA_AVAILABLE=1"], + keep_gpu_sections = True, + remote_execution = re_test_utils.remote_execution( + platform = "gpu-remote-execution", + ), + ) + + cpp_unittest( + name = "test_cuda_allocator", + srcs = ["test/test_cuda_allocator.cpp"], + deps = [ + ":cuda_allocator", + "//executorch/extension/cuda:caller_stream", + "//executorch/runtime/core:core", + "//executorch/runtime/platform:platform", + ], + external_deps = [("cuda", None, "cuda-lazy")], + preprocessor_flags = ["-DCUDA_AVAILABLE=1"], + keep_gpu_sections = True, + remote_execution = re_test_utils.remote_execution( + platform = "gpu-remote-execution", + ), + ) diff --git a/backends/cuda/tests/BUCK b/backends/cuda/tests/BUCK new file mode 100644 index 00000000000..f559a6f1cfe --- /dev/null +++ b/backends/cuda/tests/BUCK @@ -0,0 +1,9 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. + +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets(is_fbcode = is_fbcode()) diff --git a/backends/cuda/tests/TARGETS b/backends/cuda/tests/TARGETS deleted file mode 100644 index 6d7ab3f9645..00000000000 --- a/backends/cuda/tests/TARGETS +++ /dev/null @@ -1,47 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") -load("@fbcode_macros//build_defs:python_unittest_remote_gpu.bzl", "python_unittest_remote_gpu") -load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") - -oncall("executorch") - -python_unittest_remote_gpu( - name = "test_cuda_export", - srcs = [ - "test_cuda_export.py", - ], - visibility = [ - "//executorch/...", - ], - deps = [ - "//caffe2:torch", - "//executorch/backends/cuda:cuda_backend", - "//executorch/backends/cuda:cuda_partitioner", - "//executorch/exir:lib", - "//executorch/exir/backend:backend_api", - "//executorch/exir/backend:compile_spec_schema", - "//executorch/examples/models/toy_model:toy_model", - ], - keep_gpu_sections = True, - remote_execution = re_test_utils.remote_execution( - platform = "gpu-remote-execution", - subplatform = "A100-exclusive", - ), -) - -python_unittest( - name = "test_cuda_partitioner", - srcs = [ - "test_cuda_partitioner.py", - ], - visibility = [ - "//executorch/...", - ], - deps = [ - "//caffe2:torch", - "//executorch/backends/cuda:cuda_partitioner", - "//executorch/backends/cuda:cuda_backend", - "//executorch/exir:lib", - "//executorch/exir/backend:compile_spec_schema", - ], -) diff --git a/backends/cuda/tests/targets.bzl b/backends/cuda/tests/targets.bzl new file mode 100644 index 00000000000..c1306595475 --- /dev/null +++ b/backends/cuda/tests/targets.bzl @@ -0,0 +1,49 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load("@fbcode_macros//build_defs:python_unittest_remote_gpu.bzl", "python_unittest_remote_gpu") +load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils") + +def define_common_targets(is_fbcode = False): + if not is_fbcode: + return + + python_unittest_remote_gpu( + name = "test_cuda_export", + srcs = [ + "test_cuda_export.py", + ], + visibility = [ + "//executorch/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/cuda:cuda_backend", + "//executorch/backends/cuda:cuda_partitioner", + "//executorch/exir:lib", + "//executorch/exir/backend:backend_api", + "//executorch/exir/backend:compile_spec_schema", + "//executorch/examples/models/toy_model:toy_model", + ], + keep_gpu_sections = True, + remote_execution = re_test_utils.remote_execution( + platform = "gpu-remote-execution", + subplatform = "A100-exclusive", + ), + ) + + python_unittest( + name = "test_cuda_partitioner", + srcs = [ + "test_cuda_partitioner.py", + ], + visibility = [ + "//executorch/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/cuda:cuda_partitioner", + "//executorch/backends/cuda:cuda_backend", + "//executorch/exir:lib", + "//executorch/exir/backend:compile_spec_schema", + ], + ) diff --git a/examples/models/BUCK b/examples/models/BUCK index ed72a16e05f..b282b6f7a51 100644 --- a/examples/models/BUCK +++ b/examples/models/BUCK @@ -34,8 +34,6 @@ fbcode_target(_kind = python_library, "//executorch/examples/models/smollm2:smollm2", # @manual "//executorch/examples/models/smollm3:smollm3", # @manual "//executorch/examples/models/smolvlm:smolvlm", # @manual - "//executorch/examples/models/whisper:whisper", # @manual - "//executorch/examples/models/yolo26:yolo26", # @manual ], ) diff --git a/extension/pytree/test/BUCK b/extension/pytree/test/BUCK new file mode 100644 index 00000000000..f559a6f1cfe --- /dev/null +++ b/extension/pytree/test/BUCK @@ -0,0 +1,9 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. + +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets(is_fbcode = is_fbcode()) diff --git a/extension/pytree/test/TARGETS b/extension/pytree/test/TARGETS deleted file mode 100644 index e49e8cd2791..00000000000 --- a/extension/pytree/test/TARGETS +++ /dev/null @@ -1,23 +0,0 @@ -# @noautodeps -load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") - -oncall("executorch") - -cpp_unittest( - name = "pytree_test", - srcs = ["test_pytree.cpp"], - deps = ["//executorch/extension/pytree:pytree"], -) - -python_unittest( - name = "pybindings_test", - srcs = [ - "test.py", - ], - deps = [ - "//caffe2:torch", - "//executorch/extension/pytree:pybindings", - "//executorch/extension/pytree:pylib", - ], -) diff --git a/extension/pytree/test/targets.bzl b/extension/pytree/test/targets.bzl new file mode 100644 index 00000000000..c4cbe811e5a --- /dev/null +++ b/extension/pytree/test/targets.bzl @@ -0,0 +1,27 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +def define_common_targets(is_fbcode = False): + if not is_fbcode: + return + + # @noautodeps + + + cpp_unittest( + name = "pytree_test", + srcs = ["test_pytree.cpp"], + deps = ["//executorch/extension/pytree:pytree"], + ) + + python_unittest( + name = "pybindings_test", + srcs = [ + "test.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/extension/pytree:pybindings", + "//executorch/extension/pytree:pylib", + ], + )