diff --git a/backends/vulkan/test/BUCK b/backends/vulkan/test/BUCK index 7a73d7bad65..50c68504088 100644 --- a/backends/vulkan/test/BUCK +++ b/backends/vulkan/test/BUCK @@ -1,7 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load(":compute_api_tests.bzl", "define_compute_api_test_targets") -fb_native.filegroup( +oncall("executorch") +non_fbcode_target(_kind = fb_native.filegroup, name = "test_shaders", srcs = glob([ "glsl/*", @@ -11,4 +13,96 @@ fb_native.filegroup( ], ) -define_compute_api_test_targets() +non_fbcode_target(_kind = define_compute_api_test_targets,) + +# !!!! fbcode/executorch/backends/vulkan/test/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + + +fbcode_target(_kind = python_unittest, + name = "test_vulkan_delegate", + srcs = [ + "test_vulkan_delegate.py", + ], + preload_deps = [ + "fbsource//third-party/swiftshader/lib/linux-x64:libvk_swiftshader_fbcode", + "//executorch/backends/vulkan:vulkan_backend_lib", + "//executorch/kernels/portable:custom_ops_generated_lib", + ], + deps = [ + ":test_utils", + "//caffe2:torch", + "//executorch/backends/transforms:convert_dtype_pass", + "//executorch/backends/vulkan:vulkan_preprocess", + "//executorch/backends/vulkan/partitioner:vulkan_partitioner", + "//executorch/exir:lib", + "//executorch/extension/pybindings:portable_lib", # @manual + "//executorch/extension/pytree:pylib", + "//executorch/kernels/portable:custom_ops_generated_lib", + ], +) + +fbcode_target(_kind = python_unittest, + name = "test_vulkan_passes", + srcs = [ + "test_vulkan_passes.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/vulkan/_passes:vulkan_passes", + "//executorch/backends/vulkan:vulkan_preprocess", + "//pytorch/ao:torchao", # @manual + ] +) + +fbcode_target(_kind = python_unittest, + name = "test_vulkan_delegate_header", + srcs = [ + "test_vulkan_delegate_header.py", + ], + deps = [ + "//executorch/backends/vulkan:vulkan_preprocess", + ], +) + +fbcode_target(_kind = python_unittest, + name = "test_serialization", + srcs = [ + "test_serialization.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/vulkan:vulkan_preprocess", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "tester", + srcs = ["tester.py"], + deps = [ + "//executorch/backends/vulkan/partitioner:vulkan_partitioner", + "//executorch/backends/vulkan:vulkan_preprocess", + ] +) + +fbcode_target(_kind = runtime.python_library, + name = "test_utils", + srcs = [ + "utils.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/vulkan:vulkan_preprocess", + "//executorch/backends/vulkan/partitioner:vulkan_partitioner", + "//executorch/backends/xnnpack:xnnpack_preprocess", + "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/devtools:lib", + "//executorch/devtools/bundled_program/serialize:lib", + "//executorch/exir:lib", + "//executorch/extension/pybindings:portable_lib", # @manual + "//executorch/extension/pytree:pylib", + ], +) diff --git a/backends/vulkan/test/TARGETS b/backends/vulkan/test/TARGETS deleted file mode 100644 index ee296a4f68f..00000000000 --- a/backends/vulkan/test/TARGETS +++ /dev/null @@ -1,90 +0,0 @@ -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -python_unittest( - name = "test_vulkan_delegate", - srcs = [ - "test_vulkan_delegate.py", - ], - preload_deps = [ - "fbsource//third-party/swiftshader/lib/linux-x64:libvk_swiftshader_fbcode", - "//executorch/backends/vulkan:vulkan_backend_lib", - "//executorch/kernels/portable:custom_ops_generated_lib", - ], - deps = [ - ":test_utils", - "//caffe2:torch", - "//executorch/backends/transforms:convert_dtype_pass", - "//executorch/backends/vulkan:vulkan_preprocess", - "//executorch/backends/vulkan/partitioner:vulkan_partitioner", - "//executorch/exir:lib", - "//executorch/extension/pybindings:portable_lib", # @manual - "//executorch/extension/pytree:pylib", - "//executorch/kernels/portable:custom_ops_generated_lib", - ], -) - -python_unittest( - name = "test_vulkan_passes", - srcs = [ - "test_vulkan_passes.py", - ], - deps = [ - "//caffe2:torch", - "//executorch/backends/vulkan/_passes:vulkan_passes", - "//executorch/backends/vulkan:vulkan_preprocess", - "//pytorch/ao:torchao", # @manual - ] -) - -python_unittest( - name = "test_vulkan_delegate_header", - srcs = [ - "test_vulkan_delegate_header.py", - ], - deps = [ - "//executorch/backends/vulkan:vulkan_preprocess", - ], -) - -python_unittest( - name = "test_serialization", - srcs = [ - "test_serialization.py", - ], - deps = [ - "//caffe2:torch", - "//executorch/backends/vulkan:vulkan_preprocess", - ], -) - -runtime.python_library( - name = "tester", - srcs = ["tester.py"], - deps = [ - "//executorch/backends/vulkan/partitioner:vulkan_partitioner", - "//executorch/backends/vulkan:vulkan_preprocess", - ] -) - -runtime.python_library( - name = "test_utils", - srcs = [ - "utils.py", - ], - deps = [ - "//caffe2:torch", - "//executorch/backends/vulkan:vulkan_preprocess", - "//executorch/backends/vulkan/partitioner:vulkan_partitioner", - "//executorch/backends/xnnpack:xnnpack_preprocess", - "//executorch/backends/xnnpack/quantizer:xnnpack_quantizer", - "//executorch/backends/xnnpack/partition:xnnpack_partitioner", - "//executorch/devtools:lib", - "//executorch/devtools/bundled_program/serialize:lib", - "//executorch/exir:lib", - "//executorch/extension/pybindings:portable_lib", # @manual - "//executorch/extension/pytree:pylib", - ], -) diff --git a/backends/vulkan/test/custom_ops/BUCK b/backends/vulkan/test/custom_ops/BUCK index 1e8cc179228..1c77681b69c 100644 --- a/backends/vulkan/test/custom_ops/BUCK +++ b/backends/vulkan/test/custom_ops/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/backends/vulkan/test/custom_ops/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/backends/vulkan/test/custom_ops/TARGETS b/backends/vulkan/test/custom_ops/TARGETS deleted file mode 100644 index e84397dc20e..00000000000 --- a/backends/vulkan/test/custom_ops/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets(is_fbcode = True) diff --git a/backends/vulkan/test/op_tests/BUCK b/backends/vulkan/test/op_tests/BUCK index 1e8cc179228..8f97558ecaf 100644 --- a/backends/vulkan/test/op_tests/BUCK +++ b/backends/vulkan/test/op_tests/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/backends/vulkan/test/op_tests/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/backends/vulkan/test/op_tests/TARGETS b/backends/vulkan/test/op_tests/TARGETS deleted file mode 100644 index e84397dc20e..00000000000 --- a/backends/vulkan/test/op_tests/TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets(is_fbcode = True) 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",