From b580e71b20e71c656ae70798ac6a54967747a75f Mon Sep 17 00:00:00 2001 From: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com> Date: Wed, 12 Jul 2023 23:35:11 -0700 Subject: [PATCH] Re-sync with internal repository --- backends/TARGETS | 107 +++++ backends/canonical_partitioners/TARGETS | 19 + backends/qnnpack/TARGETS | 26 ++ backends/qnnpack/partition/TARGETS | 38 ++ backends/qnnpack/test/TARGETS | 47 ++ backends/test/TARGETS | 169 ++++++++ backends/test/demos/TARGETS | 47 ++ backends/test/demos/rpc/TARGETS | 58 +++ backends/transforms/TARGETS | 24 ++ backends/vulkan/TARGETS | 44 ++ backends/vulkan/serialization/schema/TARGETS | 43 ++ backends/vulkan/test/TARGETS | 23 + backends/xnnpack/TARGETS | 29 ++ backends/xnnpack/operators/TARGETS | 17 + backends/xnnpack/partition/TARGETS | 36 ++ backends/xnnpack/passes/TARGETS | 23 + backends/xnnpack/test/TARGETS | 113 +++++ backends/xnnpack/utils/TARGETS | 31 ++ bundled_program/TARGETS | 49 +++ bundled_program/serialize/TARGETS | 38 ++ bundled_program/tests/TARGETS | 64 +++ codegen/TARGETS | 5 + codegen/tools/TARGETS | 55 +++ configurations/TARGETS | 8 + core/TARGETS | 6 + core/kernel_types/TARGETS | 6 + core/kernel_types/test/TARGETS | 6 + core/kernel_types/testing/TARGETS | 6 + core/kernel_types/util/TARGETS | 6 + core/kernel_types/util/test/TARGETS | 6 + core/prim_ops/TARGETS | 27 ++ core/prim_ops/test/TARGETS | 20 + core/values/TARGETS | 6 + core/values/test/TARGETS | 6 + docs/TARGETS | 26 ++ executor/TARGETS | 6 + executor/test/TARGETS | 6 + exir/TARGETS | 283 ++++++++++++ exir/dialects/TARGETS | 17 + exir/dialects/backend/TARGETS | 12 + exir/dialects/backend/test/TARGETS | 17 + exir/dialects/edge/TARGETS | 83 ++++ exir/dialects/edge/test/TARGETS | 33 ++ exir/dialects/test/TARGETS | 12 + exir/emit/TARGETS | 39 ++ exir/emit/test/TARGETS | 22 + exir/experimental/TARGETS | 23 + exir/operator/TARGETS | 25 ++ exir/pass_infra/TARGETS | 20 + exir/passes/TARGETS | 246 +++++++++++ exir/scripts/TARGETS | 37 ++ exir/serde/TARGETS | 15 + exir/serialize/TARGETS | 65 +++ exir/serialize/test/TARGETS | 25 ++ exir/tests/TARGETS | 431 +++++++++++++++++++ exir/tests/fixtures/TARGETS | 7 + exir/verification/TARGETS | 59 +++ kernels/aten/TARGETS | 8 + kernels/aten/test/TARGETS | 6 + kernels/optimized/TARGETS | 8 + kernels/optimized/cpu/TARGETS | 8 + kernels/optimized/test/TARGETS | 6 + kernels/portable/TARGETS | 6 + kernels/portable/cpu/TARGETS | 6 + kernels/portable/cpu/pattern/TARGETS | 6 + kernels/portable/cpu/test/TARGETS | 6 + kernels/portable/cpu/util/TARGETS | 6 + kernels/portable/cpu/util/test/TARGETS | 6 + kernels/portable/test/TARGETS | 6 + kernels/quantized/TARGETS | 5 + kernels/quantized/cpu/TARGETS | 5 + kernels/quantized/test/TARGETS | 19 + kernels/test/TARGETS | 42 ++ kernels/test/custom_kernel_example/TARGETS | 8 + profiler/TARGETS | 57 +++ profiler/test/TARGETS | 21 + pybindings/TARGETS | 60 +++ pybindings/test/TARGETS | 27 ++ pytree/TARGETS | 49 +++ pytree/test/TARGETS | 25 ++ runtime/backend/TARGETS | 8 + runtime/backend/test/TARGETS | 8 + runtime/core/TARGETS | 6 + runtime/core/portable_type/TARGETS | 6 + runtime/core/portable_type/test/TARGETS | 6 + runtime/core/test/TARGETS | 8 + runtime/kernel/TARGETS | 8 + runtime/kernel/test/TARGETS | 8 + runtime/platform/TARGETS | 6 + runtime/platform/test/TARGETS | 6 + schema/TARGETS | 6 + schema/test/TARGETS | 8 + scripts/size_monitoring/TARGETS | 39 ++ sdk/TARGETS | 59 +++ sdk/edir/TARGETS | 29 ++ sdk/edir/tests/TARGETS | 55 +++ sdk/etdb/TARGETS | 27 ++ sdk/etdump/TARGETS | 33 ++ sdk/etdump/tests/TARGETS | 16 + sdk/etrecord/TARGETS | 13 + sdk/etrecord/tests/TARGETS | 13 + sdk/experimental/TARGETS | 34 ++ sdk/visualizer/TARGETS | 53 +++ sdk/visualizer/tests/TARGETS | 27 ++ test/TARGETS | 8 + test/end2end/TARGETS | 121 ++++++ test/models/TARGETS | 6 + test/utils/TARGETS | 8 + threadpool/TARGETS | 14 + threadpool/test/TARGETS | 8 + util/TARGETS | 6 + util/test/TARGETS | 8 + 112 files changed, 3774 insertions(+) create mode 100644 backends/TARGETS create mode 100644 backends/canonical_partitioners/TARGETS create mode 100644 backends/qnnpack/TARGETS create mode 100644 backends/qnnpack/partition/TARGETS create mode 100644 backends/qnnpack/test/TARGETS create mode 100644 backends/test/TARGETS create mode 100644 backends/test/demos/TARGETS create mode 100644 backends/test/demos/rpc/TARGETS create mode 100644 backends/transforms/TARGETS create mode 100644 backends/vulkan/TARGETS create mode 100644 backends/vulkan/serialization/schema/TARGETS create mode 100644 backends/vulkan/test/TARGETS create mode 100644 backends/xnnpack/TARGETS create mode 100644 backends/xnnpack/operators/TARGETS create mode 100644 backends/xnnpack/partition/TARGETS create mode 100644 backends/xnnpack/passes/TARGETS create mode 100644 backends/xnnpack/test/TARGETS create mode 100644 backends/xnnpack/utils/TARGETS create mode 100644 bundled_program/TARGETS create mode 100644 bundled_program/serialize/TARGETS create mode 100644 bundled_program/tests/TARGETS create mode 100644 codegen/TARGETS create mode 100644 codegen/tools/TARGETS create mode 100644 configurations/TARGETS create mode 100644 core/TARGETS create mode 100644 core/kernel_types/TARGETS create mode 100644 core/kernel_types/test/TARGETS create mode 100644 core/kernel_types/testing/TARGETS create mode 100644 core/kernel_types/util/TARGETS create mode 100644 core/kernel_types/util/test/TARGETS create mode 100644 core/prim_ops/TARGETS create mode 100644 core/prim_ops/test/TARGETS create mode 100644 core/values/TARGETS create mode 100644 core/values/test/TARGETS create mode 100644 docs/TARGETS create mode 100644 executor/TARGETS create mode 100644 executor/test/TARGETS create mode 100644 exir/TARGETS create mode 100644 exir/dialects/TARGETS create mode 100644 exir/dialects/backend/TARGETS create mode 100644 exir/dialects/backend/test/TARGETS create mode 100644 exir/dialects/edge/TARGETS create mode 100644 exir/dialects/edge/test/TARGETS create mode 100644 exir/dialects/test/TARGETS create mode 100644 exir/emit/TARGETS create mode 100644 exir/emit/test/TARGETS create mode 100644 exir/experimental/TARGETS create mode 100644 exir/operator/TARGETS create mode 100644 exir/pass_infra/TARGETS create mode 100644 exir/passes/TARGETS create mode 100644 exir/scripts/TARGETS create mode 100644 exir/serde/TARGETS create mode 100644 exir/serialize/TARGETS create mode 100644 exir/serialize/test/TARGETS create mode 100644 exir/tests/TARGETS create mode 100644 exir/tests/fixtures/TARGETS create mode 100644 exir/verification/TARGETS create mode 100644 kernels/aten/TARGETS create mode 100644 kernels/aten/test/TARGETS create mode 100644 kernels/optimized/TARGETS create mode 100644 kernels/optimized/cpu/TARGETS create mode 100644 kernels/optimized/test/TARGETS create mode 100644 kernels/portable/TARGETS create mode 100644 kernels/portable/cpu/TARGETS create mode 100644 kernels/portable/cpu/pattern/TARGETS create mode 100644 kernels/portable/cpu/test/TARGETS create mode 100644 kernels/portable/cpu/util/TARGETS create mode 100644 kernels/portable/cpu/util/test/TARGETS create mode 100644 kernels/portable/test/TARGETS create mode 100644 kernels/quantized/TARGETS create mode 100644 kernels/quantized/cpu/TARGETS create mode 100644 kernels/quantized/test/TARGETS create mode 100644 kernels/test/TARGETS create mode 100644 kernels/test/custom_kernel_example/TARGETS create mode 100644 profiler/TARGETS create mode 100644 profiler/test/TARGETS create mode 100644 pybindings/TARGETS create mode 100644 pybindings/test/TARGETS create mode 100644 pytree/TARGETS create mode 100644 pytree/test/TARGETS create mode 100644 runtime/backend/TARGETS create mode 100644 runtime/backend/test/TARGETS create mode 100644 runtime/core/TARGETS create mode 100644 runtime/core/portable_type/TARGETS create mode 100644 runtime/core/portable_type/test/TARGETS create mode 100644 runtime/core/test/TARGETS create mode 100644 runtime/kernel/TARGETS create mode 100644 runtime/kernel/test/TARGETS create mode 100644 runtime/platform/TARGETS create mode 100644 runtime/platform/test/TARGETS create mode 100644 schema/TARGETS create mode 100644 schema/test/TARGETS create mode 100644 scripts/size_monitoring/TARGETS create mode 100644 sdk/TARGETS create mode 100644 sdk/edir/TARGETS create mode 100644 sdk/edir/tests/TARGETS create mode 100644 sdk/etdb/TARGETS create mode 100644 sdk/etdump/TARGETS create mode 100644 sdk/etdump/tests/TARGETS create mode 100644 sdk/etrecord/TARGETS create mode 100644 sdk/etrecord/tests/TARGETS create mode 100644 sdk/experimental/TARGETS create mode 100644 sdk/visualizer/TARGETS create mode 100644 sdk/visualizer/tests/TARGETS create mode 100644 test/TARGETS create mode 100644 test/end2end/TARGETS create mode 100644 test/models/TARGETS create mode 100644 test/utils/TARGETS create mode 100644 threadpool/TARGETS create mode 100644 threadpool/test/TARGETS create mode 100644 util/TARGETS create mode 100644 util/test/TARGETS diff --git a/backends/TARGETS b/backends/TARGETS new file mode 100644 index 00000000000..f4dbc03ad02 --- /dev/null +++ b/backends/TARGETS @@ -0,0 +1,107 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load(":backends.bzl", "get_all_cpu_aot_and_backend_targets") +load(":targets.bzl", "define_common_targets") + +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 = [ + "//executorch/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + ":backend_details", + ":compile_spec_schema", + "//caffe2:torch", + "//executorch/backends:utils", + ], +) + +runtime.python_library( + name = "compile_spec_schema", + srcs = [ + "compile_spec_schema.py", + ], + visibility = [ + "//executorch/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], +) + +runtime.python_library( + name = "partitioner", + srcs = [ + "partitioner.py", + ], + visibility = [ + "//executorch/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + ":compile_spec_schema", + "//caffe2:torch", + ], +) + +runtime.python_library( + name = "backend_details", + srcs = [ + "backend_details.py", + ], + visibility = [ + "//executorch/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + 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 = [ + "//executorch/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + ":backend_api", + ":backend_details", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + ] + get_all_cpu_aot_and_backend_targets(), +) + +runtime.python_library( + name = "utils", + srcs = [ + "utils.py", + ], + visibility = [ + "//executorch/...", + "//executorch/backends/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//caffe2:torch", + ], +) diff --git a/backends/canonical_partitioners/TARGETS b/backends/canonical_partitioners/TARGETS new file mode 100644 index 00000000000..144eeb8b9eb --- /dev/null +++ b/backends/canonical_partitioners/TARGETS @@ -0,0 +1,19 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.python_library( + name = "canonical_partitioner_lib", + srcs = [ + "duplicate_dequant_node_pass.py", + "pattern_op_partitioner.py", + ], + visibility = [ + "//executorch/...", + "//executorch/backends/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:partitioner", + ], +) diff --git a/backends/qnnpack/TARGETS b/backends/qnnpack/TARGETS new file mode 100644 index 00000000000..57e9faacee7 --- /dev/null +++ b/backends/qnnpack/TARGETS @@ -0,0 +1,26 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load(":targets.bzl", "define_common_targets") + +define_common_targets() + +runtime.python_library( + name = "qnnpack_preprocess", + srcs = [ + "qnnpack_preprocess.py", + "serialization/qnnpack_graph_schema.py", + "serialization/qnnpack_graph_serialize.py", + ], + resources = [ + "serialization/schema.fbs", + ], + visibility = [ + "//executorch/...", + ], + deps = [ + "//executorch/backends:backend_details", + "//executorch/backends/transforms:lib", + "//executorch/exir:graph_module", + "//executorch/exir/serialize:bindings", + "//executorch/exir/serialize:lib", + ], +) diff --git a/backends/qnnpack/partition/TARGETS b/backends/qnnpack/partition/TARGETS new file mode 100644 index 00000000000..300ebce49e3 --- /dev/null +++ b/backends/qnnpack/partition/TARGETS @@ -0,0 +1,38 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.python_library( + name = "support_patterns", + srcs = [ + "support_patterns.py", + ], + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:utils", + "//executorch/backends/transforms:lib", + ], +) + +runtime.python_library( + name = "qnnpack_partitioner", + srcs = [ + "qnnpack_partitioner.py", + ], + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + ":support_patterns", + "//executorch/backends:partitioner", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/backends/qnnpack:qnnpack_preprocess", + "//executorch/backends/transforms:lib", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/exir:delegate", + "//executorch/exir:lib", + ], +) diff --git a/backends/qnnpack/test/TARGETS b/backends/qnnpack/test/TARGETS new file mode 100644 index 00000000000..e6a77147103 --- /dev/null +++ b/backends/qnnpack/test/TARGETS @@ -0,0 +1,47 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load(":targets.bzl", "define_common_targets") + +define_common_targets() + +python_unittest( + name = "test_qnnpack", + srcs = [ + "test_qnnpack.py", + ], + preload_deps = [ + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], + supports_static_listing = True, + tags = ["long_running"], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/qnnpack:qnnpack_backend", + "//executorch/backends/qnnpack:qnnpack_preprocess", + "//executorch/backends/qnnpack/partition:qnnpack_partitioner", + "//executorch/exir:lib", + "//executorch/exir/serialize:lib", + "//executorch/pybindings:portable", # @manual + "//executorch/pytree:pylib", + ], +) + +python_unittest( + name = "test_qnnpack_partitioner", + srcs = [ + "test_qnnpack_partitioner.py", + ], + preload_deps = [ + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], + supports_static_listing = True, + tags = ["long_running"], + deps = [ + "//caffe2:torch", + "//executorch/backends/qnnpack:qnnpack_backend", + "//executorch/backends/qnnpack/partition:support_patterns", + "//executorch/backends/transforms:lib", + "//executorch/exir:lib", + "//executorch/pybindings:portable", # @manual + ], +) diff --git a/backends/test/TARGETS b/backends/test/TARGETS new file mode 100644 index 00000000000..9689bc2e075 --- /dev/null +++ b/backends/test/TARGETS @@ -0,0 +1,169 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +oncall("executorch") + +python_library( + name = "backend_with_compiler_demo", + srcs = [ + "backend_with_compiler_demo.py", + ], + visibility = [ + "//executorch/...", + "//executorch/test/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_details", + "//executorch/backends:compile_spec_schema", + ], +) + +python_library( + name = "qnn_backend_demo", + srcs = [ + "qnn_backend_demo.py", + ], + visibility = [ + "//executorch/...", + "//executorch/test/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_details", + "//executorch/backends:compile_spec_schema", + ], +) + +python_library( + name = "hta_partitioner_demo", + srcs = [ + "hta_partitioner_demo.py", + ], + visibility = [ + "//executorch/...", + "//executorch/test/...", + ], + deps = [ + ":qnn_backend_demo", + "//caffe2:torch", + "//executorch/backends:partitioner", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir:lib", + ], +) + +python_library( + name = "op_partitioner_demo", + srcs = [ + "op_partitioner_demo.py", + ], + visibility = [ + "//executorch/...", + "//executorch/test/...", + ], + deps = [ + ":backend_with_compiler_demo", + "//caffe2:torch", + "//executorch/backends:compile_spec_schema", + "//executorch/backends:partitioner", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir:graph_module", + ], +) + +python_library( + name = "example_backends", + deps = [ + ":backend_with_compiler_demo", + ":qnn_backend_demo", + ], +) + +python_unittest( + name = "test_backends", + srcs = [ + "test_backends.py", + ], + supports_static_listing = True, + deps = [ + ":backend_with_compiler_demo", + ":hta_partitioner_demo", + ":op_partitioner_demo", + ":qnn_backend_demo", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/backends:backend_api", + "//executorch/backends:compile_spec_schema", + "//executorch/backends:partitioner", + "//executorch/executor/test:test_backend_compiler_lib", + "//executorch/exir:delegate", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir:print_program", + "//executorch/exir:schema", + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/kernels/quantized:custom_ops_generated_lib", + "//executorch/pybindings:portable", # @manual + "//executorch/pytree:pylib", + ], +) + +python_unittest( + name = "test_graph_partition", + srcs = [ + "test_graph_partition.py", + ], + supports_static_listing = True, + visibility = [ + "//executorch/...", + "//executorch/test/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir:lib", + ], +) + +python_unittest( + name = "test_backends_nested", + srcs = [ + "test_backends_nested.py", + ], + supports_static_listing = True, + deps = [ + ":op_partitioner_demo", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/backends:backend_api", + "//executorch/backends:backend_details", + "//executorch/backends:compile_spec_schema", + "//executorch/backends:partitioner", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/executor/test:test_backend_compiler_lib", + "//executorch/exir:delegate", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], +) + +python_unittest( + name = "test_utils", + srcs = [ + "test_utils.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends:partitioner", + "//executorch/backends:utils", + "//executorch/executor/test:test_backend_compiler_lib", + "//executorch/exir:lib", + "//executorch/exir/dialects:lib", + "//executorch/pybindings:portable", # @manual + ], +) diff --git a/backends/test/demos/TARGETS b/backends/test/demos/TARGETS new file mode 100644 index 00000000000..8c61667bead --- /dev/null +++ b/backends/test/demos/TARGETS @@ -0,0 +1,47 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +python_unittest( + name = "test_xnnpack_qnnpack", + srcs = [ + "test_xnnpack_qnnpack.py", + ], + preload_deps = [ + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/qnnpack:qnnpack_backend", + "//executorch/backends/qnnpack:qnnpack_preprocess", + "//executorch/backends/qnnpack/partition:qnnpack_partitioner", + "//executorch/backends/xnnpack:xnnpack_backend", + "//executorch/backends/xnnpack:xnnpack_preprocess", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/exir:lib", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/pybindings:portable", # @manual + "//executorch/pytree:pylib", + ], +) + +python_unittest( + name = "test_delegate_aten_mode", + srcs = [ + "test_delegate_aten_mode.py", + ], + preload_deps = [ + "//executorch/kernels/portable:custom_ops_generated_lib_aten", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends:compile_spec_schema", + "//executorch/backends/test:backend_with_compiler_demo", + "//executorch/exir:lib", + "//executorch/pybindings:aten_mode_lib", # @manual + "//executorch/pytree:pylib", + ], +) diff --git a/backends/test/demos/rpc/TARGETS b/backends/test/demos/rpc/TARGETS new file mode 100644 index 00000000000..77ef027fe79 --- /dev/null +++ b/backends/test/demos/rpc/TARGETS @@ -0,0 +1,58 @@ +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", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_details", + "//executorch/backends:compile_spec_schema", + "//executorch/exir:lib", + "//nodeapi/py:base", + ], +) + +runtime.python_library( + name = "executor_backend_partitioner", + srcs = [ + "executor_backend_partitioner.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:partitioner", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + ], +) + +python_unittest( + name = "test_rpc", + srcs = [ + "test_rpc.py", + ], + preload_deps = [ + "//executorch/kernels/portable:custom_ops_generated_lib", + "//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/backends/test/demos/rpc:executor_backend") + # However, it's a better practice to build/link everything at earlier stage, instead of during runtime + "//executorch/backends/test/demos/rpc:executor_backend_register", + ], + supports_static_listing = True, + deps = [ + ":executor_backend_partitioner", + ":executor_backend_preprocess", + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/test:op_partitioner_demo", + "//executorch/exir:lib", + "//executorch/pybindings:portable", # @manual + ], +) diff --git a/backends/transforms/TARGETS b/backends/transforms/TARGETS new file mode 100644 index 00000000000..93143de73b0 --- /dev/null +++ b/backends/transforms/TARGETS @@ -0,0 +1,24 @@ +#load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + visibility = [ + "//executorch/backends/...", + ], + deps = [ + ":addmm_mm_to_linear", + ], +) + +python_library( + name = "addmm_mm_to_linear", + srcs = ["addmm_mm_to_linear.py"], + deps = [ + "//caffe2:torch", + "//executorch/exir:sym_util", + ], +) diff --git a/backends/vulkan/TARGETS b/backends/vulkan/TARGETS new file mode 100644 index 00000000000..c5b85c5d756 --- /dev/null +++ b/backends/vulkan/TARGETS @@ -0,0 +1,44 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.cxx_library( + name = "vulkan_backend_lib", + srcs = [ + "VulkanBackend.cpp", + ], + # VulkanBackend.cpp needs to compile with executor as whole + # @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole) + link_whole = True, + visibility = [ + "//executorch/backends/...", + "//executorch/pybindings/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//caffe2:torch_vulkan_graph", + "//executorch/backends/vulkan/serialization/schema:vk_delegate_schema", + "//executorch/runtime/backend:backend_registry", + ], +) + +runtime.python_library( + name = "vulkan_preprocess", + srcs = [ + "serialization/vulkan_graph_schema.py", + "serialization/vulkan_graph_serialize.py", + "vulkan_preprocess.py", + ], + resources = { + "//executorch/backends/vulkan/serialization/schema:vk_schema_file": "serialization/schema.fbs", + }, + visibility = [ + "//executorch/...", + "//executorch/vulkan/...", + ], + deps = [ + "//executorch/backends:backend_details", + "//executorch/exir:graph_module", + "//executorch/exir/serialize:bindings", + "//executorch/exir/serialize:lib", + ], +) diff --git a/backends/vulkan/serialization/schema/TARGETS b/backends/vulkan/serialization/schema/TARGETS new file mode 100644 index 00000000000..4db02d74436 --- /dev/null +++ b/backends/vulkan/serialization/schema/TARGETS @@ -0,0 +1,43 @@ +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") +load("@fbcode_macros//build_defs:export_files.bzl", "export_file") +load("@fbcode_macros//build_defs:native_rules.bzl", "buck_genrule") + +export_file( + name = "vk_schema_file", + src = "schema.fbs", + visibility = ["//executorch/backends/vulkan/..."], +) + +buck_genrule( + name = "gen_vk_delegate_schema", + srcs = [ + "schema.fbs", + ], + # We're only generating a single file, so it seems like we could use + # `out`, but `flatc` takes a directory as a parameter, not a single + # file. Use `outs` so that `${OUT}` is expanded as the containing + # directory instead of the file itself. + outs = { + "schema_generated.h": ["schema_generated.h"], + }, + cmd = " ".join([ + "$(exe fbsource//third-party/flatbuffers/fbsource_namespace:flatc)", + "--cpp", + "--cpp-std c++11", + "--scoped-enums", + "-o ${OUT}", + "${SRCS}", + ]), + default_outs = ["."], + visibility = ["//executorch/backends/vulkan/serialization/schema:vk_delegate_schema"], +) + +cpp_library( + name = "vk_delegate_schema", + headers = { + "schema_generated.h": ":gen_vk_delegate_schema[schema_generated.h]", + }, + exported_deps = [ + "fbsource//third-party/flatbuffers/fbsource_namespace:flatbuffers-api", # @manual: Generated header file includes "flatbuffers_fbsource/flatbuffers.h" + ], +) diff --git a/backends/vulkan/test/TARGETS b/backends/vulkan/test/TARGETS new file mode 100644 index 00000000000..5e4d93b6f0e --- /dev/null +++ b/backends/vulkan/test/TARGETS @@ -0,0 +1,23 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +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", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/vulkan:vulkan_preprocess", + "//executorch/executor/test:test_backend_compiler_lib", + "//executorch/exir:lib", + "//executorch/exir/serialize:lib", + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/pybindings:portable", # @manual + "//executorch/pytree:pylib", + ], +) diff --git a/backends/xnnpack/TARGETS b/backends/xnnpack/TARGETS new file mode 100644 index 00000000000..716546ea7e4 --- /dev/null +++ b/backends/xnnpack/TARGETS @@ -0,0 +1,29 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load(":targets.bzl", "define_common_targets") + +define_common_targets() + +runtime.python_library( + name = "xnnpack_preprocess", + srcs = [ + "serialization/xnnpack_graph_schema.py", + "serialization/xnnpack_graph_serialize.py", + "xnnpack_preprocess.py", + ], + resources = [ + "serialization/schema.fbs", + ], + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//executorch/backends:backend_details", + "//executorch/backends/transforms:lib", + "//executorch/backends/xnnpack/operators:operators", + "//executorch/backends/xnnpack/passes:xnnpack_passes", + "//executorch/exir:graph_module", + "//executorch/exir/serialize:bindings", + "//executorch/exir/serialize:lib", + ], +) diff --git a/backends/xnnpack/operators/TARGETS b/backends/xnnpack/operators/TARGETS new file mode 100644 index 00000000000..8203758725a --- /dev/null +++ b/backends/xnnpack/operators/TARGETS @@ -0,0 +1,17 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.python_library( + name = "operators", + srcs = glob(["*.py"]), + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//executorch/backends:backend_details", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + "//executorch/exir:graph_module", + "//executorch/exir/serialize:bindings", + "//executorch/exir/serialize:lib", + ], +) diff --git a/backends/xnnpack/partition/TARGETS b/backends/xnnpack/partition/TARGETS new file mode 100644 index 00000000000..434695236f1 --- /dev/null +++ b/backends/xnnpack/partition/TARGETS @@ -0,0 +1,36 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.python_library( + name = "support_patterns", + srcs = [ + "support_patterns.py", + ], + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends:utils", + ], +) + +runtime.python_library( + name = "xnnpack_partitioner", + srcs = [ + "xnnpack_partitioner.py", + ], + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + ":support_patterns", + "//executorch/backends:partitioner", + "//executorch/backends:utils", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/backends/xnnpack:xnnpack_preprocess", + "//executorch/exir:delegate", + "//executorch/exir:lib", + ], +) diff --git a/backends/xnnpack/passes/TARGETS b/backends/xnnpack/passes/TARGETS new file mode 100644 index 00000000000..070211bdc15 --- /dev/null +++ b/backends/xnnpack/passes/TARGETS @@ -0,0 +1,23 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "xnnpack_passes", + srcs = [ + "__init__.py", + "channels_last_tagged_reshape_pass.py", + "conv1d_unsqueeze_pass.py", + "convert_to_linear.py", + "fuse_batch_norm_with_conv.py", + "prelu_reshape_pass.py", + "remove_getitem_op.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/backends/transforms:lib", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + "//executorch/exir:pass_base", + "//executorch/exir/dialects:lib", + "//executorch/exir/passes:const_prop_pass", + "//executorch/exir/passes:lib", + ], +) diff --git a/backends/xnnpack/test/TARGETS b/backends/xnnpack/test/TARGETS new file mode 100644 index 00000000000..362c6325615 --- /dev/null +++ b/backends/xnnpack/test/TARGETS @@ -0,0 +1,113 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +python_unittest( + name = "test_xnnpack", + srcs = [ + "test_xnnpack.py", + "test_xnnpack_utils.py", + "test_xnnpack_utils_classes.py", + ], + preload_deps = [ + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], + supports_static_listing = True, + tags = ["long_running"], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/xnnpack:xnnpack_backend", + "//executorch/backends/xnnpack:xnnpack_preprocess", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + "//executorch/bundled_program:config", + "//executorch/bundled_program:core", + "//executorch/bundled_program/serialize:lib", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/exir/serialize:lib", + "//executorch/pybindings:portable", # @manual + "//executorch/pytree:pylib", + ], +) + +python_unittest( + name = "test_xnnpack_quantized", + srcs = [ + "test_xnnpack_quantized.py", + "test_xnnpack_utils.py", + ], + preload_deps = [ + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], + supports_static_listing = True, + tags = ["long_running"], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/xnnpack:xnnpack_backend", + "//executorch/backends/xnnpack:xnnpack_preprocess", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + "//executorch/bundled_program:config", + "//executorch/bundled_program:core", + "//executorch/bundled_program/serialize:lib", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir/dialects:lib", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/exir/serialize:lib", + "//executorch/pybindings:portable", # @manual + "//executorch/pytree:pylib", + ], +) + +python_unittest( + name = "test_xnnpack_quantized_models", + srcs = [ + "test_xnnpack_quantized_models.py", + "test_xnnpack_utils.py", + ], + preload_deps = [ + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], + supports_static_listing = True, + tags = ["long_running"], + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/xnnpack:xnnpack_backend", + "//executorch/backends/xnnpack:xnnpack_preprocess", + "//executorch/backends/xnnpack/partition:xnnpack_partitioner", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + "//executorch/bundled_program:config", + "//executorch/bundled_program:core", + "//executorch/bundled_program/serialize:lib", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/exir/serialize:lib", + "//executorch/pybindings:portable", # @manual + "//executorch/pytree:pylib", + "//pytorch/vision:torchvision", + ], +) + +python_unittest( + name = "test_xnnpack_passes", + srcs = [ + "test_xnnpack_passes.py", + "test_xnnpack_utils_classes.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/backends/xnnpack/passes:xnnpack_passes", + "//executorch/backends/xnnpack/utils:xnnpack_utils", + "//executorch/exir:lib", + ], +) diff --git a/backends/xnnpack/utils/TARGETS b/backends/xnnpack/utils/TARGETS new file mode 100644 index 00000000000..67d1bd714d1 --- /dev/null +++ b/backends/xnnpack/utils/TARGETS @@ -0,0 +1,31 @@ +load("@fbcode_macros//build_defs:native_rules.bzl", "buck_genrule") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +buck_genrule( + name = "xnnpack_constants", + srcs = { + "xnnpack.h": "//xplat/third-party/XNNPACK:xnnpack.h", + }, + outs = { + "xnnpack_constants.py": ["xnnpack_constants.py"], + }, + cmd = " && ".join([ + "echo UINT32_MAX = 4294967295 > ${OUT}/xnnpack_constants.py", + "awk '/^#define\\s+XNN_/ { print $2,\"=\",$3} ' xnnpack.h >> ${OUT}/xnnpack_constants.py", + "if ! grep -qc \"^XNN_\" ${OUT}/xnnpack_constants.py; then false; fi", + ]), + visibility = [ + "//executorch/backends/xnnpack/utils:xnnpack_utils", + ], +) + +python_library( + name = "xnnpack_utils", + srcs = glob(["*.py"]) + [":xnnpack_constants[xnnpack_constants.py]"], + deps = [ + "//caffe2:torch", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir:lib", + "//executorch/exir/dialects:lib", + ], +) diff --git a/bundled_program/TARGETS b/bundled_program/TARGETS new file mode 100644 index 00000000000..704412f17e0 --- /dev/null +++ b/bundled_program/TARGETS @@ -0,0 +1,49 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "core", + srcs = [ + "core.py", + ], + deps = [ + ":config", + ":schema", + ":version", + "//caffe2:torch", + "//executorch/exir:schema", + "//executorch/exir:tensor", + "//executorch/exir/serialize:lib", + ], +) + +python_library( + name = "config", + srcs = [ + "config.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + "//caffe2:torch", + "//executorch/bundled_program:schema", + "//executorch/pytree:pylib", + ], +) + +python_library( + name = "schema", + srcs = [ + "schema.py", + ], + deps = [ + "//executorch/exir:scalar_type", + ], +) + +python_library( + name = "version", + srcs = [ + "version.py", + ], +) diff --git a/bundled_program/serialize/TARGETS b/bundled_program/serialize/TARGETS new file mode 100644 index 00000000000..ca8828fbf3a --- /dev/null +++ b/bundled_program/serialize/TARGETS @@ -0,0 +1,38 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +oncall("executorch") + +# 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 = "lib", + srcs = [ + "__init__.py", + ], + resources = { + "//executorch/schema:bundled_program_schema.fbs": "bundled_program_schema.fbs", + "//executorch/schema:scalar_type.fbs": "scalar_type.fbs", + }, + # Currently serialization API should only be used in some dedicated targets, + # to avoid ODR violation when linking with another Flatbuffers library. + # Please ask before changing this. + visibility = [ + "//executorch/bacends/...", + "//executorch/backends/xnnpack/test/...", + "//executorch/bundled_program/tests/...", + "//executorch/codegen/...", + "//executorch/examples/async_exec:emit_program_lib", + "//executorch/exir:lib", + "//executorch/profiler/...", + "//executorch/pybindings/test:test", + "//executorch/pybindings/test:test-library", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "fbsource//third-party/pypi/setuptools:setuptools", + "//executorch/bundled_program:schema", + "//executorch/exir/serialize:bindings", + "//executorch/exir/serialize:lib", + ], +) diff --git a/bundled_program/tests/TARGETS b/bundled_program/tests/TARGETS new file mode 100644 index 00000000000..bc7e4a00596 --- /dev/null +++ b/bundled_program/tests/TARGETS @@ -0,0 +1,64 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +oncall("executorch") + +python_library( + name = "lib", + srcs = [ + "common.py", + ], + visibility = [], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + "//caffe2:torch", + "//executorch/bundled_program:config", + "//executorch/exir:lib", + "//executorch/exir:schema", + ], +) + +python_unittest( + name = "bundle_data", + srcs = [ + "test_bundle_data.py", + ], + supports_static_listing = True, + deps = [ + ":lib", + "//caffe2:torch", + "//executorch/bundled_program:config", + "//executorch/bundled_program:core", + "//executorch/bundled_program:schema", + "//executorch/exir/serialize:lib", + ], +) + +python_unittest( + name = "serialize", + srcs = [ + "test_serialize.py", + ], + supports_static_listing = True, + deps = [ + ":lib", + "//executorch/bundled_program:core", + "//executorch/bundled_program/serialize:lib", + "//executorch/exir:print_program", + ], +) + +python_unittest( + name = "config", + srcs = [ + "test_config.py", + ], + supports_static_listing = True, + deps = [ + ":lib", + "//caffe2:torch", + "//executorch/bundled_program:config", + "//executorch/bundled_program:schema", + "//executorch/pytree:pylib", + ], +) diff --git a/codegen/TARGETS b/codegen/TARGETS new file mode 100644 index 00000000000..0a42614a385 --- /dev/null +++ b/codegen/TARGETS @@ -0,0 +1,5 @@ +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() diff --git a/codegen/tools/TARGETS b/codegen/tools/TARGETS new file mode 100644 index 00000000000..e82b089dec6 --- /dev/null +++ b/codegen/tools/TARGETS @@ -0,0 +1,55 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() + +python_binary( + name = "gen_functions_yaml", + srcs = ["gen_ops_def.py"], + main_module = "executorch.codegen.tools.gen_ops_def", + package_style = "inplace", + visibility = ["PUBLIC"], + deps = [ + "fbsource//third-party/pypi/pyyaml:pyyaml", + ":yaml_util", + "//caffe2:torch", + "//executorch/exir:schema", + "//executorch/exir/serialize:lib", + ], +) + +python_library( + # @autodeps-skip + name = "gen_oplist_lib", + srcs = ["gen_oplist.py"], + base_module = "executorch.codegen.tools", + visibility = [ + "//executorch/...", + ], + deps = [ + "//caffe2/torchgen:torchgen", + ] + select({ + "DEFAULT": [], + "ovr_config//os:linux": ["//executorch/pybindings:operator"], + }), +) + +python_unittest( + name = "test_gen_oplist_real_model", + srcs = ["test/test_gen_oplist_real_model.py"], + base_module = "", + resources = { + "//executorch/test/models:exported_programs[ModuleLinear.ff]": "test/ModuleLinear.ff", + }, + visibility = [ + "//executorch/...", + ], + deps = [ + ":gen_oplist_lib", + "//libfb/py:parutil", + ], +) diff --git a/configurations/TARGETS b/configurations/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/configurations/TARGETS @@ -0,0 +1,8 @@ +# 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/core/TARGETS b/core/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/core/kernel_types/TARGETS b/core/kernel_types/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/kernel_types/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/core/kernel_types/test/TARGETS b/core/kernel_types/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/kernel_types/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/core/kernel_types/testing/TARGETS b/core/kernel_types/testing/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/kernel_types/testing/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/core/kernel_types/util/TARGETS b/core/kernel_types/util/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/kernel_types/util/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/core/kernel_types/util/test/TARGETS b/core/kernel_types/util/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/kernel_types/util/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/core/prim_ops/TARGETS b/core/prim_ops/TARGETS new file mode 100644 index 00000000000..ba6a189c006 --- /dev/null +++ b/core/prim_ops/TARGETS @@ -0,0 +1,27 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() + +python_library( + name = "prim_ops_py_registry", + srcs = ["executorch_prim_ops_registry.py"], + deps = [ + "//caffe2:torch", + "//executorch/exir/dialects:lib", + ], +) + +python_library( + name = "prim_to_executorch_ops", + srcs = ["prim_to_executorch_ops.py"], + deps = [ + ":prim_ops_py_registry", + "//caffe2:torch", + "//executorch/exir/dialects:lib", + ], +) diff --git a/core/prim_ops/test/TARGETS b/core/prim_ops/test/TARGETS new file mode 100644 index 00000000000..2441c272737 --- /dev/null +++ b/core/prim_ops/test/TARGETS @@ -0,0 +1,20 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() + +python_unittest( + name = "test_prim_ops", + srcs = [ + "test_prim_ops.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/core/prim_ops:prim_ops_py_registry", + ], +) diff --git a/core/values/TARGETS b/core/values/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/values/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/core/values/test/TARGETS b/core/values/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/core/values/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/docs/TARGETS b/docs/TARGETS new file mode 100644 index 00000000000..78659738010 --- /dev/null +++ b/docs/TARGETS @@ -0,0 +1,26 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") + +oncall("executorch") + +python_binary( + # @autodeps-skip + name = "sphinx-build", + main_module = "sphinx.cmd.build", + deps = [ + "fbsource//third-party/pypi/breathe:breathe", + "fbsource//third-party/pypi/exhale:exhale", + "fbsource//third-party/pypi/pytorch-sphinx-theme:pytorch-sphinx-theme", + "fbsource//third-party/pypi/sphinx:sphinx", + "//executorch/exir:lib", + ], +) + +python_binary( + # @autodeps-skip + name = "sphinx-apidoc", + main_module = "sphinx.ext.apidoc", + deps = [ + "fbsource//third-party/pypi/pytorch-sphinx-theme:pytorch-sphinx-theme", + "fbsource//third-party/pypi/sphinx:sphinx", + ], +) diff --git a/executor/TARGETS b/executor/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/executor/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/executor/test/TARGETS b/executor/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/executor/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/exir/TARGETS b/exir/TARGETS new file mode 100644 index 00000000000..305b66c55a5 --- /dev/null +++ b/exir/TARGETS @@ -0,0 +1,283 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "tracer", + srcs = [ + "tracer.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + ":common", + ":error", + ":graph_module", + ":types", + "//caffe2:torch", + "//executorch/exir/operator:convert", + "//executorch/pytree:pylib", + ], +) + +python_library( + name = "graph", + srcs = [ + "graph.py", + ], + deps = [ + ":tensor", + "//caffe2:torch", + ], +) + +python_library( + name = "graph_module", + srcs = [ + "graph_module.py", + ], + deps = [ + ":common", + ":error", + ":graph", + "//caffe2:torch", + ], +) + +python_library( + name = "scalar_type", + srcs = [ + "scalar_type.py", + ], +) + +python_library( + name = "schema", + srcs = [ + "schema.py", + ], + deps = [ + ":scalar_type", + "//executorch/backends:compile_spec_schema", + ], +) + +python_library( + name = "version", + srcs = [ + "version.py", + ], +) + +python_library( + name = "tensor", + srcs = [ + "tensor.py", + ], + deps = [ + ":error", + ":schema", + "//caffe2:torch", + "//executorch/exir:sym_util", + ], +) + +python_library( + name = "memory", + srcs = [ + "memory.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + ":tensor", + "//caffe2:torch", + "//executorch/exir:sym_util", + ], +) + +python_library( + name = "control_flow", + srcs = [ + "control_flow.py", + ], + deps = [ + ":error", + ":tracer", + ":wrap", + "//caffe2:torch", + ], +) + +python_library( + name = "delegate", + srcs = [ + "delegate.py", + ], + deps = [ + ":graph_module", + ":tracer", + "//caffe2:torch", + "//executorch/backends:compile_spec_schema", + ], +) + +python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + "fbsource//third-party/pypi/sympy:sympy", + ":common", # @manual + ":control_flow", # @manual + ":dynamic_shape", + ":error", + ":graph_module", + ":pass_base", # @manual + ":pass_manager", + ":schema", + ":tracer", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/bundled_program/serialize:lib", # @manual + "//executorch/exir/dialects:lib", # @manual + "//executorch/exir/emit:lib", + "//executorch/exir/passes:lib", + "//executorch/exir/passes:remove_assert_async_pass", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/exir/serialize:lib", + "//executorch/exir/verification:verifier", + ], +) + +# Please don't add "//executorch/pybindings:portable" here, runtime lib should be added separately. +python_library( + name = "bento_deps", + deps = [ + ":lib", + "//aibench/api:aibench_api", + "//executorch/backends:backend_lib", + "//executorch/backends/test:example_backends", + "//executorch/bundled_program:core", + "//executorch/exir/scripts:lib", + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/kernels/quantized:custom_ops_generated_lib", + "//executorch/profiler:parse_profiler_library", + "//executorch/sdk:lib", + ], +) + +python_library( + name = "memory_planning", + srcs = [ + "memory_planning.py", + ], + deps = [ + ":control_flow", + ":delegate", + ":error", + ":graph_module", + ":memory", + ":schema", + ":tensor", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/exir/operator:convert", + ], +) + +python_library( + name = "common", + srcs = [ + "common.py", + ], + deps = [ + "//caffe2:torch", + ], +) + +python_library( + name = "error", + srcs = [ + "error.py", + ], + deps = [], +) + +python_library( + name = "types", + srcs = [ + "types.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + ":tensor", + ], +) + +python_library( + name = "wrap", + srcs = [ + "wrap.py", + ], + deps = [ + ":tracer", + "//caffe2:torch", + "//caffe2/functorch:functorch", # @manual + ], +) + +python_library( + name = "print_program", + srcs = [ + "print_program.py", + ], + deps = [ + ":error", + ":schema", + "//caffe2:torch", + ], +) + +python_library( + name = "dynamic_shape", + srcs = [ + "dynamic_shape.py", + ], +) + +python_library( + name = "pass_base", + srcs = [ + "pass_base.py", + ], + deps = [ + ":delegate", + ":error", + ":graph_module", + ":memory", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/exir/dialects/edge:lib", + "//executorch/exir/pass_infra:node_metadata", + "//executorch/exir/pass_infra:proxy_value", + ], +) + +python_library( + name = "pass_manager", + srcs = [ + "pass_manager.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + ":error", + "//caffe2:torch", + ], +) + +python_library( + name = "sym_util", + srcs = ["sym_util.py"], + deps = [ + "fbsource//third-party/pypi/sympy:sympy", + "//caffe2:torch", + ], +) diff --git a/exir/dialects/TARGETS b/exir/dialects/TARGETS new file mode 100644 index 00000000000..0f4ffd0e610 --- /dev/null +++ b/exir/dialects/TARGETS @@ -0,0 +1,17 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "lib", + srcs = [ + "_ops.py", + ], + resources = { + "//executorch/exir/dialects/edge:edge_yaml": "edge.yaml", + }, + deps = [ + "//caffe2:torch", + "//caffe2/torchgen:torchgen", + "//executorch/exir/dialects/backend:lib", + "//executorch/exir/dialects/edge:lib", + ], +) diff --git a/exir/dialects/backend/TARGETS b/exir/dialects/backend/TARGETS new file mode 100644 index 00000000000..8d532cfe0e5 --- /dev/null +++ b/exir/dialects/backend/TARGETS @@ -0,0 +1,12 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +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/TARGETS new file mode 100644 index 00000000000..f3ada53f32b --- /dev/null +++ b/exir/dialects/backend/test/TARGETS @@ -0,0 +1,17 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +oncall("executorch") + +python_unittest( + name = "test_backend_ops", + srcs = [ + "test_backend_ops.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir/dialects:lib", + "//executorch/exir/dialects/backend:lib", + "//executorch/exir/dialects/edge:lib", + ], +) diff --git a/exir/dialects/edge/TARGETS b/exir/dialects/edge/TARGETS new file mode 100644 index 00000000000..eabf0e86ea1 --- /dev/null +++ b/exir/dialects/edge/TARGETS @@ -0,0 +1,83 @@ +load("@fbcode_macros//build_defs:export_files.bzl", "export_file") +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "yaml_generator_lib", + srcs = [ + "yaml_generator.py", + ], + deps = [ + "fbsource//third-party/pypi/ruamel-yaml:ruamel-yaml", + ":support_dtypes", + ":utils", + "//caffe2:test-lib", + "//caffe2:torch", + "//pye/lib:eager_model_base", + "//pye/model_inventory/asr_models/milan_dictation:milan_dictation_lib", + ], +) + +python_binary( + name = "yaml_generator", + srcs = [ + "yaml_generator.py", + ], + main_module = "executorch.exir.dialects.edge.yaml_generator", + deps = [ + "fbsource//third-party/pypi/ruamel-yaml:ruamel-yaml", + ":support_dtypes", + ":utils", + "//caffe2:test-lib", + "//caffe2:torch", + "//pye/lib:eager_model_base", + "//pye/model_inventory/asr_models/milan_dictation:milan_dictation_lib", + ], +) + +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", + ":support_dtypes", + ":utils", + "//caffe2:torch", + "//caffe2/torchgen:torchgen", + "//executorch/exir/operator:convert", + ], +) + +python_library( + name = "support_dtypes", + srcs = [ + "support_dtypes.py", + ], + deps = [ + "//caffe2:torch", + ], +) + +export_file( + name = "edge_yaml", + src = "edge.yaml", + visibility = ["//executorch/..."], +) + +python_library( + name = "utils", + srcs = [ + "utils.py", + ], + deps = [ + "//caffe2:torch", + ], +) diff --git a/exir/dialects/edge/test/TARGETS b/exir/dialects/edge/test/TARGETS new file mode 100644 index 00000000000..035443e070e --- /dev/null +++ b/exir/dialects/edge/test/TARGETS @@ -0,0 +1,33 @@ +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", + }, + supports_static_listing = True, + tags = ["long_running"], + deps = [ + "fbsource//third-party/pypi/ruamel-yaml:ruamel-yaml", + "//executorch/exir/dialects/edge:yaml_generator_lib", + "//pye/model_inventory/asr_models/milan_dictation:milan_dictation_lib", + ], +) + +python_unittest( + name = "test_edge_ops", + srcs = [ + "test_edge_ops.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir/dialects:lib", + "//executorch/exir/dialects/edge:lib", + ], +) diff --git a/exir/dialects/test/TARGETS b/exir/dialects/test/TARGETS new file mode 100644 index 00000000000..0b7c1479fdc --- /dev/null +++ b/exir/dialects/test/TARGETS @@ -0,0 +1,12 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +python_unittest( + name = "test_exir_dialect_ops", + srcs = [ + "test_exir_dialect_ops.py", + ], + supports_static_listing = True, + deps = [ + "//executorch/exir/dialects:lib", + ], +) diff --git a/exir/emit/TARGETS b/exir/emit/TARGETS new file mode 100644 index 00000000000..98690f00124 --- /dev/null +++ b/exir/emit/TARGETS @@ -0,0 +1,39 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + ":emit", + ], +) + +python_library( + name = "emit", + srcs = [ + "_emit_program.py", + "_emitter.py", + ], + deps = [ + "fbsource//third-party/pypi/typing-extensions:typing-extensions", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/core/prim_ops:prim_to_executorch_ops", + "//executorch/exir:common", + "//executorch/exir:delegate", + "//executorch/exir:error", + "//executorch/exir:graph_module", + "//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/pytree:pylib", + ], +) diff --git a/exir/emit/test/TARGETS b/exir/emit/test/TARGETS new file mode 100644 index 00000000000..75553216246 --- /dev/null +++ b/exir/emit/test/TARGETS @@ -0,0 +1,22 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +python_unittest( + name = "emit", + srcs = [ + "test_emit.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/exir:error", + "//executorch/exir:lib", + "//executorch/exir:print_program", + "//executorch/exir:schema", + "//executorch/exir:tracer", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:const_prop_pass", + "//executorch/exir/tests:lib", + "//executorch/exir/tests:models", + ], +) diff --git a/exir/experimental/TARGETS b/exir/experimental/TARGETS new file mode 100644 index 00000000000..3df95b56694 --- /dev/null +++ b/exir/experimental/TARGETS @@ -0,0 +1,23 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "export_pt2", + srcs = ["export_pt2.py"], + deps = [ + "//caffe2:torch", + "//executorch/exir:error", + "//executorch/exir:lib", + "//executorch/exir:tracer", + ], +) + +python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:tensor", + ], +) diff --git a/exir/operator/TARGETS b/exir/operator/TARGETS new file mode 100644 index 00000000000..148878b8daf --- /dev/null +++ b/exir/operator/TARGETS @@ -0,0 +1,25 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "convert", + srcs = [ + "convert.py", + ], + deps = [ + "//caffe2:torch", + "//caffe2/torchgen:torchgen", + ], +) + +python_library( + name = "manip", + srcs = [ + "manip.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:tensor", + ], +) diff --git a/exir/pass_infra/TARGETS b/exir/pass_infra/TARGETS new file mode 100644 index 00000000000..b31abf64117 --- /dev/null +++ b/exir/pass_infra/TARGETS @@ -0,0 +1,20 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "proxy_value", + srcs = ["proxy_value.py"], + deps = [ + "//caffe2:torch", + "//executorch/exir:error", + ], +) + +python_library( + name = "node_metadata", + srcs = ["node_metadata.py"], + deps = [ + "//executorch/exir:error", + ], +) diff --git a/exir/passes/TARGETS b/exir/passes/TARGETS new file mode 100644 index 00000000000..316066f276f --- /dev/null +++ b/exir/passes/TARGETS @@ -0,0 +1,246 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + deps = [ + ":const_prop_pass", + ":debug_handle_generator_pass", + ":memory_planning_pass", + ":normalize_transpose_pass", + ":pass_registry", + ":quant_fusion_pass", + ":remove_mixed_type_operators", + ":remove_noop_pass", + ":replace_aten_with_edge_pass", + ":replace_broken_ops_with_function_ops_pass", + ":replace_edge_with_backend_pass", + ":replace_sym_size_op_pass", + ":scalar_to_tensor_pass", + ":spec_prop_pass", + ":sym_shape_eval_pass", + "//caffe2:torch", + "//executorch/core/prim_ops:prim_to_executorch_ops", + "//executorch/exir:common", + "//executorch/exir:control_flow", + "//executorch/exir:delegate", + "//executorch/exir:dynamic_shape", + "//executorch/exir:error", + "//executorch/exir:memory", + "//executorch/exir:memory_planning", + "//executorch/exir:pass_base", + "//executorch/exir:pass_manager", + "//executorch/exir/dialects/backend:lib", + "//executorch/exir/dialects/edge:lib", + "//executorch/exir/operator:convert", + ], +) + +python_library( + name = "pass_registry", + srcs = [ + "pass_registry.py", + ], + deps = [ + "//executorch/exir:error", + "//executorch/exir:pass_manager", + ], +) + +python_library( + name = "const_prop_pass", + srcs = [ + "const_prop_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + "//executorch/exir/dialects:lib", + ], +) + +python_library( + name = "scalar_to_tensor_pass", + srcs = [ + "scalar_to_tensor_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "remove_assert_async_pass", + srcs = [ + "remove_assert_async_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "symint_to_tensor_pass", + srcs = [ + "symint_to_tensor_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "quant_fusion_pass", + srcs = [ + "_quant_patterns_and_replacements.py", + "quant_fusion_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + "//executorch/exir/dialects:lib", + ], +) + +python_library( + name = "memory_planning_pass", + srcs = [ + "memory_planning_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:error", + "//executorch/exir:memory", + "//executorch/exir:memory_planning", + "//executorch/exir:pass_base", + "//executorch/exir:tensor", + "//executorch/exir/operator:convert", + ], +) + +python_library( + name = "remove_noop_pass", + srcs = [ + "remove_noop_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "remove_mixed_type_operators", + srcs = [ + "remove_mixed_type_operators.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "spec_prop_pass", + srcs = [ + "spec_prop_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:pass_base", + "//executorch/exir:tensor", + ], +) + +python_library( + name = "sym_shape_eval_pass", + srcs = [ + "sym_shape_eval_pass.py", + ], + deps = [ + "fbsource//third-party/pypi/sympy:sympy", + "//caffe2:torch", + "//executorch/exir:pass_base", + "//executorch/exir:sym_util", + "//executorch/exir:tensor", + ], +) + +python_library( + name = "replace_broken_ops_with_function_ops_pass", + srcs = [ + "replace_broken_ops_with_function_ops_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "replace_sym_size_op_pass", + srcs = [ + "replace_sym_size_op_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "replace_edge_with_backend_pass", + srcs = [ + "replace_edge_with_backend_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/core/prim_ops:prim_to_executorch_ops", + "//executorch/exir:pass_base", + "//executorch/exir/dialects:lib", + ], +) + +python_library( + name = "normalize_transpose_pass", + srcs = [ + "normalize_transpose_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) + +python_library( + name = "replace_aten_with_edge_pass", + srcs = [ + "replace_aten_with_edge_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/core/prim_ops:prim_to_executorch_ops", + "//executorch/exir:pass_base", + "//executorch/exir/dialects:lib", + "//executorch/exir/dialects/edge:lib", + ], +) + +python_library( + name = "debug_handle_generator_pass", + srcs = [ + "debug_handle_generator_pass.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) diff --git a/exir/scripts/TARGETS b/exir/scripts/TARGETS new file mode 100644 index 00000000000..97aae7b5021 --- /dev/null +++ b/exir/scripts/TARGETS @@ -0,0 +1,37 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("//antlir/fbpkg:fbpkg.bzl", "fbpkg") + +python_binary( + name = "serialize", + srcs = [ + "serialize.py", + ], + main_module = "executorch.exir.scripts.serialize", + deps = [ + "//caffe2:torch", # @manual + "//executorch/exir/serialize:lib", + "//executorch/exir/tests:lib", + ], +) + +fbpkg.builder( + name = "executorch", + buck_opts = fbpkg.buck_opts(version = "v2"), + path_actions = { + "serialize_to_flatbuffer": "//executorch/exir/scripts:serialize", + }, +) + +python_library( + name = "lib", + srcs = [ + "__init__.py", + ], + resources = { + "//executorch/schema:schema.fbs": "schema.fbs", + }, + deps = [ + "//libfb/py:fbpkg", + ], +) diff --git a/exir/serde/TARGETS b/exir/serde/TARGETS new file mode 100644 index 00000000000..3073d11f413 --- /dev/null +++ b/exir/serde/TARGETS @@ -0,0 +1,15 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "serialize", + srcs = [ + "serialize.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:memory", + ], +) diff --git a/exir/serialize/TARGETS b/exir/serialize/TARGETS new file mode 100644 index 00000000000..57df0dd935f --- /dev/null +++ b/exir/serialize/TARGETS @@ -0,0 +1,65 @@ +load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +oncall("executorch") + +# TODO(T157145817): Update other flatbuffer serializers to use flatc like +# _flatbuffer.py does, and remove this. +cpp_python_extension( + name = "bindings", + srcs = [ + "bindings.cpp", + ], + visibility = [ + "//executorch/backends/qnnpack/...", + "//executorch/backends/vulkan/...", + "//executorch/backends/xnnpack/...", + "//executorch/bundled_program/...", + "//executorch/sdk/etdump/...", + ], + deps = [ + "fbsource//arvr/third-party/pybind11:pybind11", + "fbsource//third-party/flatbuffers:flatc_library", + ], +) + +# 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 = "lib", + srcs = [ + "__init__.py", + "_dataclass.py", + "_flatbuffer.py", + "_program.py", + ], + resources = { + "//executorch/schema:scalar_type.fbs": "scalar_type.fbs", + "//executorch/schema:schema.fbs": "schema.fbs", + "fbsource//third-party/flatbuffers:flatc-host": "flatbuffers-flatc", + }, + # Currently serialization API should only be used in some dedicated targets, + # to avoid ODR violation when linking with another Flatbuffers library. + # Please ask before changing this. + visibility = [ + "//executorch/backends/...", + "//executorch/bundled_program:core", + "//executorch/bundled_program/serialize:lib", + "//executorch/bundled_program/tests/...", + "//executorch/codegen/...", + "//executorch/examples/async_exec:emit_program_lib", + "//executorch/exir/...", + "//executorch/exir/scripts:serialize", + "//executorch/exir/scripts:serialize-library", + "//executorch/exir/tests/...", + "//executorch/profiler/...", + "//executorch/pybindings/test:test", + "//executorch/pybindings/test:test-library", + "//executorch/sdk/experimental/...", + "//executorch/test/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//executorch/exir:schema", + ], +) diff --git a/exir/serialize/test/TARGETS b/exir/serialize/test/TARGETS new file mode 100644 index 00000000000..1cb5ef186cb --- /dev/null +++ b/exir/serialize/test/TARGETS @@ -0,0 +1,25 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +python_unittest( + name = "program", + srcs = [ + "test_program.py", + ], + supports_static_listing = True, + deps = [ + "//executorch/exir:schema", + "//executorch/exir/serialize:lib", + "//executorch/exir/tests:lib", + ], +) + +python_unittest( + name = "flatbuffer", + srcs = [ + "test_flatbuffer.py", + ], + supports_static_listing = True, + deps = [ + "//executorch/exir/serialize:lib", + ], +) diff --git a/exir/tests/TARGETS b/exir/tests/TARGETS new file mode 100644 index 00000000000..9799b4c1f98 --- /dev/null +++ b/exir/tests/TARGETS @@ -0,0 +1,431 @@ +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +python_library( + name = "lib", + srcs = [ + "common.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir:schema", + ], +) + +python_library( + name = "models", + srcs = [ + "models.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:lib", + ], +) + +python_library( + name = "control_flow_models", + srcs = [ + "control_flow_models.py", + ], + deps = [ + "//caffe2:torch", + ], +) + +python_library( + name = "dynamic_shape_models", + srcs = [ + "dynamic_shape_models.py", + ], + deps = [ + "//caffe2:torch", + ], +) + +python_library( + name = "transformer", + srcs = [ + "transformer.py", + ], + deps = [ + "//caffe2:torch", + ], +) + +python_library( + name = "asr_joiner", + srcs = [ + "asr_joiner.py", + ], + deps = [ + "//caffe2:torch", + ], +) + +python_unittest( + name = "tracer", + srcs = [ + "test_tracer.py", + ], + # Static listing does not support tests generated in runtime. + supports_static_listing = False, + deps = [ + "fbsource//third-party/pypi/parameterized:parameterized", + ":control_flow_models", + ":lib", + ":models", + "//caffe2:torch", + "//executorch/exir:error", + "//executorch/exir:lib", + "//executorch/exir:schema", + "//executorch/exir:tracer", + "//executorch/exir/passes:lib", + ], +) + +python_unittest( + name = "serde", + srcs = [ + "test_serde.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir/serde:serialize", + ], +) + +python_unittest( + name = "error", + srcs = [ + "test_error.py", + ], + supports_static_listing = True, + deps = [ + "//executorch/exir:error", + ], +) + +python_unittest( + name = "serialize", + srcs = [ + "test_serialize.py", + ], + supports_static_listing = True, + deps = [ + ":lib", + "//executorch/exir:print_program", + "//executorch/exir/serialize:lib", + ], +) + +python_unittest( + name = "tensor", + srcs = [ + "test_tensor.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:schema", + "//executorch/exir:tensor", + ], +) + +cpp_library( + name = "test_lib", + srcs = [ + "test_lib.cpp", + ], + supports_python_dlopen = True, + deps = [ + "//caffe2:ATen-cpu", + "//caffe2:torch-cpp-cpu", # @manual + ], +) + +python_unittest( + name = "op_convert", + srcs = [ + "test_op_convert.py", + ], + supports_static_listing = True, + deps = [ + ":test_lib", # @manual + "//caffe2:torch", + "//executorch/exir/operator:convert", + "//executorch/kernels/portable:custom_ops_generated_lib", + ], +) + +python_unittest( + name = "memory_planning", + srcs = [ + "test_memory_planning.py", + ], + supports_static_listing = True, + deps = [ + ":asr_joiner", + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends/qnnpack/partition:qnnpack_partitioner", + "//executorch/exir:lib", + "//executorch/exir:memory_planning", + "//executorch/exir:pass_manager", + "//executorch/exir:print_program", + "//executorch/exir:schema", + "//executorch/exir/passes:lib", + "//executorch/kernels/portable:custom_ops_generated_lib", + ], +) + +python_unittest( + name = "experimental", + srcs = [ + "test_experimental.py", + ], + supports_static_listing = True, + deps = [ + ":models", + "//caffe2:torch", + "//caffe2/functorch:functorch_src", + "//executorch/exir:error", + "//executorch/exir:lib", + "//executorch/exir/experimental:export_pt2", + "//executorch/exir/experimental:lib", + ], +) + +python_unittest( + name = "passes", + srcs = [ + "test_passes.py", + ], + preload_deps = [":test_lib"], + supports_static_listing = True, + deps = [ + ":control_flow_models", + ":lib", + ":models", + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:memory", + "//executorch/exir:memory_planning", + "//executorch/exir:pass_base", + "//executorch/exir:pass_manager", + "//executorch/exir:tensor", + "//executorch/exir/dialects:lib", + "//executorch/exir/dialects/edge:lib", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:const_prop_pass", + "//executorch/exir/passes:debug_handle_generator_pass", + "//executorch/exir/passes:lib", + "//executorch/exir/passes:remove_assert_async_pass", + "//executorch/exir/passes:remove_mixed_type_operators", + "//executorch/exir/passes:replace_edge_with_backend_pass", + "//executorch/exir/passes:scalar_to_tensor_pass", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/exir/passes:symint_to_tensor_pass", + "//executorch/pybindings:portable", # @manual + ], +) + +python_unittest( + name = "pass_infra", + srcs = [ + "test_pass_infra.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:pass_manager", + "//executorch/exir/passes:lib", + "//executorch/exir/passes:pass_registry", + ], +) + +python_unittest( + name = "quant_lowering_custom_backend_pass", + srcs = [ + "test_quant_lowering_custom_backend_pass.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/backends:backend_api", + "//executorch/backends:backend_details", + "//executorch/backends:compile_spec_schema", + "//executorch/backends:partitioner", + "//executorch/backends/canonical_partitioners:canonical_partitioner_lib", + "//executorch/exir:lib", + "//executorch/exir:pass_base", + "//executorch/exir:tracer", + ], +) + +python_unittest( + name = "common", + srcs = [ + "test_common.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir:common", + ], +) + +python_unittest( + name = "verification", + srcs = [ + "test_verification.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:schema", + "//executorch/exir/passes:const_prop_pass", + "//executorch/exir/passes:lib", + "//executorch/exir/verification:interpreter", + "//executorch/exir/verification:verifier", + ], +) + +python_unittest( + name = "delegate", + srcs = [ + "test_delegate.py", + ], + supports_static_listing = True, + deps = [ + ":lib", + ":models", + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir:schema", + ], +) + +python_unittest( + name = "quant_fusion_pass", + srcs = [ + "test_quant_fusion_pass.py", + ], + supports_static_listing = True, + deps = [ + ":lib", + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:tracer", + "//executorch/exir/passes:quant_fusion_pass", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], +) + +python_unittest( + name = "quantization", + srcs = [ + "test_quantization.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:tracer", + "//executorch/exir/passes:quant_fusion_pass", + "//executorch/exir/passes:spec_prop_pass", + "//executorch/kernels/quantized:custom_ops_generated_lib", + "//pytorch/vision:torchvision", + ], +) + +python_unittest( + name = "fixtures", + srcs = [ + "test_fixtures.py", + ], + # Static listing does not support tests generated in runtime. + supports_static_listing = False, + deps = [ + "fbsource//third-party/pypi/parameterized:parameterized", + ":lib", + ":models", + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir/serialize:lib", + ], +) + +python_binary( + name = "generate_fixtures", + srcs = [ + "test_fixtures.py", + ], + main_module = "executorch.exir.tests.test_fixtures", + deps = [ + "fbsource//third-party/pypi/parameterized:parameterized", + ":lib", + ":models", + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir/serialize:lib", + ], +) + +python_unittest( + name = "capture", + srcs = [ + "test_capture.py", + ], + # Static listing does not support tests generated in runtime. + supports_static_listing = False, + deps = [ + "fbsource//third-party/pypi/parameterized:parameterized", + ":models", + "//caffe2:torch", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + ], +) + +python_unittest( + name = "dynamic_shape_propagation", + srcs = [ + "test_dynamic_shape_propagation.py", + ], + supports_static_listing = True, + deps = [ + ":models", + "//executorch/exir:lib", + "//executorch/exir:pass_manager", + "//executorch/exir/passes:lib", + "//executorch/exir/passes:sym_shape_eval_pass", + ], +) + +python_unittest( + name = "arg_validator", + srcs = [ + "test_arg_validator.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir:graph_module", + "//executorch/exir:lib", + "//executorch/exir/dialects:lib", + "//executorch/exir/verification:verifier", + ], +) diff --git a/exir/tests/fixtures/TARGETS b/exir/tests/fixtures/TARGETS new file mode 100644 index 00000000000..44ff414311a --- /dev/null +++ b/exir/tests/fixtures/TARGETS @@ -0,0 +1,7 @@ +load("@fbcode_macros//build_defs:export_files.bzl", "export_file") + +oncall("executorch") + +export_file(name = "basic_sin_max.txt") + +export_file(name = "composite_delegate.txt") diff --git a/exir/verification/TARGETS b/exir/verification/TARGETS new file mode 100644 index 00000000000..ffc89984574 --- /dev/null +++ b/exir/verification/TARGETS @@ -0,0 +1,59 @@ +load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +cpp_python_extension( + name = "bindings", + srcs = [ + "bindings.cpp", + ], + deps = [ + "//caffe2:torch-cpp-cpu", + "//caffe2:torch_extension", + "//caffe2/c10:c10", + ], + external_deps = [ + "pybind11", + ], +) + +python_library( + name = "interpreter", + srcs = [ + "interpreter.py", + ], + deps = [ + ":bindings", # @manual + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:schema", + "//executorch/exir:tensor", + "//executorch/pytree:pylib", + ], +) + +python_library( + name = "devhtml", + srcs = [ + "dev_html.py", + ], + deps = [ + ":interpreter", # @manual + ], +) + +python_library( + name = "verifier", + srcs = [ + "arg_validator.py", + "verifier.py", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:error", + "//executorch/exir/dialects/edge:lib", + "//executorch/exir/emit:emit", + ], +) diff --git a/kernels/aten/TARGETS b/kernels/aten/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/kernels/aten/TARGETS @@ -0,0 +1,8 @@ +# 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/kernels/aten/test/TARGETS b/kernels/aten/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/aten/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/optimized/TARGETS b/kernels/optimized/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/kernels/optimized/TARGETS @@ -0,0 +1,8 @@ +# 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/kernels/optimized/cpu/TARGETS b/kernels/optimized/cpu/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/kernels/optimized/cpu/TARGETS @@ -0,0 +1,8 @@ +# 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/kernels/optimized/test/TARGETS b/kernels/optimized/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/optimized/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/portable/TARGETS b/kernels/portable/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/portable/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/portable/cpu/TARGETS b/kernels/portable/cpu/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/portable/cpu/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/portable/cpu/pattern/TARGETS b/kernels/portable/cpu/pattern/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/portable/cpu/pattern/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/portable/cpu/test/TARGETS b/kernels/portable/cpu/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/portable/cpu/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/portable/cpu/util/TARGETS b/kernels/portable/cpu/util/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/portable/cpu/util/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/portable/cpu/util/test/TARGETS b/kernels/portable/cpu/util/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/portable/cpu/util/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/portable/test/TARGETS b/kernels/portable/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/kernels/portable/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/kernels/quantized/TARGETS b/kernels/quantized/TARGETS new file mode 100644 index 00000000000..0a42614a385 --- /dev/null +++ b/kernels/quantized/TARGETS @@ -0,0 +1,5 @@ +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() diff --git a/kernels/quantized/cpu/TARGETS b/kernels/quantized/cpu/TARGETS new file mode 100644 index 00000000000..0a42614a385 --- /dev/null +++ b/kernels/quantized/cpu/TARGETS @@ -0,0 +1,5 @@ +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() diff --git a/kernels/quantized/test/TARGETS b/kernels/quantized/test/TARGETS new file mode 100644 index 00000000000..e44d12baa99 --- /dev/null +++ b/kernels/quantized/test/TARGETS @@ -0,0 +1,19 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() + +python_unittest( + name = "test_out_variants", + srcs = ["test_out_variants.py"], + preload_deps = [ + "//executorch/kernels/quantized:custom_ops_generated_lib", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/exir/dialects:lib", + ], +) diff --git a/kernels/test/TARGETS b/kernels/test/TARGETS new file mode 100644 index 00000000000..8f70fbcc822 --- /dev/null +++ b/kernels/test/TARGETS @@ -0,0 +1,42 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() + +python_unittest( + name = "gen_supported_features_test", + srcs = ["gen_supported_features_test.py"], + supports_static_listing = True, + deps = [ + "fbsource//third-party/pypi/pyyaml:pyyaml", + ":gen_supported_features_lib", + ], +) + +python_binary( + name = "test_case_gen", + srcs = [ + "test_case_gen.py", + ], + main_module = "executorch.kernels.test.test_case_gen", + deps = [ + "//caffe2:torch", + ], +) + +python_binary( + name = "summarize_supported_features", + srcs = [ + "summarize_supported_features.py", + ], + main_module = "executorch.kernels.test.summarize_supported_features", + deps = [ + "fbsource//third-party/pypi/pyyaml:pyyaml", + ], +) diff --git a/kernels/test/custom_kernel_example/TARGETS b/kernels/test/custom_kernel_example/TARGETS new file mode 100644 index 00000000000..a7debed33fb --- /dev/null +++ b/kernels/test/custom_kernel_example/TARGETS @@ -0,0 +1,8 @@ +load(":targets.bzl", "define_common_targets") +load(":tests.bzl", "define_common_test_targets") + +oncall("executorch") + +define_common_targets() + +define_common_test_targets() diff --git a/profiler/TARGETS b/profiler/TARGETS new file mode 100644 index 00000000000..4e6bf37cae8 --- /dev/null +++ b/profiler/TARGETS @@ -0,0 +1,57 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load(":targets.bzl", "define_common_targets") + +define_common_targets() + +python_library( + name = "parse_profiler_library", + srcs = [ + "parse_profiler_results.py", + ], + visibility = [ + "fbcode//aibench/...", + "fbcode//on_device_ai/Assistant/Jarvis/...", + "fbsource//xplat/on_device_ai/Assistant/Jarvis/...", + "//executorch/exir:bento_deps", + "//executorch/profiler/test/...", + "//executorch/test/end2end/...", + "//pye/lib/...", + ], + deps = [ + "fbsource//third-party/pypi/prettytable:prettytable", + "//executorch/exir:schema", + "//executorch/exir/serialize:lib", + ], +) + +python_library( + name = "profiler_results_scuba", + srcs = [ + "profiler_results_scuba.py", + ], + deps = [ + ":parse_profiler_library", + "//executorch/exir:schema", + "//executorch/exir/serialize:lib", + "//libfb/py:fburl", + "//libfb/py:scuba_url", + "//rfe/scubadata:scubadata_py3", + ], +) + +python_binary( + name = "profiler_results_cli", + srcs = [ + "profiler_results_cli.py", + ], + main_module = "executorch.profiler.profiler_results_cli", + deps = [ + ":parse_profiler_library", + ":profiler_results_scuba", + "//executorch/exir/serialize:lib", + ], +) diff --git a/profiler/test/TARGETS b/profiler/test/TARGETS new file mode 100644 index 00000000000..cc539b81d9d --- /dev/null +++ b/profiler/test/TARGETS @@ -0,0 +1,21 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") + +# Ideally this should be a python_unittest but we cannot do that as +# we have to run this python test with a buck config flag which is +# -c executorch.prof_enabled=true. So we instead define this as a +# binary and run this on diffs via a Skycastle job. + +python_binary( + # @autodeps-skip + name = "test_profiler_e2e", + srcs = [ + "test_profiler_e2e.py", + ], + main_module = "executorch.profiler.test.test_profiler_e2e", + deps = [ + "//executorch/exir:lib", + "//executorch/exir/serialize:lib", + "//executorch/profiler:parse_profiler_library", + "//executorch/pybindings:portable", + ], +) diff --git a/pybindings/TARGETS b/pybindings/TARGETS new file mode 100644 index 00000000000..b292e8f2e29 --- /dev/null +++ b/pybindings/TARGETS @@ -0,0 +1,60 @@ +# @noautodeps +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load("@fbcode//executorch/pybindings:targets.bzl", "MODELS_ALL_OPS_ATEN_MODE_GENERATED_LIB", "MODELS_ALL_OPS_LEAN_MODE_GENERATED_LIB", "MODULE_DEPS", "define_common_targets", "executorch_pybindings") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +define_common_targets() + +executorch_pybindings( + srcs = [ + "module.cpp", + ], + cppdeps = MODULE_DEPS, + python_module_name = "core", + visibility = ["PUBLIC"], +) + +executorch_pybindings( + srcs = [ + "module.cpp", + ], + cppdeps = MODULE_DEPS + MODELS_ALL_OPS_LEAN_MODE_GENERATED_LIB, + python_module_name = "portable", + visibility = ["PUBLIC"], +) + +executorch_pybindings( + srcs = [ + "module.cpp", + ], + cppdeps = [ + "//executorch/runtime/kernel:operator_registry", + "//executorch/executor:executor_aten", + "//executorch/core/kernel_types:kernel_types", + "//executorch/schema:bundled_program_schema", + "//executorch/schema:schema", + "//executorch/util:embedded_data_loader", + "//executorch/util:mmap_data_loader", + "//executorch/util:read_file", + "//executorch/util:test_memory_config", + "//executorch/util:bundled_program_verification_aten", + "//caffe2:torch-cpp", + "//executorch/executor/test:test_backend_compiler_lib_aten", + ] + MODELS_ALL_OPS_ATEN_MODE_GENERATED_LIB, + python_module_name = "aten_mode_lib", + visibility = ["PUBLIC"], +) + +python_library( + name = "stacktraces", + srcs = [ + "stacktraces.py", + ], + base_module = "executorch.pybindings", + deps = [ + ":core", + "//executorch/exir:schema", + ], +) diff --git a/pybindings/test/TARGETS b/pybindings/test/TARGETS new file mode 100644 index 00000000000..61aadf1e992 --- /dev/null +++ b/pybindings/test/TARGETS @@ -0,0 +1,27 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +oncall("executorch") + +python_unittest( + # @autodeps-skip + # autodeps has a real hard time tracking the owner of the pybindings + # from portable and the suggested fixes I could find didnt work, so + # just disabling for now + name = "test", + srcs = [ + "test.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//caffe2:torch_fx", + "//executorch/exir:lib", + "//executorch/exir:pass_manager", + "//executorch/exir:scalar_type", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:lib", + "//executorch/exir/serialize:lib", + "//executorch/pybindings:portable", + "//executorch/runtime/core:core", + ], +) diff --git a/pytree/TARGETS b/pytree/TARGETS new file mode 100644 index 00000000000..d0aac68bd76 --- /dev/null +++ b/pytree/TARGETS @@ -0,0 +1,49 @@ +# @noautodeps +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load(":targets.bzl", "define_common_targets") + +define_common_targets() + +cpp_python_extension( + name = "pybindings", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +cpp_python_extension( + name = "pybindings_debug", + srcs = [ + "pybindings.cpp", + ], + base_module = "executorch.pytree", + deps = [ + ":pytree", + ], + external_deps = [ + "pybind11", + ], +) + +python_library( + name = "pylib", + srcs = [ + "__init__.py", + ], + base_module = "executorch.pytree", + deps = [ + ":pybindings", + "//caffe2:torch", + ], +) diff --git a/pytree/test/TARGETS b/pytree/test/TARGETS new file mode 100644 index 00000000000..b5194641400 --- /dev/null +++ b/pytree/test/TARGETS @@ -0,0 +1,25 @@ +# @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 = "cpptest", + srcs = ["test_pytree.cpp"], + supports_static_listing = True, + deps = ["//executorch/pytree:pytree"], +) + +python_unittest( + name = "test", + srcs = [ + "test.py", + ], + supports_static_listing = True, + deps = [ + "//caffe2:torch", + "//executorch/pytree:pybindings", + "//executorch/pytree:pylib", + ], +) diff --git a/runtime/backend/TARGETS b/runtime/backend/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/runtime/backend/TARGETS @@ -0,0 +1,8 @@ +# 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/runtime/backend/test/TARGETS b/runtime/backend/test/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/runtime/backend/test/TARGETS @@ -0,0 +1,8 @@ +# 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/runtime/core/TARGETS b/runtime/core/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/runtime/core/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/runtime/core/portable_type/TARGETS b/runtime/core/portable_type/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/runtime/core/portable_type/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/runtime/core/portable_type/test/TARGETS b/runtime/core/portable_type/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/runtime/core/portable_type/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/runtime/core/test/TARGETS b/runtime/core/test/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/runtime/core/test/TARGETS @@ -0,0 +1,8 @@ +# 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/runtime/kernel/TARGETS b/runtime/kernel/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/runtime/kernel/TARGETS @@ -0,0 +1,8 @@ +# 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/runtime/kernel/test/TARGETS b/runtime/kernel/test/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/runtime/kernel/test/TARGETS @@ -0,0 +1,8 @@ +# 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/runtime/platform/TARGETS b/runtime/platform/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/runtime/platform/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/runtime/platform/test/TARGETS b/runtime/platform/test/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/runtime/platform/test/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/schema/TARGETS b/schema/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/schema/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/schema/test/TARGETS b/schema/test/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/schema/test/TARGETS @@ -0,0 +1,8 @@ +# 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/scripts/size_monitoring/TARGETS b/scripts/size_monitoring/TARGETS new file mode 100644 index 00000000000..9419aa93cdc --- /dev/null +++ b/scripts/size_monitoring/TARGETS @@ -0,0 +1,39 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "gcc_linker_map_parse", + srcs = [ + "gcc_linker_map_parse.py", + ], +) + +python_library( + name = "clang_linker_map_parse", + srcs = [ + "clang_linker_map_parse.py", + ], +) + +python_library( + name = "build_utils", + srcs = [ + "build_utils.py", + ], +) + +python_binary( + name = "etsize", + srcs = [ + "etsize.py", + ], + main_module = "executorch.scripts.size_monitoring.etsize", + deps = [ + ":build_utils", + ":clang_linker_map_parse", + ":gcc_linker_map_parse", + "//libfb/py:fburl", + "//libfb/py:scuba_url", + "//rfe/scubadata:scubadata_py3", + ], +) diff --git a/sdk/TARGETS b/sdk/TARGETS new file mode 100644 index 00000000000..32a9f6daf3d --- /dev/null +++ b/sdk/TARGETS @@ -0,0 +1,59 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "lib", + srcs = [ + "__init__.py", + "lib.py", + ], + deps = [ + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/etdb:etdb", + "//executorch/sdk/etrecord:etrecord", + "//executorch/sdk/visualizer:generator", + "//manifold/clients/python:manifold_client", + ], +) + +python_binary( + name = "cli", + main_src = "lib.py", + par_style = "xar", + deps = [ + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/etdb:etdb", + "//executorch/sdk/etrecord:etrecord", + "//executorch/sdk/visualizer:generator", + "//manifold/clients/python:manifold_client", + ], +) + +python_library( + name = "sdk", + srcs = [ + "sdk.py", + ], + deps = [ + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/etdb:etdb", + "//executorch/sdk/etrecord:etrecord", + "//executorch/sdk/visualizer:generator", + "//manifold/clients/python:manifold_client", + ], +) + +python_binary( + name = "sdk_main", + main_src = "sdk.py", + par_style = "xar", + deps = [ + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/etdb:etdb", + "//executorch/sdk/etrecord:etrecord", + "//executorch/sdk/visualizer:generator", + "//manifold/clients/python:manifold_client", + ], +) diff --git a/sdk/edir/TARGETS b/sdk/edir/TARGETS new file mode 100644 index 00000000000..824903941f2 --- /dev/null +++ b/sdk/edir/TARGETS @@ -0,0 +1,29 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "base_schema", + srcs = [ + "base_schema.py", + ], + deps = [ + ], +) + +python_library( + name = "et_schema", + srcs = [ + "et_schema.py", + ], + deps = [ + "fbsource//third-party/pypi/numpy:numpy", + ":base_schema", + "//caffe2:torch", + "//executorch/exir:lib", + "//executorch/exir:schema", + "//executorch/exir/serialize:lib", + "//executorch/sdk/etdump:schema", + "//executorch/sdk/etdump:serialize", + ], +) diff --git a/sdk/edir/tests/TARGETS b/sdk/edir/tests/TARGETS new file mode 100644 index 00000000000..7ba103864a2 --- /dev/null +++ b/sdk/edir/tests/TARGETS @@ -0,0 +1,55 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +oncall("executorch") + +python_unittest( + name = "exported_op_graph_test", + srcs = [ + "exported_op_graph_test.py", + ], + supports_static_listing = False, # Usage of parameterized + deps = [ + "fbsource//third-party/pypi/parameterized:parameterized", + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:lib", + "//executorch/sdk/edir:base_schema", + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/etdump:schema", + ], +) + +python_library( + name = "exported_op_graph_test_library", + srcs = [ + "exported_op_graph_test.py", + ], + deps = [ + "fbsource//third-party/pypi/parameterized:parameterized", + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:lib", + "//executorch/sdk/edir:base_schema", + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/etdump:schema", + ], +) + +python_binary( + name = "generate_fixtures", + srcs = [ + "exported_op_graph_test.py", + ], + main_module = "executorch.sdk.edir.tests.exported_op_graph_test", + deps = [ + "fbsource//third-party/pypi/parameterized:parameterized", + "//caffe2:torch", + "//executorch/exir:delegate", + "//executorch/exir:lib", + "//executorch/sdk/edir:base_schema", + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/etdump:schema", + ], +) diff --git a/sdk/etdb/TARGETS b/sdk/etdb/TARGETS new file mode 100644 index 00000000000..fbb172b9e7c --- /dev/null +++ b/sdk/etdb/TARGETS @@ -0,0 +1,27 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +oncall("executorch") + +python_library( + name = "row_schema", + srcs = [ + "row_schema.py", + ], + deps = [ + "//executorch/sdk/edir:base_schema", + "//executorch/sdk/edir:et_schema", + ], +) + +python_library( + name = "etdb", + srcs = [ + "etdb.py", + ], + deps = [ + "fbsource//third-party/pypi/tabulate:tabulate", + ":row_schema", + "//executorch/sdk/edir:base_schema", + "//executorch/sdk/edir:et_schema", + ], +) diff --git a/sdk/etdump/TARGETS b/sdk/etdump/TARGETS new file mode 100644 index 00000000000..f525d81b7e2 --- /dev/null +++ b/sdk/etdump/TARGETS @@ -0,0 +1,33 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load(":targets.bzl", "define_common_targets") + +oncall("executorch") + +define_common_targets() + +python_library( + name = "schema", + srcs = [ + "schema.py", + ], + deps = [ + "//executorch/exir:scalar_type", + ], +) + +python_library( + name = "serialize", + srcs = [ + "serialize.py", + ], + resources = { + "//executorch/schema:scalar_type.fbs": "scalar_type.fbs", + "//executorch/sdk/etdump:etdump_schema.fbs": "etdump_schema.fbs", + }, + deps = [ + "fbsource//third-party/pypi/setuptools:setuptools", + ":schema", + "//executorch/exir/serialize:bindings", + "//executorch/exir/serialize:lib", + ], +) diff --git a/sdk/etdump/tests/TARGETS b/sdk/etdump/tests/TARGETS new file mode 100644 index 00000000000..f45a1245573 --- /dev/null +++ b/sdk/etdump/tests/TARGETS @@ -0,0 +1,16 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") +load(":targets.bzl", "define_common_targets") + +define_common_targets() + +python_unittest( + name = "serialize_test", + srcs = [ + "serialize_test.py", + ], + supports_static_listing = True, + deps = [ + "//executorch/sdk/etdump:schema", + "//executorch/sdk/etdump:serialize", + ], +) diff --git a/sdk/etrecord/TARGETS b/sdk/etrecord/TARGETS new file mode 100644 index 00000000000..06e1c6a9134 --- /dev/null +++ b/sdk/etrecord/TARGETS @@ -0,0 +1,13 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + name = "etrecord", + srcs = [ + "__init__.py", + "_etrecord.py", + ], + deps = [ + "//executorch/exir:lib", + "//executorch/exir/serde:serialize", + ], +) diff --git a/sdk/etrecord/tests/TARGETS b/sdk/etrecord/tests/TARGETS new file mode 100644 index 00000000000..202098c4ab1 --- /dev/null +++ b/sdk/etrecord/tests/TARGETS @@ -0,0 +1,13 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +oncall("executorch") + +python_unittest( + name = "etrecord_test", + srcs = ["etrecord_test.py"], + deps = [ + "//executorch/exir:lib", + "//executorch/exir/tests:models", + "//executorch/sdk/etrecord:etrecord", + ], +) diff --git a/sdk/experimental/TARGETS b/sdk/experimental/TARGETS new file mode 100644 index 00000000000..fef960de40b --- /dev/null +++ b/sdk/experimental/TARGETS @@ -0,0 +1,34 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") + +python_binary( + # @autodeps-skip + name = "torchnn_graph_on_tb", + main_src = "torchnn_graph_on_tb.py", + par_style = "xar", + deps = [ + "//caffe2:torch_tensorboard", + "//pytorch/vision:torchvision", + ], +) + +python_binary( + # @autodeps-skip + name = "hardcoded_graph_on_tb", + main_src = "hardcoded_graph_on_tb.py", + par_style = "xar", + deps = [ + "//caffe2:torch_tensorboard", + "//pytorch/vision:torchvision", + ], +) + +python_binary( + # @autodeps-skip + name = "edir_graph_on_tb", + main_src = "edir_graph_on_tb.py", + par_style = "xar", + deps = [ + "//caffe2:torch_tensorboard", + "//pytorch/vision:torchvision", + ], +) diff --git a/sdk/visualizer/TARGETS b/sdk/visualizer/TARGETS new file mode 100644 index 00000000000..124c50451b2 --- /dev/null +++ b/sdk/visualizer/TARGETS @@ -0,0 +1,53 @@ +load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") + +python_library( + # @autodeps-skip + name = "writer", + srcs = [ + "writer.py", + ], +) + +python_library( + # @autodeps-skip + name = "converter", + srcs = [ + "converter.py", + ], + deps = [ + "//caffe2:torch_tensorboard", + "//executorch/sdk/edir:et_schema", + ], +) + +python_library( + # @autodeps-skip + name = "generator", + srcs = [ + "generator.py", + ], + deps = [ + ":converter", + ":utils", + ":writer", + "//manifold/clients/python:manifold_client", + ], +) + +python_binary( + name = "example_runner", + main_src = "example_runner.py", + par_style = "xar", + deps = [ + ":generator", + "//executorch/sdk/edir/tests:exported_op_graph_test_library", + ], +) + +python_library( + name = "utils", + srcs = [ + "utils.py", + ], +) diff --git a/sdk/visualizer/tests/TARGETS b/sdk/visualizer/tests/TARGETS new file mode 100644 index 00000000000..b834c580f68 --- /dev/null +++ b/sdk/visualizer/tests/TARGETS @@ -0,0 +1,27 @@ +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +oncall("executorch") + +python_unittest( + name = "converter_test", + srcs = [ + "converter_test.py", + ], + supports_static_listing = True, + deps = [ + "//executorch/sdk/edir:et_schema", + "//executorch/sdk/edir/tests:exported_op_graph_test_library", + "//executorch/sdk/visualizer:converter", + ], +) + +python_unittest( + name = "utils_test", + srcs = [ + "utils_test.py", + ], + supports_static_listing = True, + deps = [ + "//executorch/sdk/visualizer:utils", + ], +) diff --git a/test/TARGETS b/test/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/test/TARGETS @@ -0,0 +1,8 @@ +# 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/test/end2end/TARGETS b/test/end2end/TARGETS new file mode 100644 index 00000000000..12cbbf9f2d4 --- /dev/null +++ b/test/end2end/TARGETS @@ -0,0 +1,121 @@ +# @noautodeps + +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") + +python_library( + name = "exported_module", + srcs = [ + "exported_module.py", + ], + visibility = [ + "//executorch/...", + ], + deps = [ + "//caffe2:torch", + "//executorch/exir:dynamic_shape", + "//executorch/exir:lib", + "//executorch/exir:pass_manager", + "//executorch/exir/passes:lib", + ], +) + +python_library( + name = "register_scratch_meta_fns", + srcs = [ + "register_scratch_meta_fns.py", + ], + deps = [ + "//executorch/exir/operator:manip", + ], +) + +python_unittest( + name = "end2end_aten", + srcs = [ + "test_end2end.py", + ], + supports_static_listing = True, + deps = [ + ":exported_module", + ":register_scratch_meta_fns", + "//caffe2:torch", + "//executorch/bundled_program:config", + "//executorch/bundled_program:core", + "//executorch/bundled_program/serialize:lib", + "//executorch/exir:dynamic_shape", + "//executorch/exir:lib", + "//executorch/exir:memory", + "//executorch/exir:pass_manager", + "//executorch/exir:print_program", + "//executorch/exir:tensor", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:lib", + "//executorch/exir/serialize:lib", + "//executorch/exir/tests:control_flow_models", + "//executorch/exir/tests:dynamic_shape_models", + "//executorch/exir/tests:models", + "//executorch/exir/tests:transformer", + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/pybindings:aten_mode_lib", + "//executorch/pytree:pybindings", + ], +) + +python_unittest( + name = "end2end", + srcs = [ + "test_end2end.py", + ], + supports_static_listing = True, + deps = [ + ":exported_module", + ":register_scratch_meta_fns", + "//caffe2:torch", + "//executorch/bundled_program:config", + "//executorch/bundled_program:core", + "//executorch/bundled_program/serialize:lib", + "//executorch/exir:dynamic_shape", + "//executorch/exir:lib", + "//executorch/exir:memory", + "//executorch/exir:pass_manager", + "//executorch/exir:print_program", + "//executorch/exir:tensor", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:lib", + "//executorch/exir/serialize:lib", + "//executorch/exir/tests:control_flow_models", + "//executorch/exir/tests:dynamic_shape_models", + "//executorch/exir/tests:models", + "//executorch/exir/tests:transformer", + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/pybindings:portable", + "//executorch/pytree:pybindings", + ], +) + +python_unittest( + name = "test_end2end_real_model_dynamo", + srcs = [ + "test_end2end_real_model_dynamo.py", + ], + preload_deps = [ + "//pye/model_inventory/asr_models/runtime:custom_ops_generated_lib_aten", + ], + supports_static_listing = True, + deps = [ + ":register_scratch_meta_fns", + "//caffe2:torch", + "//caffe2/functorch:functorch", + "//executorch/exir:lib", + "//executorch/exir:memory", + "//executorch/exir:pass_manager", + "//executorch/exir:tensor", + "//executorch/exir/emit:lib", + "//executorch/exir/passes:lib", + "//executorch/kernels/portable:custom_ops_generated_lib", + "//executorch/pybindings:portable", + "//executorch/pytree:pybindings", + "//pye/model_inventory/asr_models/milan_dictation:milan_dictation_lib", + ], +) diff --git a/test/models/TARGETS b/test/models/TARGETS new file mode 100644 index 00000000000..30d971558f3 --- /dev/null +++ b/test/models/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/test/utils/TARGETS b/test/utils/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/test/utils/TARGETS @@ -0,0 +1,8 @@ +# 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/threadpool/TARGETS b/threadpool/TARGETS new file mode 100644 index 00000000000..cf4f626bf70 --- /dev/null +++ b/threadpool/TARGETS @@ -0,0 +1,14 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") +load(":targets.bzl", "define_common_targets") + +cpp_library( + name = "cpuinfo", + exported_deps = [ + "fbsource//third-party/cpuinfo:cpuinfo", + ], +) + +define_common_targets() diff --git a/threadpool/test/TARGETS b/threadpool/test/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/threadpool/test/TARGETS @@ -0,0 +1,8 @@ +# 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/util/TARGETS b/util/TARGETS new file mode 100644 index 00000000000..0c3a878aaa5 --- /dev/null +++ b/util/TARGETS @@ -0,0 +1,6 @@ +# 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") + +define_common_targets() diff --git a/util/test/TARGETS b/util/test/TARGETS new file mode 100644 index 00000000000..2341af9282f --- /dev/null +++ b/util/test/TARGETS @@ -0,0 +1,8 @@ +# 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()