diff --git a/exir/backend/BUCK b/exir/backend/BUCK index 1e8cc179228..bb54371ef63 100644 --- a/exir/backend/BUCK +++ b/exir/backend/BUCK @@ -1,8 +1,108 @@ +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/exir/backend/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/backends:backends.bzl", "get_all_cpu_aot_and_backend_targets") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) + +# Use runtime.python_library instead of the one defined in python_library.bzl, +# so we can have access to EXECUTORCH_CLIENTS list. +fbcode_target(_kind = runtime.python_library, + name = "backend_api", + srcs = [ + "backend_api.py", + ], + visibility = ["PUBLIC"], + deps = [ + ":backend_details", + ":compile_spec_schema", + "//caffe2:torch", + "//executorch/exir/backend:utils", + "//executorch/exir/backend/canonical_partitioners:duplicate_constant_node_pass", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "compile_spec_schema", + srcs = [ + "compile_spec_schema.py", + ], + visibility = ["PUBLIC"], +) + +fbcode_target(_kind = runtime.python_library, + name = "operator_support", + srcs = [ + "operator_support.py", + ], + visibility = ["PUBLIC"], +) + +fbcode_target(_kind = runtime.python_library, + name = "partitioner", + srcs = [ + "partitioner.py", + ], + visibility = ["PUBLIC"], + deps = [ + ":compile_spec_schema", + "//caffe2:torch", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "backend_details", + srcs = [ + "backend_details.py", + ], + visibility = ["PUBLIC"], + deps = [ + ":compile_spec_schema", + ":partitioner", + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:graph_module", + ], +) + +# backend_lib includes all ahead of time apis and supported backends, +# it's supposed to be only used on server side and not for production on device. +fbcode_target(_kind = runtime.python_library, + name = "backend_lib", + visibility = ["PUBLIC"], + deps = [ + ":backend_api", + ":backend_details", + ":utils", + "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", + ] + get_all_cpu_aot_and_backend_targets(), +) + +fbcode_target(_kind = runtime.python_library, + name = "utils", + srcs = [ + "utils.py", + ], + visibility = ["PUBLIC"], + deps = [ + "fbsource//third-party/pypi/pandas:pandas", + "//caffe2:torch", + "//executorch/exir:lowered_backend_module", + "//executorch/exir/backend/canonical_partitioners:duplicate_constant_node_pass", + ], +) diff --git a/exir/backend/TARGETS b/exir/backend/TARGETS deleted file mode 100644 index fa33fa96428..00000000000 --- a/exir/backend/TARGETS +++ /dev/null @@ -1,97 +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/backends:backends.bzl", "get_all_cpu_aot_and_backend_targets") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets() - -# Use runtime.python_library instead of the one defined in python_library.bzl, -# so we can have access to EXECUTORCH_CLIENTS list. -runtime.python_library( - name = "backend_api", - srcs = [ - "backend_api.py", - ], - visibility = ["PUBLIC"], - deps = [ - ":backend_details", - ":compile_spec_schema", - "//caffe2:torch", - "//executorch/exir/backend:utils", - "//executorch/exir/backend/canonical_partitioners:duplicate_constant_node_pass", - ], -) - -runtime.python_library( - name = "compile_spec_schema", - srcs = [ - "compile_spec_schema.py", - ], - visibility = ["PUBLIC"], -) - -runtime.python_library( - name = "operator_support", - srcs = [ - "operator_support.py", - ], - visibility = ["PUBLIC"], -) - -runtime.python_library( - name = "partitioner", - srcs = [ - "partitioner.py", - ], - visibility = ["PUBLIC"], - deps = [ - ":compile_spec_schema", - "//caffe2:torch", - ], -) - -runtime.python_library( - name = "backend_details", - srcs = [ - "backend_details.py", - ], - visibility = ["PUBLIC"], - deps = [ - ":compile_spec_schema", - ":partitioner", - "//caffe2:torch", - "//executorch/exir:delegate", - "//executorch/exir:graph_module", - ], -) - -# backend_lib includes all ahead of time apis and supported backends, -# it's supposed to be only used on server side and not for production on device. -runtime.python_library( - name = "backend_lib", - visibility = ["PUBLIC"], - deps = [ - ":backend_api", - ":backend_details", - ":utils", - "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", - ] + get_all_cpu_aot_and_backend_targets(), -) - -runtime.python_library( - name = "utils", - srcs = [ - "utils.py", - ], - visibility = ["PUBLIC"], - deps = [ - "fbsource//third-party/pypi/pandas:pandas", - "//caffe2:torch", - "//executorch/exir:lowered_backend_module", - "//executorch/exir/backend/canonical_partitioners:duplicate_constant_node_pass", - ], -) diff --git a/exir/backend/canonical_partitioners/TARGETS b/exir/backend/canonical_partitioners/BUCK similarity index 79% rename from exir/backend/canonical_partitioners/TARGETS rename to exir/backend/canonical_partitioners/BUCK index 27b850dc9e1..17b1fc21ef2 100644 --- a/exir/backend/canonical_partitioners/TARGETS +++ b/exir/backend/canonical_partitioners/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 = "canonical_partitioner_lib", srcs = [ "duplicate_dequant_node_pass.py", @@ -17,7 +18,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "duplicate_constant_node_pass", srcs = [ "duplicate_constant_node_pass.py", @@ -29,7 +30,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "config_partitioner_lib", srcs = [ "config_partitioner.py", @@ -41,7 +42,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "group_partitioner_lib", srcs = [ "group_partitioner.py", diff --git a/exir/backend/test/TARGETS b/exir/backend/test/BUCK similarity index 93% rename from exir/backend/test/TARGETS rename to exir/backend/test/BUCK index cf44a3021d4..1212880068a 100644 --- a/exir/backend/test/TARGETS +++ b/exir/backend/test/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("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "backend_with_compiler_demo", srcs = [ "backend_with_compiler_demo.py", @@ -20,7 +21,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "backend_with_delegate_mapping_demo", srcs = [ "backend_with_delegate_mapping_demo.py", @@ -38,7 +39,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "backend_with_named_data_map", srcs = [ "backend_with_named_data_map.py", @@ -66,7 +67,7 @@ runtime.python_library( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_backend_with_named_data_map", srcs = [ "test_backend_with_named_data_map.py", @@ -94,7 +95,7 @@ python_unittest( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "demo_backend", srcs = [ "demo_backend.py", @@ -109,7 +110,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "hta_partitioner_demo", srcs = [ "hta_partitioner_demo.py", @@ -128,7 +129,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "op_partitioner_demo", srcs = [ "op_partitioner_demo.py", @@ -149,7 +150,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "example_backends", deps = [ ":backend_with_compiler_demo", @@ -157,7 +158,7 @@ runtime.python_library( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_backends", srcs = [ "test_backends.py", @@ -189,7 +190,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_to_backend_multi_method", srcs = [ "test_to_backend_multi_method.py", @@ -219,7 +220,7 @@ python_unittest( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "backend_with_preprocess_all_demo", srcs = [ "backend_with_preprocess_all_demo.py" @@ -242,7 +243,7 @@ runtime.python_library( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_debug_handle_map", srcs = [ "test_debug_handle_map.py", @@ -259,7 +260,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_backends_lifted", srcs = [ "test_backends_lifted.py", @@ -291,7 +292,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_lowered_backend_module", srcs = [ "test_lowered_backend_module.py", @@ -316,7 +317,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_graph_partition", srcs = [ "test_graph_partition.py", @@ -333,7 +334,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_backends_nested", srcs = [ "test_backends_nested.py", @@ -359,7 +360,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_delegate_map_builder", srcs = [ "test_delegate_map_builder.py", @@ -373,7 +374,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_utils", srcs = [ "test_utils.py", @@ -391,7 +392,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_partitioner", srcs = [ "test_partitioner.py", @@ -417,7 +418,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_passes", srcs = [ "test_passes.py", @@ -429,7 +430,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_compatibility", srcs = [ "test_compatibility.py", @@ -448,7 +449,7 @@ python_unittest( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_group_partitioner", srcs = [ "test_group_partitioner.py", diff --git a/exir/backend/test/demos/TARGETS b/exir/backend/test/demos/BUCK similarity index 82% rename from exir/backend/test/demos/TARGETS rename to exir/backend/test/demos/BUCK index d3cc5d62710..8404c5982c6 100644 --- a/exir/backend/test/demos/TARGETS +++ b/exir/backend/test/demos/BUCK @@ -1,6 +1,7 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_delegate_aten_mode", srcs = [ "test_delegate_aten_mode.py", diff --git a/exir/backend/test/demos/rpc/BUCK b/exir/backend/test/demos/rpc/BUCK index 1e8cc179228..463e4d57758 100644 --- a/exir/backend/test/demos/rpc/BUCK +++ b/exir/backend/test/demos/rpc/BUCK @@ -1,8 +1,79 @@ +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/exir/backend/test/demos/rpc/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") +load(":targets.bzl", "define_common_targets") + +fbcode_target(_kind = define_common_targets,) + +fbcode_target(_kind = runtime.python_library, + name = "executor_backend_preprocess", + srcs = [ + "executor_backend_preprocess.py", + ], + visibility = [ + "//executorch/exir/backend/test/...", + "//executorch/test/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir/backend:backend_details", + "//executorch/exir/backend:compile_spec_schema", + "//nodeapi/py:base", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "executor_backend_partitioner", + srcs = [ + "executor_backend_partitioner.py", + ], + visibility = [ + "//executorch/exir/backend/test/...", + "//executorch/exir/emit/test/...", + ], + deps = [ + ":executor_backend_preprocess", + "//caffe2:torch", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir/backend:partitioner", + "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir/backend/test:backend_with_compiler_demo", + ], +) + +fbcode_target(_kind = python_unittest, + name = "test_rpc", + srcs = [ + "test_rpc.py", + ], + preload_deps = [ + "//executorch/configurations:optimized_native_cpu_ops", + "//executorch/kernels/quantized:custom_ops_generated_lib", + # the executor backend is prebuilt and linked when building the unit test binary. When it's linked, it'll register the backend. + # It can also be loaded in PyThon runtime via torch.ops.load_library("//executorch/exir/backend/test/demos/rpc:executor_backend") + # However, it's a better practice to build/link everything at earlier stage, instead of during runtime + "//executorch/exir/backend/test/demos/rpc:executor_backend_register", + ], + deps = [ + ":executor_backend_partitioner", + ":executor_backend_preprocess", + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir/backend:backend_api", + "//executorch/exir/backend/test:op_partitioner_demo", + "//executorch/extension/pybindings:portable_lib", # @manual + ], +) diff --git a/exir/backend/test/demos/rpc/TARGETS b/exir/backend/test/demos/rpc/TARGETS deleted file mode 100644 index d8fb426ba6a..00000000000 --- a/exir/backend/test/demos/rpc/TARGETS +++ /dev/null @@ -1,67 +0,0 @@ -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -load(":targets.bzl", "define_common_targets") - -define_common_targets() - -runtime.python_library( - name = "executor_backend_preprocess", - srcs = [ - "executor_backend_preprocess.py", - ], - visibility = [ - "//executorch/exir/backend/test/...", - "//executorch/test/...", - ], - deps = [ - "//caffe2:torch", - "//executorch/exir:lib", - "//executorch/exir/backend:backend_details", - "//executorch/exir/backend:compile_spec_schema", - "//nodeapi/py:base", - ], -) - -runtime.python_library( - name = "executor_backend_partitioner", - srcs = [ - "executor_backend_partitioner.py", - ], - visibility = [ - "//executorch/exir/backend/test/...", - "//executorch/exir/emit/test/...", - ], - deps = [ - ":executor_backend_preprocess", - "//caffe2:torch", - "//executorch/exir:graph_module", - "//executorch/exir:lib", - "//executorch/exir/backend:partitioner", - "//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib", - "//executorch/exir/backend/test:backend_with_compiler_demo", - ], -) - -python_unittest( - name = "test_rpc", - srcs = [ - "test_rpc.py", - ], - preload_deps = [ - "//executorch/configurations:optimized_native_cpu_ops", - "//executorch/kernels/quantized:custom_ops_generated_lib", - # the executor backend is prebuilt and linked when building the unit test binary. When it's linked, it'll register the backend. - # It can also be loaded in PyThon runtime via torch.ops.load_library("//executorch/exir/backend/test/demos/rpc:executor_backend") - # However, it's a better practice to build/link everything at earlier stage, instead of during runtime - "//executorch/exir/backend/test/demos/rpc:executor_backend_register", - ], - deps = [ - ":executor_backend_partitioner", - ":executor_backend_preprocess", - "//caffe2:torch", - "//executorch/exir:lib", - "//executorch/exir/backend:backend_api", - "//executorch/exir/backend/test:op_partitioner_demo", - "//executorch/extension/pybindings:portable_lib", # @manual - ], -) diff --git a/exir/capture/BUCK b/exir/capture/BUCK index 51846daef65..71f1ca9ac6b 100644 --- a/exir/capture/BUCK +++ b/exir/capture/BUCK @@ -1,4 +1,52 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # add this empty BUCK file to unblock landing. Without this, we get land error: # "No build file at xplat/executorch/exir/BUCK when resolving target fbsource//xplat/executorch/exir:." -oncall("executorch") + +# !!!! fbcode/executorch/exir/capture/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + + +fbcode_target(_kind = runtime.python_library, + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + ":capture", + ":config", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "capture", + srcs = [ + "_capture.py", + ], + deps = [ + ":config", + "//caffe2:torch", + "//executorch/exir:error", + "//executorch/exir:tracer", + "//executorch/exir/program:lib", + "//executorch/exir/program:program", + "//executorch/exir/verification:verifier", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "config", + srcs = [ + "_config.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:dynamic_shape", + "//executorch/exir:pass_manager", + "//executorch/exir:tracer", + "//executorch/exir/passes:lib", + "//executorch/exir/passes:sym_shape_eval_pass", + ], +) diff --git a/exir/capture/TARGETS b/exir/capture/TARGETS deleted file mode 100644 index 983cdd210c9..00000000000 --- a/exir/capture/TARGETS +++ /dev/null @@ -1,45 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -runtime.python_library( - name = "lib", - srcs = [ - "__init__.py", - ], - deps = [ - ":capture", - ":config", - ], -) - -runtime.python_library( - name = "capture", - srcs = [ - "_capture.py", - ], - deps = [ - ":config", - "//caffe2:torch", - "//executorch/exir:error", - "//executorch/exir:tracer", - "//executorch/exir/program:lib", - "//executorch/exir/program:program", - "//executorch/exir/verification:verifier", - ], -) - -runtime.python_library( - name = "config", - srcs = [ - "_config.py", - ], - deps = [ - "//caffe2:torch", - "//executorch/exir:dynamic_shape", - "//executorch/exir:pass_manager", - "//executorch/exir:tracer", - "//executorch/exir/passes:lib", - "//executorch/exir/passes:sym_shape_eval_pass", - ], -) diff --git a/exir/dialects/TARGETS b/exir/dialects/BUCK similarity index 74% rename from exir/dialects/TARGETS rename to exir/dialects/BUCK index 39f0a9d0f1b..4b8b02472ac 100644 --- a/exir/dialects/TARGETS +++ b/exir/dialects/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 = [ "_ops.py", diff --git a/exir/dialects/backend/BUCK b/exir/dialects/backend/BUCK index 00117255f7c..d3ee4633223 100644 --- a/exir/dialects/backend/BUCK +++ b/exir/dialects/backend/BUCK @@ -1,4 +1,21 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # add this empty BUCK file to unblock landing. Without this, we get land error: # "No build file at xplat/executorch/exir/dialects/backend/BUCK when resolving target fbsource//xplat/executorch/exir/dialects/backend:." -oncall("executorch") + +# !!!! fbcode/executorch/exir/dialects/backend/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + + +fbcode_target(_kind = runtime.python_library, + name = "lib", + srcs = [ + "_ops.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir/dialects/edge:lib", + ], +) diff --git a/exir/dialects/backend/TARGETS b/exir/dialects/backend/TARGETS deleted file mode 100644 index 1bfd78a9ae1..00000000000 --- a/exir/dialects/backend/TARGETS +++ /dev/null @@ -1,14 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -runtime.python_library( - name = "lib", - srcs = [ - "_ops.py", - ], - deps = [ - "//caffe2:torch", - "//executorch/exir/dialects/edge:lib", - ], -) diff --git a/exir/dialects/backend/test/TARGETS b/exir/dialects/backend/test/BUCK similarity index 72% rename from exir/dialects/backend/test/TARGETS rename to exir/dialects/backend/test/BUCK index 9cfc5ecff68..1a79a6aa692 100644 --- a/exir/dialects/backend/test/TARGETS +++ b/exir/dialects/backend/test/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_backend_ops", srcs = [ "test_backend_ops.py", diff --git a/exir/dialects/edge/BUCK b/exir/dialects/edge/BUCK index b220af1d3e6..c7b0df55c16 100644 --- a/exir/dialects/edge/BUCK +++ b/exir/dialects/edge/BUCK @@ -1,4 +1,36 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # add this empty BUCK file to unblock landing. Without this, we get land error: # "No build file at xplat/executorch/exir/BUCK when resolving target fbsource//xplat/executorch/exir/dialects/edge:." -oncall("executorch") + +# !!!! fbcode/executorch/exir/dialects/edge/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbcode_macros//build_defs:export_files.bzl", "export_file") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + + +fbcode_target(_kind = runtime.python_library, + name = "lib", + srcs = [ + "_ops.py", + ], + resources = { + ":edge_yaml": "edge.yaml", + }, + deps = [ + "fbsource//third-party/pypi/ruamel-yaml:ruamel-yaml", + "fbsource//third-party/pypi/setuptools:setuptools", + "//caffe2:torch", + "//caffe2/torchgen:torchgen", + "//executorch/exir/dialects/edge/dtype:lib", + "//executorch/exir/dialects/edge/op:lib", + "//executorch/exir/dialects/edge/spec:lib", + ], +) + +fbcode_target(_kind = export_file, + name = "edge_yaml", + src = "edge.yaml", + visibility = ["//executorch/..."], +) diff --git a/exir/dialects/edge/TARGETS b/exir/dialects/edge/TARGETS deleted file mode 100644 index 4fcf1948b5f..00000000000 --- a/exir/dialects/edge/TARGETS +++ /dev/null @@ -1,29 +0,0 @@ -load("@fbcode_macros//build_defs:export_files.bzl", "export_file") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -runtime.python_library( - name = "lib", - srcs = [ - "_ops.py", - ], - resources = { - ":edge_yaml": "edge.yaml", - }, - deps = [ - "fbsource//third-party/pypi/ruamel-yaml:ruamel-yaml", - "fbsource//third-party/pypi/setuptools:setuptools", - "//caffe2:torch", - "//caffe2/torchgen:torchgen", - "//executorch/exir/dialects/edge/dtype:lib", - "//executorch/exir/dialects/edge/op:lib", - "//executorch/exir/dialects/edge/spec:lib", - ], -) - -export_file( - name = "edge_yaml", - src = "edge.yaml", - visibility = ["//executorch/..."], -) diff --git a/exir/dialects/edge/arg/TARGETS b/exir/dialects/edge/arg/BUCK similarity index 62% rename from exir/dialects/edge/arg/TARGETS rename to exir/dialects/edge/arg/BUCK index 79705a06357..be04bb2961c 100644 --- a/exir/dialects/edge/arg/TARGETS +++ b/exir/dialects/edge/arg/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("ai_infra_mobile_platform") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "lib", srcs = [ "model.py", diff --git a/exir/dialects/edge/dtype/TARGETS b/exir/dialects/edge/dtype/BUCK similarity index 71% rename from exir/dialects/edge/dtype/TARGETS rename to exir/dialects/edge/dtype/BUCK index 9fbec419812..77db4939eb4 100644 --- a/exir/dialects/edge/dtype/TARGETS +++ b/exir/dialects/edge/dtype/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("ai_infra_mobile_platform") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "lib", srcs = [ "runner.py", diff --git a/exir/dialects/edge/op/TARGETS b/exir/dialects/edge/op/BUCK similarity index 77% rename from exir/dialects/edge/op/TARGETS rename to exir/dialects/edge/op/BUCK index c4f5b5c4d70..0fb7051bd76 100644 --- a/exir/dialects/edge/op/TARGETS +++ b/exir/dialects/edge/op/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("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("ai_infra_mobile_platform") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "lib", srcs = [ "api.py", @@ -17,7 +18,7 @@ runtime.python_library( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_api", srcs = [ "test/test_api.py", diff --git a/exir/dialects/edge/spec/TARGETS b/exir/dialects/edge/spec/BUCK similarity index 80% rename from exir/dialects/edge/spec/TARGETS rename to exir/dialects/edge/spec/BUCK index ce5c5970e14..006c40ce009 100644 --- a/exir/dialects/edge/spec/TARGETS +++ b/exir/dialects/edge/spec/BUCK @@ -1,9 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("ai_infra_mobile_platform") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "lib", srcs = [ "gen.py", @@ -18,7 +19,7 @@ runtime.python_library( ], ) -python_binary( +fbcode_target(_kind = python_binary, name = "gen", srcs = [], main_function = "executorch.exir.dialects.edge.spec.gen.main", diff --git a/exir/dialects/edge/test/BUCK b/exir/dialects/edge/test/BUCK index 57d84ff1f8f..2b7e3cc208e 100644 --- a/exir/dialects/edge/test/BUCK +++ b/exir/dialects/edge/test/BUCK @@ -1,4 +1,39 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # add this empty BUCK file to unblock landing. Without this, we get land error: # "No build file at xplat/executorch/exir/dialects/edge/test/BUCK when resolving target fbsource//xplat/executorch/exir/dialects/edge/test:." -oncall("executorch") + +# !!!! fbcode/executorch/exir/dialects/edge/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") + + +fbcode_target(_kind = python_unittest, + name = "test_edge_yaml", + srcs = [ + "test_edge_yaml.py", + ], + resources = { + "//executorch/exir/dialects/edge:edge_yaml": "edge.yaml", + }, + labels = ["long_running"], + deps = [ + "fbsource//third-party/pypi/expecttest:expecttest", # @manual + "//caffe2:torch", + "//executorch/exir/dialects/edge/dtype:lib", + "//executorch/exir/dialects/edge/spec:lib", + ], +) + +fbcode_target(_kind = python_unittest, + name = "test_edge_ops", + srcs = [ + "test_edge_ops.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir/dialects:lib", + "//executorch/exir/dialects/edge:lib", + ], +) diff --git a/exir/dialects/edge/test/TARGETS b/exir/dialects/edge/test/TARGETS deleted file mode 100644 index 8a689b0dba6..00000000000 --- a/exir/dialects/edge/test/TARGETS +++ /dev/null @@ -1,32 +0,0 @@ -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") - -oncall("executorch") - -python_unittest( - name = "test_edge_yaml", - srcs = [ - "test_edge_yaml.py", - ], - resources = { - "//executorch/exir/dialects/edge:edge_yaml": "edge.yaml", - }, - labels = ["long_running"], - deps = [ - "fbsource//third-party/pypi/expecttest:expecttest", # @manual - "//caffe2:torch", - "//executorch/exir/dialects/edge/dtype:lib", - "//executorch/exir/dialects/edge/spec:lib", - ], -) - -python_unittest( - name = "test_edge_ops", - srcs = [ - "test_edge_ops.py", - ], - deps = [ - "//caffe2:torch", - "//executorch/exir/dialects:lib", - "//executorch/exir/dialects/edge:lib", - ], -) diff --git a/exir/dialects/test/TARGETS b/exir/dialects/test/BUCK similarity index 64% rename from exir/dialects/test/TARGETS rename to exir/dialects/test/BUCK index 4327d3041b9..0e37d337779 100644 --- a/exir/dialects/test/TARGETS +++ b/exir/dialects/test/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_exir_dialect_ops", srcs = [ "test_exir_dialect_ops.py", diff --git a/exir/emit/BUCK b/exir/emit/BUCK index 51846daef65..84b000fee2d 100644 --- a/exir/emit/BUCK +++ b/exir/emit/BUCK @@ -1,4 +1,45 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # add this empty BUCK file to unblock landing. Without this, we get land error: # "No build file at xplat/executorch/exir/BUCK when resolving target fbsource//xplat/executorch/exir:." -oncall("executorch") + +# !!!! fbcode/executorch/exir/emit/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + + +fbcode_target(_kind = runtime.python_library, + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + ":emit", + ], +) + +fbcode_target(_kind = runtime.python_library, + name = "emit", + srcs = [ + "_emit_program.py", + "_emitter.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:error", + "//executorch/exir:memory", + "//executorch/exir:print_program", + "//executorch/exir:schema", + "//executorch/exir:tensor", + "//executorch/exir:types", + "//executorch/exir:version", + "//executorch/exir/dialects/backend:lib", + "//executorch/exir/dialects/edge:lib", + "//executorch/exir/operator:convert", + "//executorch/exir/passes:prim_ops_py_registry", + "//executorch/extension/pytree:pylib", + ], +) diff --git a/exir/emit/TARGETS b/exir/emit/TARGETS deleted file mode 100644 index 0adee10e82e..00000000000 --- a/exir/emit/TARGETS +++ /dev/null @@ -1,38 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -runtime.python_library( - name = "lib", - srcs = [ - "__init__.py", - ], - deps = [ - ":emit", - ], -) - -runtime.python_library( - name = "emit", - srcs = [ - "_emit_program.py", - "_emitter.py", - ], - deps = [ - "fbsource//third-party/pypi/typing-extensions:typing-extensions", - "//caffe2:torch", - "//executorch/exir:delegate", - "//executorch/exir:error", - "//executorch/exir:memory", - "//executorch/exir:print_program", - "//executorch/exir:schema", - "//executorch/exir:tensor", - "//executorch/exir:types", - "//executorch/exir:version", - "//executorch/exir/dialects/backend:lib", - "//executorch/exir/dialects/edge:lib", - "//executorch/exir/operator:convert", - "//executorch/exir/passes:prim_ops_py_registry", - "//executorch/extension/pytree:pylib", - ], -) diff --git a/exir/emit/test/BUCK b/exir/emit/test/BUCK index 213d4c228d1..71a9619a0bc 100644 --- a/exir/emit/test/BUCK +++ b/exir/emit/test/BUCK @@ -1,4 +1,37 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # add this empty BUCK file to unblock landing. Without this, we get land error: # "No build file at xplat/executorch/exir/tests/BUCK when resolving target fbsource//xplat/executorch/exir/tests:." -oncall("executorch") + +# !!!! fbcode/executorch/exir/emit/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") + + +fbcode_target(_kind = python_unittest, + # @autodeps-skip pybindings don't work well with autodeps + name = "emit", + srcs = [ + "test_emit.py", + ], + deps = [ + "fbsource//third-party/pypi/pytest:pytest", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/exir:error", + "//executorch/exir:lib", + "//executorch/exir:print_program", + "//executorch/exir:schema", + "//executorch/exir/backend/test/demos/rpc:executor_backend_partitioner", + "//executorch/exir/backend:backend_api", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:const_prop_pass", + "//executorch/exir/passes:constant_prop_pass", + "//executorch/exir/passes:init_mutable_pass", + "//executorch/exir/tests:lib", + "//executorch/exir/tests:models", + "//executorch/extension/pybindings:portable_lib", + "//executorch/runtime:runtime", + ], +) diff --git a/exir/emit/test/TARGETS b/exir/emit/test/TARGETS deleted file mode 100644 index 153843d45ea..00000000000 --- a/exir/emit/test/TARGETS +++ /dev/null @@ -1,30 +0,0 @@ -load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") - -oncall("executorch") - -python_unittest( - # @autodeps-skip pybindings don't work well with autodeps - name = "emit", - srcs = [ - "test_emit.py", - ], - deps = [ - "fbsource//third-party/pypi/pytest:pytest", - "//caffe2:torch", - "//caffe2/functorch:functorch_src", - "//executorch/exir:error", - "//executorch/exir:lib", - "//executorch/exir:print_program", - "//executorch/exir:schema", - "//executorch/exir/backend/test/demos/rpc:executor_backend_partitioner", - "//executorch/exir/backend:backend_api", - "//executorch/exir/emit:lib", - "//executorch/exir/passes:const_prop_pass", - "//executorch/exir/passes:constant_prop_pass", - "//executorch/exir/passes:init_mutable_pass", - "//executorch/exir/tests:lib", - "//executorch/exir/tests:models", - "//executorch/extension/pybindings:portable_lib", - "//executorch/runtime:runtime", - ], -) diff --git a/exir/operator/TARGETS b/exir/operator/BUCK similarity index 74% rename from exir/operator/TARGETS rename to exir/operator/BUCK index 1a8f82a495a..0a3aa845fc2 100644 --- a/exir/operator/TARGETS +++ b/exir/operator/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("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "convert", srcs = [ "convert.py", @@ -14,7 +15,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "manip", srcs = [ "manip.py", @@ -25,7 +26,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "util", srcs = [ "util.py", @@ -37,7 +38,7 @@ runtime.python_library( ], ) -python_unittest( +fbcode_target(_kind = python_unittest, name = "test_operator", srcs = [ "test/test_operator.py", diff --git a/exir/passes/TARGETS b/exir/passes/BUCK similarity index 84% rename from exir/passes/TARGETS rename to exir/passes/BUCK index 45e505cdc7d..e274d0482e6 100644 --- a/exir/passes/TARGETS +++ b/exir/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 = "lib", srcs = [ "__init__.py", @@ -48,7 +49,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "pass_registry", srcs = [ "pass_registry.py", @@ -59,7 +60,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "external_constants_pass", srcs = [ "external_constants_pass.py", @@ -69,7 +70,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "reinplace_pass", srcs = [ "reinplace.py", @@ -80,7 +81,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "insert_write_back_for_buffers_pass", srcs = [ "insert_write_back_for_buffers_pass.py", @@ -90,7 +91,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "weights_to_outputs_pass", srcs = [ "weights_to_outputs_pass.py", @@ -100,7 +101,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "const_prop_pass", srcs = [ "const_prop_pass.py", @@ -112,7 +113,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "scalar_to_tensor_pass", srcs = [ "scalar_to_tensor_pass.py", @@ -123,7 +124,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "constant_prop_pass", srcs = [ "constant_prop_pass.py", @@ -137,7 +138,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_graph_asserts_pass", srcs = [ "remove_graph_asserts_pass.py", @@ -147,7 +148,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "sym_to_tensor_pass", srcs = [ "sym_to_tensor_pass.py", @@ -158,7 +159,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "quant_fusion_pass", srcs = [ "_quant_patterns_and_replacements.py", @@ -174,7 +175,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "quantize_io_pass", srcs = [ "quantize_io_pass.py", @@ -187,7 +188,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "memory_planning_pass", srcs = [ "memory_planning_pass.py", @@ -203,7 +204,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_noop_pass", srcs = [ "remove_noop_pass.py", @@ -215,7 +216,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "prune_empty_tensor_pass", srcs = [ "prune_empty_tensors_pass.py", @@ -227,7 +228,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_mixed_type_operators", srcs = [ "remove_mixed_type_operators.py", @@ -238,7 +239,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "spec_prop_pass", srcs = [ "spec_prop_pass.py", @@ -251,7 +252,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "init_mutable_pass", srcs = [ "init_mutable_pass.py", @@ -261,7 +262,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "sym_shape_eval_pass", srcs = [ "sym_shape_eval_pass.py", @@ -276,7 +277,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_broken_ops_with_function_ops_pass", srcs = [ "replace_broken_ops_with_function_ops_pass.py", @@ -287,7 +288,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_sym_size_op_pass", srcs = [ "replace_sym_size_op_pass.py", @@ -298,7 +299,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_edge_with_backend_pass", srcs = [ "replace_edge_with_backend_pass.py", @@ -310,7 +311,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "normalize_transpose_pass", srcs = [ "normalize_transpose_pass.py", @@ -321,7 +322,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_aten_with_edge_pass", srcs = [ "replace_aten_with_edge_pass.py", @@ -335,7 +336,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "debug_handle_generator_pass", srcs = [ "debug_handle_generator_pass.py", @@ -348,7 +349,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "prim_ops_py_registry", srcs = ["executorch_prim_ops_registry.py"], deps = [ @@ -357,7 +358,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "dim_order_ops_registry", srcs = ["dim_order_ops_registry.py"], deps = [ @@ -367,7 +368,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "memory_format_ops_pass", srcs = [ "memory_format_ops_pass.py", @@ -381,7 +382,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "normalize_view_copy_base_pass", srcs = [ "normalize_view_copy_base_pass.py", @@ -392,7 +393,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "replace_view_copy_with_view_pass", srcs = [ "replace_view_copy_with_view_pass.py", @@ -405,7 +406,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "remove_unused_parameters_pass", srcs = [ "remove_unused_parameters_pass.py", diff --git a/exir/program/TARGETS b/exir/program/BUCK similarity index 89% rename from exir/program/TARGETS rename to exir/program/BUCK index b113d8ab2bc..0667928de6d 100644 --- a/exir/program/TARGETS +++ b/exir/program/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("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "lib", srcs = [ "__init__.py", @@ -14,7 +15,7 @@ runtime.python_library( ], ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "program", srcs = [ "_program.py", @@ -50,7 +51,7 @@ runtime.python_library( ] + (["//executorch/exir/program/fb:logger"] if not runtime.is_oss else []) ) -runtime.python_library( +fbcode_target(_kind = runtime.python_library, name = "fake_program", srcs = [ "_fake_program.py", diff --git a/exir/program/test/TARGETS b/exir/program/test/BUCK similarity index 86% rename from exir/program/test/TARGETS rename to exir/program/test/BUCK index f9788c42265..e57eb729859 100644 --- a/exir/program/test/TARGETS +++ b/exir/program/test/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_unittest( +fbcode_target(_kind = python_unittest, # @autodeps-skip pybindings don't work well with autodeps name = "test_program", srcs = [ diff --git a/exir/serde/TARGETS b/exir/serde/BUCK similarity index 84% rename from exir/serde/TARGETS rename to exir/serde/BUCK index 4cc442a0fca..a2f17675f43 100644 --- a/exir/serde/TARGETS +++ b/exir/serde/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-skip for some reason autodeps thinks this target # needs to depend on exir:lib which it doesn't. name = "serialize",