From 65aeed29672f4a01d5646ad0054331307be9e32b Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Mon, 24 Feb 2025 17:27:04 -0800 Subject: [PATCH 01/10] Update [ghstack-poisoned] --- .buckconfig | 3 ++- .ci/scripts/unittest-buck2.sh | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.buckconfig b/.buckconfig index a7c48881bb3..3f673ef2d1b 100644 --- a/.buckconfig +++ b/.buckconfig @@ -15,9 +15,10 @@ ovr_config = prelude toolchains = shim_et fbcode = shim_et - fbcode_macros = shim_et + fbcode_macros = shim fbsource = shim_et buck = shim + gh_facebook_buck2_shims_meta = shim [cxx] cxxflags = -g -std=c++17 diff --git a/.ci/scripts/unittest-buck2.sh b/.ci/scripts/unittest-buck2.sh index 2e386570504..68a02c41782 100755 --- a/.ci/scripts/unittest-buck2.sh +++ b/.ci/scripts/unittest-buck2.sh @@ -7,7 +7,12 @@ set -eux # TODO: expand this to //... -buck2 query //runtime/... +# TODO: can't query cadence & vulkan backends +buck2 query "//backends/apple/... + //backends/arm/... + \ +//backends/example/... + //backends/mediatek/... + //backends/test/... + \ +//backends/transforms/... + //backends/xnnpack/... + //configurations/... + \ +//kernels/portable/cpu/... + //runtime/... + //schema/... + //test/... + \ +//util/..." # TODO: expand the covered scope of Buck targets. buck2 build //runtime/core/portable_type/... From 545a05bc0c7bbb6409812aaa2ec756afbf67fd43 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Mon, 24 Feb 2025 17:57:37 -0800 Subject: [PATCH 02/10] Update [ghstack-poisoned] --- devtools/bundled_program/targets.bzl | 4 ++-- devtools/etdump/targets.bzl | 4 ++-- extension/evalue_util/targets.bzl | 4 ++-- extension/evalue_util/test/targets.bzl | 4 ++-- extension/module/targets.bzl | 4 ++-- extension/module/test/targets.bzl | 4 ++-- extension/parallel/targets.bzl | 4 ++-- extension/runner_util/targets.bzl | 4 ++-- extension/runner_util/test/targets.bzl | 4 ++-- extension/tensor/targets.bzl | 4 ++-- extension/tensor/test/targets.bzl | 4 ++-- extension/training/module/targets.bzl | 4 ++-- extension/training/optimizer/targets.bzl | 4 ++-- extension/training/optimizer/test/targets.bzl | 4 ++-- kernels/prim_ops/targets.bzl | 4 ++-- kernels/quantized/targets.bzl | 4 ++-- runtime/backend/targets.bzl | 4 ++-- runtime/core/exec_aten/targets.bzl | 4 ++-- runtime/core/exec_aten/testing_util/targets.bzl | 4 ++-- runtime/core/exec_aten/util/targets.bzl | 4 ++-- runtime/core/exec_aten/util/test/targets.bzl | 4 ++-- runtime/core/targets.bzl | 4 ++-- runtime/core/test/targets.bzl | 4 ++-- runtime/executor/targets.bzl | 4 ++-- runtime/executor/test/targets.bzl | 4 ++-- runtime/kernel/targets.bzl | 4 ++-- runtime/kernel/test/targets.bzl | 4 ++-- shim_et/xplat/executorch/build/runtime_wrapper.bzl | 3 +++ test/utils/targets.bzl | 4 ++-- third-party/gtest_defs.bzl | 3 ++- 30 files changed, 61 insertions(+), 57 deletions(-) diff --git a/devtools/bundled_program/targets.bzl b/devtools/bundled_program/targets.bzl index 7035b3b31f6..09e9aae11b1 100644 --- a/devtools/bundled_program/targets.bzl +++ b/devtools/bundled_program/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( name = "runtime" + aten_suffix, diff --git a/devtools/etdump/targets.bzl b/devtools/etdump/targets.bzl index ddbb35eab74..bf4807aa442 100644 --- a/devtools/etdump/targets.bzl +++ b/devtools/etdump/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") SCALAR_TYPE_STEM = "scalar_type" SCALAR_TYPE = SCALAR_TYPE_STEM + ".fbs" @@ -87,7 +87,7 @@ def define_common_targets(): exported_external_deps = ["flatccrt"], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_library( name = "etdump_flatcc" + aten_suffix, diff --git a/extension/evalue_util/targets.bzl b/extension/evalue_util/targets.bzl index e700ea21467..47934eb78af 100644 --- a/extension/evalue_util/targets.bzl +++ b/extension/evalue_util/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/extension/evalue_util/test/targets.bzl b/extension/evalue_util/test/targets.bzl index 9e78f665c97..5d6161d09e9 100644 --- a/extension/evalue_util/test/targets.bzl +++ b/extension/evalue_util/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_test( diff --git a/extension/module/targets.bzl b/extension/module/targets.bzl index 4cbfa0ca0f5..09a610a1fca 100644 --- a/extension/module/targets.bzl +++ b/extension/module/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/extension/module/test/targets.bzl b/extension/module/test/targets.bzl index bc4ce2c6af7..19ba09cf4e6 100644 --- a/extension/module/test/targets.bzl +++ b/extension/module/test/targets.bzl @@ -3,7 +3,7 @@ load( "ANDROID", "CXX", ) -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -12,7 +12,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_test( diff --git a/extension/parallel/targets.bzl b/extension/parallel/targets.bzl index b1da51b6171..82b3deab129 100644 --- a/extension/parallel/targets.bzl +++ b/extension/parallel/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/extension/runner_util/targets.bzl b/extension/runner_util/targets.bzl index bc0fee197d6..3ab0c26cc72 100644 --- a/extension/runner_util/targets.bzl +++ b/extension/runner_util/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/extension/runner_util/test/targets.bzl b/extension/runner_util/test/targets.bzl index f55a1ea995f..95d5804ecdf 100644 --- a/extension/runner_util/test/targets.bzl +++ b/extension/runner_util/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(is_fbcode = False): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(is_fbcode = False): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") # TODO(dbort): Find a way to make these run for ANDROID/APPLE in xplat. The diff --git a/extension/tensor/targets.bzl b/extension/tensor/targets.bzl index 97654094af6..bf1485aaba5 100644 --- a/extension/tensor/targets.bzl +++ b/extension/tensor/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/extension/tensor/test/targets.bzl b/extension/tensor/test/targets.bzl index 29c8bff84bc..5bf8c7019b8 100644 --- a/extension/tensor/test/targets.bzl +++ b/extension/tensor/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_test( diff --git a/extension/training/module/targets.bzl b/extension/training/module/targets.bzl index 88da84ed131..cfdd0f9897a 100644 --- a/extension/training/module/targets.bzl +++ b/extension/training/module/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/extension/training/optimizer/targets.bzl b/extension/training/optimizer/targets.bzl index 3b00ae0bfdc..fb33f41f1ca 100644 --- a/extension/training/optimizer/targets.bzl +++ b/extension/training/optimizer/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" # if aten_mode: diff --git a/extension/training/optimizer/test/targets.bzl b/extension/training/optimizer/test/targets.bzl index 11269bfa180..7a93337a379 100644 --- a/extension/training/optimizer/test/targets.bzl +++ b/extension/training/optimizer/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_test( name = "sgd_test" + aten_suffix, diff --git a/kernels/prim_ops/targets.bzl b/kernels/prim_ops/targets.bzl index 9a753b50faa..c1af21a7e73 100644 --- a/kernels/prim_ops/targets.bzl +++ b/kernels/prim_ops/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/kernels/quantized/targets.bzl b/kernels/quantized/targets.bzl index fde6698099e..a2533cb003a 100644 --- a/kernels/quantized/targets.bzl +++ b/kernels/quantized/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") load("@fbsource//xplat/executorch/codegen:codegen.bzl", "et_operator_library", "executorch_generated_lib", "exir_custom_ops_aot_lib") def define_common_targets(): @@ -77,7 +77,7 @@ def define_common_targets(): ], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_library( diff --git a/runtime/backend/targets.bzl b/runtime/backend/targets.bzl index fe7ce489b56..12d68396730 100644 --- a/runtime/backend/targets.bzl +++ b/runtime/backend/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( name = "interface" + aten_suffix, diff --git a/runtime/core/exec_aten/targets.bzl b/runtime/core/exec_aten/targets.bzl index 5664a2aea41..9114be639c0 100644 --- a/runtime/core/exec_aten/targets.bzl +++ b/runtime/core/exec_aten/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" # Depend on this target if your types (Tensor, ArrayRef, etc) should be flexible between ATen and executor diff --git a/runtime/core/exec_aten/testing_util/targets.bzl b/runtime/core/exec_aten/testing_util/targets.bzl index 446d0a97769..ed130c8706c 100644 --- a/runtime/core/exec_aten/testing_util/targets.bzl +++ b/runtime/core/exec_aten/testing_util/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -6,7 +6,7 @@ def define_common_targets(): The directory containing this targets.bzl file should also contain both TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/runtime/core/exec_aten/util/targets.bzl b/runtime/core/exec_aten/util/targets.bzl index 55e38d882fd..ac46da052ca 100644 --- a/runtime/core/exec_aten/util/targets.bzl +++ b/runtime/core/exec_aten/util/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" exported_preprocessor_flags_ = [] diff --git a/runtime/core/exec_aten/util/test/targets.bzl b/runtime/core/exec_aten/util/test/targets.bzl index 357e91eea3a..1fcf984e034 100644 --- a/runtime/core/exec_aten/util/test/targets.bzl +++ b/runtime/core/exec_aten/util/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -35,7 +35,7 @@ def define_common_targets(): ], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_test( name = "tensor_util_test" + aten_suffix, diff --git a/runtime/core/targets.bzl b/runtime/core/targets.bzl index d67312beda3..3195e727d96 100644 --- a/runtime/core/targets.bzl +++ b/runtime/core/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def event_tracer_enabled(): return native.read_config("executorch", "event_tracer_enabled", "false") == "true" @@ -82,7 +82,7 @@ def define_common_targets(): ], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( name = "evalue" + aten_suffix, diff --git a/runtime/core/test/targets.bzl b/runtime/core/test/targets.bzl index abe52bcadff..ef09c905674 100644 --- a/runtime/core/test/targets.bzl +++ b/runtime/core/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -102,7 +102,7 @@ def define_common_targets(): ], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_test( diff --git a/runtime/executor/targets.bzl b/runtime/executor/targets.bzl index 67163ed8789..c5d07448a06 100644 --- a/runtime/executor/targets.bzl +++ b/runtime/executor/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def _program_preprocessor_flags(): """Returns the preprocessor_flags to use when building Program.cpp""" @@ -42,7 +42,7 @@ def define_common_targets(): ], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_library( name = "program" + aten_suffix, diff --git a/runtime/executor/test/targets.bzl b/runtime/executor/test/targets.bzl index 922fa17ba75..1dbb4ea6108 100644 --- a/runtime/executor/test/targets.bzl +++ b/runtime/executor/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(is_fbcode = False): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(is_fbcode = False): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = ("_aten" if aten_mode else "") runtime.cxx_library( diff --git a/runtime/kernel/targets.bzl b/runtime/kernel/targets.bzl index e02c1288e55..d49435f2825 100644 --- a/runtime/kernel/targets.bzl +++ b/runtime/kernel/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def _operator_registry_preprocessor_flags(): max_kernel_num = native.read_config("executorch", "max_kernel_num", None) @@ -51,7 +51,7 @@ def define_common_targets(): preprocessor_flags = ["-DMAX_KERNEL_NUM=1"], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_library( diff --git a/runtime/kernel/test/targets.bzl b/runtime/kernel/test/targets.bzl index 96e0c8c557c..bd66fc05b6f 100644 --- a/runtime/kernel/test/targets.bzl +++ b/runtime/kernel/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") load("@fbsource//xplat/executorch/codegen:codegen.bzl", "et_operator_library", "executorch_generated_lib") def define_common_targets(): @@ -88,7 +88,7 @@ def define_common_targets(): ], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_test( diff --git a/shim_et/xplat/executorch/build/runtime_wrapper.bzl b/shim_et/xplat/executorch/build/runtime_wrapper.bzl index b81aabcd83f..5bfba568423 100644 --- a/shim_et/xplat/executorch/build/runtime_wrapper.bzl +++ b/shim_et/xplat/executorch/build/runtime_wrapper.bzl @@ -333,6 +333,9 @@ def get_oss_build_kwargs(): } return {} +def get_aten_mode_options(): + return (False,) if env.is_oss else (True, False) + # Names in this struct should match the standard Buck rule names if possible: # see the "Build Rules" section in the sidebar of # https://buck.build/concept/build_rule.html. diff --git a/test/utils/targets.bzl b/test/utils/targets.bzl index 93e33daf81f..249e7bdf2be 100644 --- a/test/utils/targets.bzl +++ b/test/utils/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -7,7 +7,7 @@ def define_common_targets(): TARGETS and BUCK files that call this function. """ - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" runtime.cxx_library( diff --git a/third-party/gtest_defs.bzl b/third-party/gtest_defs.bzl index c1f4778b80c..ac8046e264d 100644 --- a/third-party/gtest_defs.bzl +++ b/third-party/gtest_defs.bzl @@ -1,3 +1,4 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options") # Copied from fbsource/third-party/googletest COMPILER_FLAGS = [ @@ -17,7 +18,7 @@ def define_gtest_targets(): visibility = ["PUBLIC"], ) - for aten_mode in (True, False): + for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" # # Google Test From d85e2550bb58d1e8efad406e1fb37c44c7bd55ab Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Mon, 24 Feb 2025 18:07:41 -0800 Subject: [PATCH 03/10] Update [ghstack-poisoned] --- shim_et/xplat/executorch/build/runtime_wrapper.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/shim_et/xplat/executorch/build/runtime_wrapper.bzl b/shim_et/xplat/executorch/build/runtime_wrapper.bzl index 5bfba568423..79bc6c7e699 100644 --- a/shim_et/xplat/executorch/build/runtime_wrapper.bzl +++ b/shim_et/xplat/executorch/build/runtime_wrapper.bzl @@ -268,6 +268,7 @@ def _cxx_test(*args, **kwargs): kwargs["deps"].append("//executorch/test/utils:utils") _patch_kwargs_cxx(kwargs) + env.patch_headers(kwargs) _patch_build_mode_flags(kwargs) _patch_test_compiler_flags(kwargs) From 96b69c886c2494ea004fe18991cb1bf5a6e917d6 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Tue, 25 Feb 2025 16:08:41 -0800 Subject: [PATCH 04/10] Update [ghstack-poisoned] --- shim_et/xplat/executorch/extension/pybindings/pybindings.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/shim_et/xplat/executorch/extension/pybindings/pybindings.bzl b/shim_et/xplat/executorch/extension/pybindings/pybindings.bzl index 52191eb978a..5ef9fe59266 100644 --- a/shim_et/xplat/executorch/extension/pybindings/pybindings.bzl +++ b/shim_et/xplat/executorch/extension/pybindings/pybindings.bzl @@ -52,7 +52,6 @@ def executorch_pybindings(python_module_name, srcs = [], cppdeps = [], visibilit "-DEXECUTORCH_PYTHON_MODULE_NAME={}".format(python_module_name), ], deps = [ - "//executorch/exir:_warnings", "//executorch/runtime/core:core", ] + cppdeps, external_deps = [ From 699a8f4e2f5a9797f555e9fba71809237e4a7d33 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Tue, 25 Feb 2025 16:22:59 -0800 Subject: [PATCH 05/10] Update [ghstack-poisoned] --- backends/arm/TARGETS | 20 +++--- backends/arm/_passes/TARGETS | 4 +- backends/arm/operator_support/TARGETS | 4 +- backends/arm/operators/TARGETS | 8 +-- backends/arm/quantizer/TARGETS | 10 +-- backends/arm/test/TARGETS | 12 ++-- backends/cadence/aot/TARGETS | 32 +++++----- backends/cadence/aot/quantizer/TARGETS | 10 +-- backends/cadence/runtime/TARGETS | 4 +- backends/cadence/utils/targets.bzl | 4 +- backends/example/TARGETS | 8 +-- .../example_backend_delegate_passes/TARGETS | 4 +- backends/example/example_operators/TARGETS | 4 +- backends/qualcomm/debugger/TARGETS | 4 +- backends/vulkan/quantizer/TARGETS | 4 +- backends/xnnpack/_passes/TARGETS | 4 +- backends/xnnpack/quantizer/TARGETS | 6 +- backends/xnnpack/utils/TARGETS | 4 +- devtools/TARGETS | 4 +- devtools/bundled_program/util/TARGETS | 4 +- devtools/debug_format/TARGETS | 6 +- devtools/etrecord/TARGETS | 4 +- devtools/etrecord/tests/TARGETS | 4 +- devtools/inspector/TARGETS | 8 +-- devtools/size_analysis_tool/TARGETS | 4 +- examples/cadence/operators/targets.bzl | 2 +- examples/llm_pte_finetuning/TARGETS | 6 +- examples/models/llama3_2_vision/TARGETS | 4 +- .../llama3_2_vision/text_decoder/TARGETS | 4 +- .../llama3_2_vision/vision_encoder/TARGETS | 4 +- examples/qualcomm/TARGETS | 4 +- examples/qualcomm/oss_scripts/llama/TARGETS | 6 +- exir/TARGETS | 50 +++++++-------- exir/backend/test/TARGETS | 14 ++--- exir/capture/TARGETS | 8 +-- exir/dialects/TARGETS | 4 +- exir/dialects/backend/TARGETS | 4 +- exir/dialects/edge/TARGETS | 4 +- exir/dialects/edge/arg/TARGETS | 4 +- exir/dialects/edge/dtype/TARGETS | 4 +- exir/dialects/edge/op/TARGETS | 4 +- exir/dialects/edge/spec/TARGETS | 4 +- exir/emit/TARGETS | 6 +- exir/operator/TARGETS | 8 +-- exir/passes/TARGETS | 62 +++++++++---------- exir/program/TARGETS | 8 +-- exir/serde/TARGETS | 4 +- exir/tests/TARGETS | 16 ++--- exir/verification/TARGETS | 8 +-- extension/llm/modules/TARGETS | 10 +-- extension/pytree/TARGETS | 4 +- extension/training/TARGETS | 4 +- test/end2end/TARGETS | 6 +- 53 files changed, 223 insertions(+), 223 deletions(-) diff --git a/backends/arm/TARGETS b/backends/arm/TARGETS index f4ab883362e..5951cdcc7cf 100644 --- a/backends/arm/TARGETS +++ b/backends/arm/TARGETS @@ -1,7 +1,7 @@ # @noautodeps -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "arm_partitioner", srcs = [ "ethosu_backend.py", @@ -18,7 +18,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "arm_backend", srcs = [ "arm_backend.py", @@ -37,7 +37,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "process_node", srcs = ["process_node.py"], typing = True, @@ -51,7 +51,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "arm_vela", srcs = [ "arm_vela.py", @@ -62,7 +62,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "tosa_mapping", srcs = [ "tosa_mapping.py", @@ -74,7 +74,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "tosa_quant_utils", srcs = [ "tosa_quant_utils.py", @@ -89,7 +89,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "tosa_specification", srcs = [ "tosa_specification.py", @@ -101,7 +101,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "tosa_utils", srcs = [ "tosa_utils.py", @@ -114,7 +114,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "arm_model_evaluator", srcs = [ "util/arm_model_evaluator.py", diff --git a/backends/arm/_passes/TARGETS b/backends/arm/_passes/TARGETS index 843d6b159dc..28698da0345 100644 --- a/backends/arm/_passes/TARGETS +++ b/backends/arm/_passes/TARGETS @@ -1,6 +1,6 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "passes", srcs = glob(["*.py"]), typing = True, diff --git a/backends/arm/operator_support/TARGETS b/backends/arm/operator_support/TARGETS index 0de9f060bf5..13e4fd2f1d5 100644 --- a/backends/arm/operator_support/TARGETS +++ b/backends/arm/operator_support/TARGETS @@ -1,6 +1,6 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "operator_support", srcs = glob(["*.py"]), typing = True, diff --git a/backends/arm/operators/TARGETS b/backends/arm/operators/TARGETS index cb08adb0354..28bd9e5b92a 100644 --- a/backends/arm/operators/TARGETS +++ b/backends/arm/operators/TARGETS @@ -1,7 +1,7 @@ # @noautodeps -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "node_visitor", srcs = ["node_visitor.py"], typing = True, @@ -11,7 +11,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "ops", srcs = glob(["op_*.py", "ops_*.py"]), typing = True, @@ -26,7 +26,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "lib", srcs = ["__init__.py"], typing = True, diff --git a/backends/arm/quantizer/TARGETS b/backends/arm/quantizer/TARGETS index bbd7322daf5..2be0d53cbe3 100644 --- a/backends/arm/quantizer/TARGETS +++ b/backends/arm/quantizer/TARGETS @@ -1,6 +1,6 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "arm_quantizer", srcs = ["arm_quantizer.py"], deps = [ @@ -11,7 +11,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "quantization_annotator", srcs = ["quantization_annotator.py"], deps = [ @@ -21,7 +21,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "quantization_config", srcs = ["quantization_config.py"], deps = [ @@ -29,7 +29,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "arm_quantizer_utils", srcs = ["arm_quantizer_utils.py"], deps = [ diff --git a/backends/arm/test/TARGETS b/backends/arm/test/TARGETS index 0e99a349956..4dfe73bb1bf 100644 --- a/backends/arm/test/TARGETS +++ b/backends/arm/test/TARGETS @@ -1,10 +1,10 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_arm_tests") oncall("executorch") -python_library( +runtime.python_library( name = "conftest", srcs = ["conftest.py"], deps = [ @@ -14,7 +14,7 @@ python_library( ] ) -python_library( +runtime.python_library( name = "runner_utils", srcs = ["runner_utils.py"], deps = [ @@ -26,7 +26,7 @@ python_library( ] ) -python_library( +runtime.python_library( name = "common", srcs = ["common.py"], deps = [ @@ -39,7 +39,7 @@ python_library( ] ) -python_library( +runtime.python_library( name = "common", srcs = ["common.py"], deps = [ @@ -52,7 +52,7 @@ python_library( ] ) -python_library( +runtime.python_library( name = "arm_tester", srcs = glob(["tester/*.py"]), deps = [ diff --git a/backends/cadence/aot/TARGETS b/backends/cadence/aot/TARGETS index 2dd3c4dc49d..52837de8523 100644 --- a/backends/cadence/aot/TARGETS +++ b/backends/cadence/aot/TARGETS @@ -5,7 +5,7 @@ # LICENSE file in the root directory of this source tree. load("@fbcode_macros//build_defs:export_files.bzl", "export_file") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load( "@fbsource//tools/build_defs:default_platform_defs.bzl", "CXX", @@ -15,7 +15,7 @@ load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("odai_jarvis") -python_library( +runtime.python_library( name = "utils", srcs = [ "utils.py", @@ -30,7 +30,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "compiler", srcs = [ "compiler.py", @@ -51,7 +51,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "export_example", srcs = [ "export_example.py", @@ -73,7 +73,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "pass_utils", srcs = [ "pass_utils.py", @@ -88,7 +88,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "passes", srcs = [ "passes.py", @@ -108,7 +108,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "ops_registrations", srcs = [ "ops_registrations.py", @@ -148,7 +148,7 @@ python_unittest( ], ) -python_library( +runtime.python_library( name = "compiler_utils", srcs = [ "compiler_utils.py", @@ -160,7 +160,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "graph_builder", srcs = [ "graph_builder.py", @@ -172,7 +172,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "fuse_ops", srcs = [ "fuse_ops.py", @@ -192,7 +192,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "simplify_ops", srcs = [ "simplify_ops.py", @@ -206,7 +206,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "remove_ops", srcs = [ "remove_ops.py", @@ -224,7 +224,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "reorder_ops", srcs = [ "reorder_ops.py", @@ -242,7 +242,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "replace_ops", srcs = [ "replace_ops.py", @@ -380,7 +380,7 @@ python_unittest( ) -python_library( +runtime.python_library( name = "memory_planning", srcs = [ "memory_planning.py", @@ -398,7 +398,7 @@ python_library( ) -python_library( +runtime.python_library( name = "memory_constraints", srcs = [ "memory_constraints.py", diff --git a/backends/cadence/aot/quantizer/TARGETS b/backends/cadence/aot/quantizer/TARGETS index 75eab631dd4..de2efa2cef8 100644 --- a/backends/cadence/aot/quantizer/TARGETS +++ b/backends/cadence/aot/quantizer/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("odai_jarvis") -python_library( +runtime.python_library( name = "utils", srcs = [ "utils.py", @@ -12,7 +12,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "patterns", srcs = [ "patterns.py", @@ -24,7 +24,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "quantizer", srcs = [ "quantizer.py", @@ -38,7 +38,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "fusion_pass", srcs = [ "fusion_pass.py", diff --git a/backends/cadence/runtime/TARGETS b/backends/cadence/runtime/TARGETS index 4055f1922a1..9c65c469280 100644 --- a/backends/cadence/runtime/TARGETS +++ b/backends/cadence/runtime/TARGETS @@ -1,9 +1,9 @@ load(":targets.bzl", "define_common_targets") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("odai_jarvis") -python_library( +runtime.python_library( name = "runtime", srcs = [ "__init__.py", diff --git a/backends/cadence/utils/targets.bzl b/backends/cadence/utils/targets.bzl index 5a8d18ec8a2..8b14f7684da 100644 --- a/backends/cadence/utils/targets.bzl +++ b/backends/cadence/utils/targets.bzl @@ -3,11 +3,11 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") def define_common_targets(): - python_library( + runtime.python_library( name = "facto_util", srcs = [ "facto_util.py", diff --git a/backends/example/TARGETS b/backends/example/TARGETS index e99a408cdb7..48fb971428b 100644 --- a/backends/example/TARGETS +++ b/backends/example/TARGETS @@ -1,9 +1,9 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_library( +runtime.python_library( name = "example_quantizer", srcs = [ "example_quantizer.py", @@ -15,7 +15,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "example_backend", srcs = [ "example_backend.py", @@ -27,7 +27,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "example_partitioner", srcs = [ "example_partitioner.py", diff --git a/backends/example/example_backend_delegate_passes/TARGETS b/backends/example/example_backend_delegate_passes/TARGETS index bc546ce410a..9e3b06486a8 100644 --- a/backends/example/example_backend_delegate_passes/TARGETS +++ b/backends/example/example_backend_delegate_passes/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "merge_to_dim_pass.py", diff --git a/backends/example/example_operators/TARGETS b/backends/example/example_operators/TARGETS index a4d85c8fb71..70f8f3cc0c5 100644 --- a/backends/example/example_operators/TARGETS +++ b/backends/example/example_operators/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "example_operators_lib", srcs = [ "adaptive_avg_pool2d.py", diff --git a/backends/qualcomm/debugger/TARGETS b/backends/qualcomm/debugger/TARGETS index bfdc6967ed7..85f204f9718 100644 --- a/backends/qualcomm/debugger/TARGETS +++ b/backends/qualcomm/debugger/TARGETS @@ -1,6 +1,6 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "utils", srcs = ["utils.py"], deps = [ diff --git a/backends/vulkan/quantizer/TARGETS b/backends/vulkan/quantizer/TARGETS index 5650f2bd728..e2771695be4 100644 --- a/backends/vulkan/quantizer/TARGETS +++ b/backends/vulkan/quantizer/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "vulkan_quantizer", srcs = [ "vulkan_quantizer.py", diff --git a/backends/xnnpack/_passes/TARGETS b/backends/xnnpack/_passes/TARGETS index a199e1aab01..c9cc54929de 100644 --- a/backends/xnnpack/_passes/TARGETS +++ b/backends/xnnpack/_passes/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "xnnpack_passes", srcs = native.glob(["*.py"]), deps = [ diff --git a/backends/xnnpack/quantizer/TARGETS b/backends/xnnpack/quantizer/TARGETS index c14998d0e33..496eefea070 100644 --- a/backends/xnnpack/quantizer/TARGETS +++ b/backends/xnnpack/quantizer/TARGETS @@ -1,6 +1,6 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "xnnpack_quantizer", srcs = ["xnnpack_quantizer.py"], deps = [ @@ -10,7 +10,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "xnnpack_quantizer_utils", srcs = ["xnnpack_quantizer_utils.py"], deps = [ diff --git a/backends/xnnpack/utils/TARGETS b/backends/xnnpack/utils/TARGETS index 55615e11063..d018f294c17 100644 --- a/backends/xnnpack/utils/TARGETS +++ b/backends/xnnpack/utils/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "xnnpack_utils", srcs = glob(["*.py"]), deps = [ diff --git a/devtools/TARGETS b/devtools/TARGETS index 06964b83876..2236702fbc7 100644 --- a/devtools/TARGETS +++ b/devtools/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/devtools/bundled_program/util/TARGETS b/devtools/bundled_program/util/TARGETS index 7d019ce30fb..b41e1ffd775 100644 --- a/devtools/bundled_program/util/TARGETS +++ b/devtools/bundled_program/util/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "test_util", srcs = [ "test_util.py", diff --git a/devtools/debug_format/TARGETS b/devtools/debug_format/TARGETS index 46f63fa31b3..2cbf7cf8048 100644 --- a/devtools/debug_format/TARGETS +++ b/devtools/debug_format/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "base_schema", srcs = [ "base_schema.py", @@ -11,7 +11,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "et_schema", srcs = [ "et_schema.py", diff --git a/devtools/etrecord/TARGETS b/devtools/etrecord/TARGETS index 09fc3212bf8..3bb70ef4564 100644 --- a/devtools/etrecord/TARGETS +++ b/devtools/etrecord/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "etrecord", srcs = [ "__init__.py", diff --git a/devtools/etrecord/tests/TARGETS b/devtools/etrecord/tests/TARGETS index fffa7f18341..616ec2304ca 100644 --- a/devtools/etrecord/tests/TARGETS +++ b/devtools/etrecord/tests/TARGETS @@ -1,4 +1,4 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") @@ -16,7 +16,7 @@ python_unittest( ], ) -python_library( +runtime.python_library( name = "etrecord_test_library", srcs = ["etrecord_test.py"], deps = [ diff --git a/devtools/inspector/TARGETS b/devtools/inspector/TARGETS index bba5f7f8951..45e7f13d787 100644 --- a/devtools/inspector/TARGETS +++ b/devtools/inspector/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "inspector", srcs = [ "_inspector.py", @@ -31,7 +31,7 @@ python_binary( ], ) -python_library( +runtime.python_library( name = "inspector_utils", srcs = [ "_inspector_utils.py", @@ -48,7 +48,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/devtools/size_analysis_tool/TARGETS b/devtools/size_analysis_tool/TARGETS index c365ba152d5..b37eee6a389 100644 --- a/devtools/size_analysis_tool/TARGETS +++ b/devtools/size_analysis_tool/TARGETS @@ -1,10 +1,10 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_library( +runtime.python_library( name = "size_analysis_tool_lib", srcs = [ "size_analysis_tool.py", diff --git a/examples/cadence/operators/targets.bzl b/examples/cadence/operators/targets.bzl index 68d90e8238f..f6f30d72dc2 100644 --- a/examples/cadence/operators/targets.bzl +++ b/examples/cadence/operators/targets.bzl @@ -5,7 +5,7 @@ # LICENSE file in the root directory of this source tree. load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") TESTS_LIST = [ "add_op", diff --git a/examples/llm_pte_finetuning/TARGETS b/examples/llm_pte_finetuning/TARGETS index 5ba24c11203..1acb7adee49 100644 --- a/examples/llm_pte_finetuning/TARGETS +++ b/examples/llm_pte_finetuning/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("papaya_oncall") -python_library( +runtime.python_library( name = "model_loading_lib", srcs = [ "model_loading_lib.py", @@ -20,7 +20,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "training_lib", srcs = [ "training_lib.py", diff --git a/examples/models/llama3_2_vision/TARGETS b/examples/models/llama3_2_vision/TARGETS index 133fd3a6839..b5ceb1da8ae 100644 --- a/examples/models/llama3_2_vision/TARGETS +++ b/examples/models/llama3_2_vision/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "multimodal_lib", srcs = [ "__init__.py", diff --git a/examples/models/llama3_2_vision/text_decoder/TARGETS b/examples/models/llama3_2_vision/text_decoder/TARGETS index e87b567f2bc..a0d3f5f7e51 100644 --- a/examples/models/llama3_2_vision/text_decoder/TARGETS +++ b/examples/models/llama3_2_vision/text_decoder/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "model", srcs = [ "model.py", diff --git a/examples/models/llama3_2_vision/vision_encoder/TARGETS b/examples/models/llama3_2_vision/vision_encoder/TARGETS index 82717a56d08..e910388f268 100644 --- a/examples/models/llama3_2_vision/vision_encoder/TARGETS +++ b/examples/models/llama3_2_vision/vision_encoder/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "model", srcs = [ "__init__.py", diff --git a/examples/qualcomm/TARGETS b/examples/qualcomm/TARGETS index 47f4fa422ce..713f8be8280 100644 --- a/examples/qualcomm/TARGETS +++ b/examples/qualcomm/TARGETS @@ -1,7 +1,7 @@ # 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("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") @@ -33,7 +33,7 @@ runtime.command_alias( exe = ":export_example", ) -python_library( +runtime.python_library( name = "utils", srcs = ["utils.py"], deps = [ diff --git a/examples/qualcomm/oss_scripts/llama/TARGETS b/examples/qualcomm/oss_scripts/llama/TARGETS index e4bad10a234..bf780bb1308 100644 --- a/examples/qualcomm/oss_scripts/llama/TARGETS +++ b/examples/qualcomm/oss_scripts/llama/TARGETS @@ -1,11 +1,11 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "static_llama", srcs = [ "model/static_llama.py", @@ -15,7 +15,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "llama_lib", srcs = ["llama.py"], deps = [ diff --git a/exir/TARGETS b/exir/TARGETS index 8539311e27d..f8a65349265 100644 --- a/exir/TARGETS +++ b/exir/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "tracer", srcs = [ "tracer.py", @@ -19,7 +19,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "graph", srcs = [ "graph.py", @@ -30,7 +30,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "graph_module", srcs = [ "graph_module.py", @@ -40,14 +40,14 @@ python_library( ], ) -python_library( +runtime.python_library( name = "scalar_type", srcs = [ "scalar_type.py", ], ) -python_library( +runtime.python_library( name = "schema", srcs = [ "schema.py", @@ -58,14 +58,14 @@ python_library( ], ) -python_library( +runtime.python_library( name = "version", srcs = [ "version.py", ], ) -python_library( +runtime.python_library( name = "tensor", srcs = [ "tensor.py", @@ -78,7 +78,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "memory", srcs = [ "memory.py", @@ -91,7 +91,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "control_flow", srcs = [ "control_flow.py", @@ -104,7 +104,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "delegate", srcs = [ "delegate.py", @@ -115,7 +115,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "lowered_backend_module", srcs = [ "lowered_backend_module.py", @@ -134,7 +134,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "lib", srcs = [ "__init__.py", @@ -149,7 +149,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "memory_planning", srcs = [ "memory_planning.py", @@ -166,7 +166,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "common", srcs = [ "common.py", @@ -176,7 +176,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "error", srcs = [ "error.py", @@ -184,7 +184,7 @@ python_library( deps = [], ) -python_library( +runtime.python_library( name = "types", srcs = [ "types.py", @@ -195,7 +195,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "wrap", srcs = [ "wrap.py", @@ -207,7 +207,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "print_program", srcs = [ "print_program.py", @@ -219,14 +219,14 @@ python_library( ], ) -python_library( +runtime.python_library( name = "dynamic_shape", srcs = [ "dynamic_shape.py", ], ) -python_library( +runtime.python_library( name = "pass_base", srcs = [ "pass_base.py", @@ -240,7 +240,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "pass_manager", srcs = [ "pass_manager.py", @@ -252,7 +252,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "sym_util", srcs = ["sym_util.py"], deps = [ @@ -261,7 +261,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "dim_order_utils", srcs = ["dim_order_utils.py"], deps = [ @@ -269,7 +269,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "_warnings", srcs = ["_warnings.py"], deps = [ diff --git a/exir/backend/test/TARGETS b/exir/backend/test/TARGETS index 5c3a5e3eb32..19736901913 100644 --- a/exir/backend/test/TARGETS +++ b/exir/backend/test/TARGETS @@ -1,9 +1,9 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_library( +runtime.python_library( name = "backend_with_compiler_demo", srcs = [ "backend_with_compiler_demo.py", @@ -20,7 +20,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "backend_with_delegate_mapping_demo", srcs = [ "backend_with_delegate_mapping_demo.py", @@ -38,7 +38,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "qnn_backend_demo", srcs = [ "qnn_backend_demo.py", @@ -53,7 +53,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "hta_partitioner_demo", srcs = [ "hta_partitioner_demo.py", @@ -72,7 +72,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "op_partitioner_demo", srcs = [ "op_partitioner_demo.py", @@ -93,7 +93,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "example_backends", deps = [ ":backend_with_compiler_demo", diff --git a/exir/capture/TARGETS b/exir/capture/TARGETS index 65e03c70bc9..983cdd210c9 100644 --- a/exir/capture/TARGETS +++ b/exir/capture/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "__init__.py", @@ -13,7 +13,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "capture", srcs = [ "_capture.py", @@ -29,7 +29,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "config", srcs = [ "_config.py", diff --git a/exir/dialects/TARGETS b/exir/dialects/TARGETS index c1f677071c5..39f0a9d0f1b 100644 --- a/exir/dialects/TARGETS +++ b/exir/dialects/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "_ops.py", diff --git a/exir/dialects/backend/TARGETS b/exir/dialects/backend/TARGETS index ed3d46a6b38..1bfd78a9ae1 100644 --- a/exir/dialects/backend/TARGETS +++ b/exir/dialects/backend/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "_ops.py", diff --git a/exir/dialects/edge/TARGETS b/exir/dialects/edge/TARGETS index 3a941d0ecee..4fcf1948b5f 100644 --- a/exir/dialects/edge/TARGETS +++ b/exir/dialects/edge/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:export_files.bzl", "export_file") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "_ops.py", diff --git a/exir/dialects/edge/arg/TARGETS b/exir/dialects/edge/arg/TARGETS index 7c499fa4bfa..79705a06357 100644 --- a/exir/dialects/edge/arg/TARGETS +++ b/exir/dialects/edge/arg/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("ai_infra_mobile_platform") -python_library( +runtime.python_library( name = "lib", srcs = [ "model.py", diff --git a/exir/dialects/edge/dtype/TARGETS b/exir/dialects/edge/dtype/TARGETS index 6beb5635c5b..9fbec419812 100644 --- a/exir/dialects/edge/dtype/TARGETS +++ b/exir/dialects/edge/dtype/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("ai_infra_mobile_platform") -python_library( +runtime.python_library( name = "lib", srcs = [ "runner.py", diff --git a/exir/dialects/edge/op/TARGETS b/exir/dialects/edge/op/TARGETS index ed4cda67bad..c4f5b5c4d70 100644 --- a/exir/dialects/edge/op/TARGETS +++ b/exir/dialects/edge/op/TARGETS @@ -1,9 +1,9 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("ai_infra_mobile_platform") -python_library( +runtime.python_library( name = "lib", srcs = [ "api.py", diff --git a/exir/dialects/edge/spec/TARGETS b/exir/dialects/edge/spec/TARGETS index 9433415b993..ce5c5970e14 100644 --- a/exir/dialects/edge/spec/TARGETS +++ b/exir/dialects/edge/spec/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("ai_infra_mobile_platform") -python_library( +runtime.python_library( name = "lib", srcs = [ "gen.py", diff --git a/exir/emit/TARGETS b/exir/emit/TARGETS index b97368c8312..0adee10e82e 100644 --- a/exir/emit/TARGETS +++ b/exir/emit/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "__init__.py", @@ -12,7 +12,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "emit", srcs = [ "_emit_program.py", diff --git a/exir/operator/TARGETS b/exir/operator/TARGETS index 0c08a47e620..209d1100773 100644 --- a/exir/operator/TARGETS +++ b/exir/operator/TARGETS @@ -1,9 +1,9 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_library( +runtime.python_library( name = "convert", srcs = [ "convert.py", @@ -14,7 +14,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "manip", srcs = [ "manip.py", @@ -25,7 +25,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "util", srcs = [ "util.py", diff --git a/exir/passes/TARGETS b/exir/passes/TARGETS index c34d4acede2..97cc2c0add1 100644 --- a/exir/passes/TARGETS +++ b/exir/passes/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "__init__.py", @@ -46,7 +46,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "pass_registry", srcs = [ "pass_registry.py", @@ -57,7 +57,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "external_constants_pass", srcs = [ "external_constants_pass.py", @@ -67,7 +67,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "insert_write_back_for_buffers_pass", srcs = [ "insert_write_back_for_buffers_pass.py", @@ -77,7 +77,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "weights_to_outputs_pass", srcs = [ "weights_to_outputs_pass.py", @@ -87,7 +87,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "const_prop_pass", srcs = [ "const_prop_pass.py", @@ -99,7 +99,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "scalar_to_tensor_pass", srcs = [ "scalar_to_tensor_pass.py", @@ -110,7 +110,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "constant_prop_pass", srcs = [ "constant_prop_pass.py", @@ -122,7 +122,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "remove_graph_asserts_pass", srcs = [ "remove_graph_asserts_pass.py", @@ -132,7 +132,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "sym_to_tensor_pass", srcs = [ "sym_to_tensor_pass.py", @@ -143,7 +143,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "quant_fusion_pass", srcs = [ "_quant_patterns_and_replacements.py", @@ -157,7 +157,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "quantize_io_pass", srcs = [ "quantize_io_pass.py", @@ -170,7 +170,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "memory_planning_pass", srcs = [ "memory_planning_pass.py", @@ -186,7 +186,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "remove_noop_pass", srcs = [ "remove_noop_pass.py", @@ -198,7 +198,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "prune_empty_tensor_pass", srcs = [ "prune_empty_tensors_pass.py", @@ -210,7 +210,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "remove_mixed_type_operators", srcs = [ "remove_mixed_type_operators.py", @@ -221,7 +221,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "spec_prop_pass", srcs = [ "spec_prop_pass.py", @@ -234,7 +234,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "init_mutable_pass", srcs = [ "init_mutable_pass.py", @@ -244,7 +244,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "sym_shape_eval_pass", srcs = [ "sym_shape_eval_pass.py", @@ -259,7 +259,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "replace_broken_ops_with_function_ops_pass", srcs = [ "replace_broken_ops_with_function_ops_pass.py", @@ -270,7 +270,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "replace_sym_size_op_pass", srcs = [ "replace_sym_size_op_pass.py", @@ -281,7 +281,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "replace_edge_with_backend_pass", srcs = [ "replace_edge_with_backend_pass.py", @@ -293,7 +293,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "normalize_transpose_pass", srcs = [ "normalize_transpose_pass.py", @@ -304,7 +304,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "replace_aten_with_edge_pass", srcs = [ "replace_aten_with_edge_pass.py", @@ -318,7 +318,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "debug_handle_generator_pass", srcs = [ "debug_handle_generator_pass.py", @@ -330,7 +330,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "prim_ops_py_registry", srcs = ["executorch_prim_ops_registry.py"], deps = [ @@ -339,7 +339,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "dim_order_ops_registry", srcs = ["dim_order_ops_registry.py"], deps = [ @@ -349,7 +349,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "memory_format_ops_pass", srcs = [ "memory_format_ops_pass.py", @@ -363,7 +363,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "normalize_view_copy_base_pass", srcs = [ "normalize_view_copy_base_pass.py", @@ -374,7 +374,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "replace_view_copy_with_view_pass", srcs = [ "replace_view_copy_with_view_pass.py", diff --git a/exir/program/TARGETS b/exir/program/TARGETS index 33e417e7326..aeddcb6ced9 100644 --- a/exir/program/TARGETS +++ b/exir/program/TARGETS @@ -1,9 +1,9 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "__init__.py", @@ -14,7 +14,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "program", srcs = [ "_program.py", @@ -48,7 +48,7 @@ python_library( ] + (["//executorch/exir/program/fb:logger"] if not runtime.is_oss else []) ) -python_library( +runtime.python_library( name = "fake_program", srcs = [ "_fake_program.py", diff --git a/exir/serde/TARGETS b/exir/serde/TARGETS index 7bede435359..6183474180e 100644 --- a/exir/serde/TARGETS +++ b/exir/serde/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( # @autodeps-skip for some reason autodeps thinks this target # needs to depend on exir:lib which it doesn't. name = "serialize", diff --git a/exir/tests/TARGETS b/exir/tests/TARGETS index 650a77c6ef6..80fdf2069f2 100644 --- a/exir/tests/TARGETS +++ b/exir/tests/TARGETS @@ -1,10 +1,10 @@ load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_library( +runtime.python_library( name = "lib", srcs = [ "common.py", @@ -15,7 +15,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "models", srcs = [ "models.py", @@ -27,7 +27,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "control_flow_models", srcs = [ "control_flow_models.py", @@ -37,7 +37,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "dynamic_shape_models", srcs = [ "dynamic_shape_models.py", @@ -47,7 +47,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "transformer", srcs = [ "transformer.py", @@ -57,7 +57,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "asr_joiner", srcs = [ "asr_joiner.py", @@ -403,7 +403,7 @@ python_unittest( ], ) -python_library( +runtime.python_library( name = "test_memory_format_ops_pass_utils", srcs = [ "test_memory_format_ops_pass_utils.py", diff --git a/exir/verification/TARGETS b/exir/verification/TARGETS index 8ee9e5546e3..0f58c535c7e 100644 --- a/exir/verification/TARGETS +++ b/exir/verification/TARGETS @@ -1,5 +1,5 @@ load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") @@ -19,7 +19,7 @@ cpp_python_extension( ], ) -python_library( +runtime.python_library( name = "interpreter", srcs = [ "interpreter.py", @@ -34,7 +34,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "devhtml", srcs = [ "dev_html.py", @@ -44,7 +44,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "verifier", srcs = [ "arg_validator.py", diff --git a/extension/llm/modules/TARGETS b/extension/llm/modules/TARGETS index c0d2edf3818..72cb146ef31 100644 --- a/extension/llm/modules/TARGETS +++ b/extension/llm/modules/TARGETS @@ -1,8 +1,8 @@ -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -python_library( +runtime.python_library( name = "kv_cache", srcs = [ "kv_cache.py", @@ -13,7 +13,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "attention", srcs = [ "attention.py", @@ -26,7 +26,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "position_embeddings", srcs = [ "_position_embeddings.py", @@ -36,7 +36,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "module_lib", srcs = [ "__init__.py", diff --git a/extension/pytree/TARGETS b/extension/pytree/TARGETS index 400a5b9504c..a1f4ff9d85f 100644 --- a/extension/pytree/TARGETS +++ b/extension/pytree/TARGETS @@ -2,7 +2,7 @@ # 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("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") @@ -37,7 +37,7 @@ cpp_python_extension( ], ) -python_library( +runtime.python_library( name = "pylib", srcs = [ "__init__.py", diff --git a/extension/training/TARGETS b/extension/training/TARGETS index d7a1a161370..eeed302c339 100644 --- a/extension/training/TARGETS +++ b/extension/training/TARGETS @@ -1,14 +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:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") define_common_targets() -python_library( +runtime.python_library( name = "lib", srcs = [ "__init__.py", diff --git a/test/end2end/TARGETS b/test/end2end/TARGETS index fdac0e4887a..e8c23edc500 100644 --- a/test/end2end/TARGETS +++ b/test/end2end/TARGETS @@ -1,11 +1,11 @@ # @noautodeps -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -python_library( +runtime.python_library( name = "exported_module", srcs = [ "exported_module.py", @@ -22,7 +22,7 @@ python_library( ], ) -python_library( +runtime.python_library( name = "register_scratch_meta_fns", srcs = [ "register_scratch_meta_fns.py", From 9c10640c68f6bce49084197701a9841a62b1cd7c Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Tue, 25 Feb 2025 16:36:58 -0800 Subject: [PATCH 06/10] Update [ghstack-poisoned] --- .ci/scripts/unittest-buck2.sh | 5 ++-- .../exec_aten/testing_util/test/targets.bzl | 28 ++++++++----------- runtime/core/test/targets.bzl | 17 +++++------ 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.ci/scripts/unittest-buck2.sh b/.ci/scripts/unittest-buck2.sh index 09275f29ae9..3c755b155f3 100755 --- a/.ci/scripts/unittest-buck2.sh +++ b/.ci/scripts/unittest-buck2.sh @@ -14,5 +14,6 @@ buck2 query "//backends/apple/... + //backends/example/... + \ //runtime/... + //schema/... + //test/... + //util/..." # TODO: expand the covered scope of Buck targets. -buck2 build //runtime/core/portable_type/... -buck2 test //runtime/core/portable_type/... +# runtime/test/... requires Python torch, which we don't have in our OSS buck setup. +buck2 build //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/... +buck2 test //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/... diff --git a/runtime/core/exec_aten/testing_util/test/targets.bzl b/runtime/core/exec_aten/testing_util/test/targets.bzl index 52a6dd0b7da..a37d08ecb22 100644 --- a/runtime/core/exec_aten/testing_util/test/targets.bzl +++ b/runtime/core/exec_aten/testing_util/test/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -15,19 +15,15 @@ def define_common_targets(): ], ) - runtime.cxx_test( - name = "tensor_factory_test", - srcs = ["tensor_factory_test.cpp"], - deps = [ - "//executorch/runtime/core/exec_aten/testing_util:tensor_util", - ], - ) + for aten_mode in get_aten_mode_options(): + aten_suffix = "_aten" if aten_mode else "" + preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else [] - runtime.cxx_test( - name = "tensor_factory_test_aten", - srcs = ["tensor_factory_test.cpp"], - preprocessor_flags = ["-DUSE_ATEN_LIB"], - deps = [ - "//executorch/runtime/core/exec_aten/testing_util:tensor_util_aten", - ], - ) + runtime.cxx_test( + name = "tensor_factory_test" + aten_suffix, + srcs = ["tensor_factory_test.cpp"], + preprocessor_flags = preprocessor_flags, + deps = [ + "//executorch/runtime/core/exec_aten/testing_util:tensor_util" + aten_suffix, + ], + ) diff --git a/runtime/core/test/targets.bzl b/runtime/core/test/targets.bzl index ef09c905674..180e4eb0a0d 100644 --- a/runtime/core/test/targets.bzl +++ b/runtime/core/test/targets.bzl @@ -93,14 +93,15 @@ def define_common_targets(): ], ) - runtime.cxx_test( - name = "tensor_shape_dynamism_test_aten", - srcs = ["tensor_shape_dynamism_test_aten.cpp"], - deps = [ - "//executorch/runtime/core/exec_aten:lib_aten", - "//executorch/runtime/core/exec_aten/testing_util:tensor_util_aten", - ], - ) + if True in get_aten_mode_options(): + runtime.cxx_test( + name = "tensor_shape_dynamism_test_aten", + srcs = ["tensor_shape_dynamism_test_aten.cpp"], + deps = [ + "//executorch/runtime/core/exec_aten:lib_aten", + "//executorch/runtime/core/exec_aten/testing_util:tensor_util_aten", + ], + ) for aten_mode in get_aten_mode_options(): aten_suffix = "_aten" if aten_mode else "" From ea921799b81aefed2893a4ab84164faf530688c2 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Wed, 5 Mar 2025 11:25:56 -0800 Subject: [PATCH 07/10] Update [ghstack-poisoned] --- shim_et/xplat/executorch/build/runtime_wrapper.bzl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shim_et/xplat/executorch/build/runtime_wrapper.bzl b/shim_et/xplat/executorch/build/runtime_wrapper.bzl index 79bc6c7e699..4060746426f 100644 --- a/shim_et/xplat/executorch/build/runtime_wrapper.bzl +++ b/shim_et/xplat/executorch/build/runtime_wrapper.bzl @@ -187,6 +187,9 @@ def _patch_kwargs_common(kwargs): for dep_type in ("deps", "exported_deps"): env.patch_deps(kwargs, dep_type) + if "visibility" not in kwargs: + kwargs["visibility"] = ["//executorch/..."] + # Patch up references to "//executorch/..." in lists of build targets, # if necessary. use_static_deps = kwargs.pop("use_static_deps", False) @@ -202,10 +205,6 @@ def _patch_kwargs_common(kwargs): function = native.partial(_patch_executorch_references, use_static_deps = use_static_deps), ) - # Make all targets private by default, like in xplat. - if "visibility" not in kwargs: - kwargs["visibility"] = [] - # If we see certain strings in the "visibility" list, expand them. if "@EXECUTORCH_CLIENTS" in kwargs["visibility"]: # See env.executorch_clients for this list. From b099a8a07672b0852460d8092bccc3a1af50c5de Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 7 Mar 2025 08:35:48 -0800 Subject: [PATCH 08/10] Update [ghstack-poisoned] --- .ci/scripts/unittest-buck2.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci/scripts/unittest-buck2.sh b/.ci/scripts/unittest-buck2.sh index 45416ece48b..4b614e32320 100755 --- a/.ci/scripts/unittest-buck2.sh +++ b/.ci/scripts/unittest-buck2.sh @@ -8,10 +8,14 @@ set -eux # TODO: expand this to //... # TODO: can't query cadence & vulkan backends +# TODO: can't query //kernels/prim_ops because of a cpp_unittest and +# broken code in shim to read oss.folly_cxx_tests. Sending fix but it +# needs to propagate and we need a submodule update. buck2 query "//backends/apple/... + //backends/example/... + \ //backends/mediatek/... + //backends/test/... + //backends/transforms/... + \ -//backends/xnnpack/... + //configurations/... + //kernels/portable/cpu/... + \ -//runtime/... + //schema/... + //test/... + //util/..." +//backends/xnnpack/... + //configurations/... + //kernels/aten/... + \ +//kernels/optimized/... + //kernels/portable/... + //kernels/quantized/... + \ +//kernels/test/... + //runtime/... + //schema/... + //test/... + //util/..." # TODO: expand the covered scope of Buck targets. # //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH. From b03f0e0e9380f85ae5303014e5ee78c5c44f187c Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 7 Mar 2025 08:59:46 -0800 Subject: [PATCH 09/10] Update [ghstack-poisoned] --- .ci/scripts/unittest-buck2.sh | 4 ++-- kernels/portable/cpu/targets.bzl | 15 ++++++++------- .../kernels/portable/op_registration_util.bzl | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.ci/scripts/unittest-buck2.sh b/.ci/scripts/unittest-buck2.sh index 4b614e32320..018e23a5567 100755 --- a/.ci/scripts/unittest-buck2.sh +++ b/.ci/scripts/unittest-buck2.sh @@ -20,5 +20,5 @@ buck2 query "//backends/apple/... + //backends/example/... + \ # TODO: expand the covered scope of Buck targets. # //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH. # //runtime/test/... requires Python torch, which we don't have in our OSS buck setup. -buck2 build //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/... -buck2 test //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/... +buck2 test //kernels/portable/cpu/... //runtime/backend/... //runtime/core/... \ + //runtime/executor: //runtime/kernel/... //runtime/platform/... diff --git a/kernels/portable/cpu/targets.bzl b/kernels/portable/cpu/targets.bzl index f6ef7150679..b428a5d107e 100644 --- a/kernels/portable/cpu/targets.bzl +++ b/kernels/portable/cpu/targets.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime") load("@fbsource//xplat/executorch/kernels/portable:op_registration_util.bzl", "ATEN_OPS", "CUSTOM_OPS", "define_op_target") def define_common_targets(): @@ -29,12 +29,13 @@ def define_common_targets(): exported_deps = all_op_targets, ) - runtime.cxx_library( - name = "cpu_aten", - srcs = [], - visibility = ["//executorch/kernels/portable/..."], - exported_deps = [t + "_aten" for t in custom_op_targets], - ) + if True in get_aten_mode_options(): + runtime.cxx_library( + name = "cpu_aten", + srcs = [], + visibility = ["//executorch/kernels/portable/..."], + exported_deps = [t + "_aten" for t in custom_op_targets], + ) # Only for use by op targets under //executorch. This API needs to be # reevaluated before becoming a public API. diff --git a/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl b/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl index acab7cb03f3..b56413b92f4 100644 --- a/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl +++ b/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "is_xplat", "runtime") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "is_xplat", "runtime") load("@fbsource//xplat/executorch/build:selects.bzl", "selects") def get_compiler_optimization_flags(): @@ -170,7 +170,7 @@ def define_op_target(name, deps, android_deps, is_aten_op, is_et_op = True, _all # If this is a custom op, define a target that builds it with at::Tensor # so that it can be imported into a host PyTorch environment for authoring. - if not is_aten_op: + if not is_aten_op and True in get_aten_mode_options(): define_op_library( name = name, deps = _aten_mode_deps if _aten_mode_deps else deps, From 0a3a58b745d0f3fe421cf0a2c680ff5ff92e89f6 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 7 Mar 2025 09:27:05 -0800 Subject: [PATCH 10/10] Update [ghstack-poisoned] --- backends/arm/TARGETS | 20 +++--- backends/arm/_passes/TARGETS | 4 +- backends/arm/operator_support/TARGETS | 4 +- backends/arm/operators/TARGETS | 8 +-- backends/arm/quantizer/TARGETS | 10 +-- backends/arm/test/TARGETS | 10 +-- backends/cadence/aot/TARGETS | 32 +++++----- backends/cadence/aot/quantizer/TARGETS | 10 +-- backends/cadence/runtime/TARGETS | 4 +- backends/cadence/utils/targets.bzl | 4 +- backends/example/TARGETS | 8 +-- .../example_backend_delegate_passes/TARGETS | 4 +- backends/example/example_operators/TARGETS | 4 +- backends/qualcomm/debugger/TARGETS | 4 +- backends/qualcomm/tests/TARGETS | 6 +- backends/vulkan/quantizer/TARGETS | 4 +- backends/xnnpack/_passes/TARGETS | 4 +- backends/xnnpack/quantizer/TARGETS | 10 +-- backends/xnnpack/utils/TARGETS | 4 +- devtools/TARGETS | 8 +-- devtools/bundled_program/util/TARGETS | 4 +- devtools/debug_format/TARGETS | 6 +- devtools/etrecord/TARGETS | 4 +- devtools/etrecord/tests/TARGETS | 4 +- devtools/inspector/TARGETS | 8 +-- devtools/size_analysis_tool/TARGETS | 9 +-- examples/cadence/operators/targets.bzl | 2 +- examples/llm_pte_finetuning/TARGETS | 6 +- examples/models/llama3_2_vision/TARGETS | 4 +- .../llama3_2_vision/text_decoder/TARGETS | 4 +- .../llama3_2_vision/vision_encoder/TARGETS | 4 +- examples/qualcomm/TARGETS | 4 +- examples/qualcomm/oss_scripts/llama/TARGETS | 6 +- exir/TARGETS | 50 +++++++-------- exir/backend/test/TARGETS | 14 ++--- exir/capture/TARGETS | 8 +-- exir/dialects/TARGETS | 4 +- exir/dialects/backend/TARGETS | 4 +- exir/dialects/edge/TARGETS | 4 +- exir/dialects/edge/arg/TARGETS | 4 +- exir/dialects/edge/dtype/TARGETS | 4 +- exir/dialects/edge/op/TARGETS | 4 +- exir/dialects/edge/spec/TARGETS | 4 +- exir/emit/TARGETS | 6 +- exir/operator/TARGETS | 8 +-- exir/passes/TARGETS | 62 +++++++++---------- exir/program/TARGETS | 8 +-- exir/serde/TARGETS | 4 +- exir/tests/TARGETS | 16 ++--- exir/verification/TARGETS | 8 +-- extension/llm/modules/TARGETS | 10 +-- extension/pytree/TARGETS | 4 +- extension/training/TARGETS | 4 +- test/end2end/TARGETS | 6 +- 54 files changed, 226 insertions(+), 237 deletions(-) diff --git a/backends/arm/TARGETS b/backends/arm/TARGETS index 0a9382c0168..63140dc7b9f 100644 --- a/backends/arm/TARGETS +++ b/backends/arm/TARGETS @@ -1,6 +1,6 @@ # @noautodeps -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +python_library( name = "arm_partitioner", srcs = [ "ethosu_backend.py", @@ -15,7 +15,7 @@ runtime.python_library( "//executorch/exir:lib", ], ) -runtime.python_library( +python_library( name = "arm_backend", srcs = [ "arm_backend.py", @@ -32,7 +32,7 @@ runtime.python_library( "//executorch/backends/arm/_passes:passes", ], ) -runtime.python_library( +python_library( name = "process_node", srcs = ["process_node.py"], deps = [ @@ -44,7 +44,7 @@ runtime.python_library( "//executorch/exir:lib", ], ) -runtime.python_library( +python_library( name = "arm_vela", srcs = [ "arm_vela.py", @@ -53,7 +53,7 @@ runtime.python_library( "fbsource//third-party/pypi/ethos-u-vela:ethos-u-vela", ], ) -runtime.python_library( +python_library( name = "tosa_mapping", srcs = [ "tosa_mapping.py", @@ -63,7 +63,7 @@ runtime.python_library( "//caffe2:torch", ], ) -runtime.python_library( +python_library( name = "tosa_quant_utils", srcs = [ "tosa_quant_utils.py", @@ -76,7 +76,7 @@ runtime.python_library( "//executorch/exir/dialects:lib", ], ) -runtime.python_library( +python_library( name = "tosa_specification", srcs = [ "tosa_specification.py", @@ -86,7 +86,7 @@ runtime.python_library( "//executorch/exir/backend:compile_spec_schema", ], ) -runtime.python_library( +python_library( name = "tosa_utils", srcs = [ "tosa_utils.py", @@ -97,7 +97,7 @@ runtime.python_library( "//executorch/backends/arm/operators:node_visitor", ], ) -runtime.python_library( +python_library( name = "arm_model_evaluator", srcs = [ "util/arm_model_evaluator.py", diff --git a/backends/arm/_passes/TARGETS b/backends/arm/_passes/TARGETS index b70b21a081b..c56eaca8d4b 100644 --- a/backends/arm/_passes/TARGETS +++ b/backends/arm/_passes/TARGETS @@ -1,6 +1,6 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") -runtime.python_library( +python_library( name = "passes", srcs = glob(["*.py"]), deps = [ diff --git a/backends/arm/operator_support/TARGETS b/backends/arm/operator_support/TARGETS index 2af1f84b4e3..c0c5af7487b 100644 --- a/backends/arm/operator_support/TARGETS +++ b/backends/arm/operator_support/TARGETS @@ -1,6 +1,6 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") -runtime.python_library( +python_library( name = "operator_support", srcs = glob(["*.py"]), deps = [ diff --git a/backends/arm/operators/TARGETS b/backends/arm/operators/TARGETS index 1749c6f4c03..b37823b60c2 100644 --- a/backends/arm/operators/TARGETS +++ b/backends/arm/operators/TARGETS @@ -1,7 +1,7 @@ # @noautodeps -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") -runtime.python_library( +python_library( name = "node_visitor", srcs = ["node_visitor.py"], deps = [ @@ -10,7 +10,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "ops", srcs = glob(["op_*.py", "ops_*.py"]), deps = [ @@ -24,7 +24,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/backends/arm/quantizer/TARGETS b/backends/arm/quantizer/TARGETS index 2be0d53cbe3..bbd7322daf5 100644 --- a/backends/arm/quantizer/TARGETS +++ b/backends/arm/quantizer/TARGETS @@ -1,6 +1,6 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") -runtime.python_library( +python_library( name = "arm_quantizer", srcs = ["arm_quantizer.py"], deps = [ @@ -11,7 +11,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "quantization_annotator", srcs = ["quantization_annotator.py"], deps = [ @@ -21,7 +21,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "quantization_config", srcs = ["quantization_config.py"], deps = [ @@ -29,7 +29,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "arm_quantizer_utils", srcs = ["arm_quantizer_utils.py"], deps = [ diff --git a/backends/arm/test/TARGETS b/backends/arm/test/TARGETS index c4e23132492..58239913e29 100644 --- a/backends/arm/test/TARGETS +++ b/backends/arm/test/TARGETS @@ -1,10 +1,10 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load(":targets.bzl", "define_arm_tests") oncall("executorch") -runtime.python_library( +python_library( name = "conftest", srcs = ["conftest.py"], deps = [ @@ -14,7 +14,7 @@ runtime.python_library( ] ) -runtime.python_library( +python_library( name = "runner_utils", srcs = ["runner_utils.py"], deps = [ @@ -26,7 +26,7 @@ runtime.python_library( ] ) -runtime.python_library( +python_library( name = "common", srcs = ["common.py"], deps = [ @@ -39,7 +39,7 @@ runtime.python_library( ] ) -runtime.python_library( +python_library( name = "arm_tester", srcs = glob(["tester/*.py"]), deps = [ diff --git a/backends/cadence/aot/TARGETS b/backends/cadence/aot/TARGETS index 52837de8523..2dd3c4dc49d 100644 --- a/backends/cadence/aot/TARGETS +++ b/backends/cadence/aot/TARGETS @@ -5,7 +5,7 @@ # LICENSE file in the root directory of this source tree. load("@fbcode_macros//build_defs:export_files.bzl", "export_file") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load( "@fbsource//tools/build_defs:default_platform_defs.bzl", "CXX", @@ -15,7 +15,7 @@ load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("odai_jarvis") -runtime.python_library( +python_library( name = "utils", srcs = [ "utils.py", @@ -30,7 +30,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "compiler", srcs = [ "compiler.py", @@ -51,7 +51,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "export_example", srcs = [ "export_example.py", @@ -73,7 +73,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "pass_utils", srcs = [ "pass_utils.py", @@ -88,7 +88,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "passes", srcs = [ "passes.py", @@ -108,7 +108,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "ops_registrations", srcs = [ "ops_registrations.py", @@ -148,7 +148,7 @@ python_unittest( ], ) -runtime.python_library( +python_library( name = "compiler_utils", srcs = [ "compiler_utils.py", @@ -160,7 +160,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "graph_builder", srcs = [ "graph_builder.py", @@ -172,7 +172,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "fuse_ops", srcs = [ "fuse_ops.py", @@ -192,7 +192,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "simplify_ops", srcs = [ "simplify_ops.py", @@ -206,7 +206,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "remove_ops", srcs = [ "remove_ops.py", @@ -224,7 +224,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "reorder_ops", srcs = [ "reorder_ops.py", @@ -242,7 +242,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "replace_ops", srcs = [ "replace_ops.py", @@ -380,7 +380,7 @@ python_unittest( ) -runtime.python_library( +python_library( name = "memory_planning", srcs = [ "memory_planning.py", @@ -398,7 +398,7 @@ runtime.python_library( ) -runtime.python_library( +python_library( name = "memory_constraints", srcs = [ "memory_constraints.py", diff --git a/backends/cadence/aot/quantizer/TARGETS b/backends/cadence/aot/quantizer/TARGETS index de2efa2cef8..75eab631dd4 100644 --- a/backends/cadence/aot/quantizer/TARGETS +++ b/backends/cadence/aot/quantizer/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("odai_jarvis") -runtime.python_library( +python_library( name = "utils", srcs = [ "utils.py", @@ -12,7 +12,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "patterns", srcs = [ "patterns.py", @@ -24,7 +24,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "quantizer", srcs = [ "quantizer.py", @@ -38,7 +38,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "fusion_pass", srcs = [ "fusion_pass.py", diff --git a/backends/cadence/runtime/TARGETS b/backends/cadence/runtime/TARGETS index 9c65c469280..4055f1922a1 100644 --- a/backends/cadence/runtime/TARGETS +++ b/backends/cadence/runtime/TARGETS @@ -1,9 +1,9 @@ load(":targets.bzl", "define_common_targets") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("odai_jarvis") -runtime.python_library( +python_library( name = "runtime", srcs = [ "__init__.py", diff --git a/backends/cadence/utils/targets.bzl b/backends/cadence/utils/targets.bzl index 8b14f7684da..5a8d18ec8a2 100644 --- a/backends/cadence/utils/targets.bzl +++ b/backends/cadence/utils/targets.bzl @@ -3,11 +3,11 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") def define_common_targets(): - runtime.python_library( + python_library( name = "facto_util", srcs = [ "facto_util.py", diff --git a/backends/example/TARGETS b/backends/example/TARGETS index 48fb971428b..e99a408cdb7 100644 --- a/backends/example/TARGETS +++ b/backends/example/TARGETS @@ -1,9 +1,9 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +python_library( name = "example_quantizer", srcs = [ "example_quantizer.py", @@ -15,7 +15,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "example_backend", srcs = [ "example_backend.py", @@ -27,7 +27,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "example_partitioner", srcs = [ "example_partitioner.py", diff --git a/backends/example/example_backend_delegate_passes/TARGETS b/backends/example/example_backend_delegate_passes/TARGETS index 9e3b06486a8..bc546ce410a 100644 --- a/backends/example/example_backend_delegate_passes/TARGETS +++ b/backends/example/example_backend_delegate_passes/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "merge_to_dim_pass.py", diff --git a/backends/example/example_operators/TARGETS b/backends/example/example_operators/TARGETS index 70f8f3cc0c5..a4d85c8fb71 100644 --- a/backends/example/example_operators/TARGETS +++ b/backends/example/example_operators/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "example_operators_lib", srcs = [ "adaptive_avg_pool2d.py", diff --git a/backends/qualcomm/debugger/TARGETS b/backends/qualcomm/debugger/TARGETS index 85f204f9718..bfdc6967ed7 100644 --- a/backends/qualcomm/debugger/TARGETS +++ b/backends/qualcomm/debugger/TARGETS @@ -1,6 +1,6 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") -runtime.python_library( +python_library( name = "utils", srcs = ["utils.py"], deps = [ diff --git a/backends/qualcomm/tests/TARGETS b/backends/qualcomm/tests/TARGETS index 8bd1d3d018b..b6a9664dcbf 100644 --- a/backends/qualcomm/tests/TARGETS +++ b/backends/qualcomm/tests/TARGETS @@ -1,8 +1,8 @@ +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -runtime.python_library( +python_library( name = "models", srcs = ["models.py"], deps = [ @@ -10,7 +10,7 @@ runtime.python_library( ] ) -runtime.python_library( +python_library( name = "test_qnn_delegate", srcs = [ "test_qnn_delegate.py", diff --git a/backends/vulkan/quantizer/TARGETS b/backends/vulkan/quantizer/TARGETS index e2771695be4..5650f2bd728 100644 --- a/backends/vulkan/quantizer/TARGETS +++ b/backends/vulkan/quantizer/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "vulkan_quantizer", srcs = [ "vulkan_quantizer.py", diff --git a/backends/xnnpack/_passes/TARGETS b/backends/xnnpack/_passes/TARGETS index c9cc54929de..a199e1aab01 100644 --- a/backends/xnnpack/_passes/TARGETS +++ b/backends/xnnpack/_passes/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "xnnpack_passes", srcs = native.glob(["*.py"]), deps = [ diff --git a/backends/xnnpack/quantizer/TARGETS b/backends/xnnpack/quantizer/TARGETS index bdae9877f99..c14998d0e33 100644 --- a/backends/xnnpack/quantizer/TARGETS +++ b/backends/xnnpack/quantizer/TARGETS @@ -1,12 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") -runtime.python_library( +python_library( name = "xnnpack_quantizer", srcs = ["xnnpack_quantizer.py"], - visibility = [ - "//executorch/...", - "@EXECUTORCH_CLIENTS", - ], deps = [ ":xnnpack_quantizer_utils", "//caffe2:torch", @@ -14,7 +10,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "xnnpack_quantizer_utils", srcs = ["xnnpack_quantizer_utils.py"], deps = [ diff --git a/backends/xnnpack/utils/TARGETS b/backends/xnnpack/utils/TARGETS index d018f294c17..55615e11063 100644 --- a/backends/xnnpack/utils/TARGETS +++ b/backends/xnnpack/utils/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "xnnpack_utils", srcs = glob(["*.py"]), deps = [ diff --git a/devtools/TARGETS b/devtools/TARGETS index 5eb7027305d..06964b83876 100644 --- a/devtools/TARGETS +++ b/devtools/TARGETS @@ -1,14 +1,10 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = ["__init__.py"], - visibility = [ - "//executorch/...", - "@EXECUTORCH_CLIENTS", - ], deps = [ "//executorch/devtools/bundled_program:core", "//executorch/devtools/etrecord:etrecord", diff --git a/devtools/bundled_program/util/TARGETS b/devtools/bundled_program/util/TARGETS index b41e1ffd775..7d019ce30fb 100644 --- a/devtools/bundled_program/util/TARGETS +++ b/devtools/bundled_program/util/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "test_util", srcs = [ "test_util.py", diff --git a/devtools/debug_format/TARGETS b/devtools/debug_format/TARGETS index 2cbf7cf8048..46f63fa31b3 100644 --- a/devtools/debug_format/TARGETS +++ b/devtools/debug_format/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "base_schema", srcs = [ "base_schema.py", @@ -11,7 +11,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "et_schema", srcs = [ "et_schema.py", diff --git a/devtools/etrecord/TARGETS b/devtools/etrecord/TARGETS index 3bb70ef4564..09fc3212bf8 100644 --- a/devtools/etrecord/TARGETS +++ b/devtools/etrecord/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "etrecord", srcs = [ "__init__.py", diff --git a/devtools/etrecord/tests/TARGETS b/devtools/etrecord/tests/TARGETS index 616ec2304ca..fffa7f18341 100644 --- a/devtools/etrecord/tests/TARGETS +++ b/devtools/etrecord/tests/TARGETS @@ -1,4 +1,4 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") @@ -16,7 +16,7 @@ python_unittest( ], ) -runtime.python_library( +python_library( name = "etrecord_test_library", srcs = ["etrecord_test.py"], deps = [ diff --git a/devtools/inspector/TARGETS b/devtools/inspector/TARGETS index 45e7f13d787..bba5f7f8951 100644 --- a/devtools/inspector/TARGETS +++ b/devtools/inspector/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "inspector", srcs = [ "_inspector.py", @@ -31,7 +31,7 @@ python_binary( ], ) -runtime.python_library( +python_library( name = "inspector_utils", srcs = [ "_inspector_utils.py", @@ -48,7 +48,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "lib", srcs = ["__init__.py"], deps = [ diff --git a/devtools/size_analysis_tool/TARGETS b/devtools/size_analysis_tool/TARGETS index 6894e9796d2..c365ba152d5 100644 --- a/devtools/size_analysis_tool/TARGETS +++ b/devtools/size_analysis_tool/TARGETS @@ -1,18 +1,15 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +python_library( name = "size_analysis_tool_lib", srcs = [ "size_analysis_tool.py", ], - visibility = [ - "//executorch/...", - "@EXECUTORCH_CLIENTS", - ], + visibility = ["PUBLIC"], deps = [ "//caffe2:torch", "//executorch/devtools:lib", diff --git a/examples/cadence/operators/targets.bzl b/examples/cadence/operators/targets.bzl index f6f30d72dc2..68d90e8238f 100644 --- a/examples/cadence/operators/targets.bzl +++ b/examples/cadence/operators/targets.bzl @@ -5,7 +5,7 @@ # LICENSE file in the root directory of this source tree. load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") TESTS_LIST = [ "add_op", diff --git a/examples/llm_pte_finetuning/TARGETS b/examples/llm_pte_finetuning/TARGETS index 1acb7adee49..5ba24c11203 100644 --- a/examples/llm_pte_finetuning/TARGETS +++ b/examples/llm_pte_finetuning/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("papaya_oncall") -runtime.python_library( +python_library( name = "model_loading_lib", srcs = [ "model_loading_lib.py", @@ -20,7 +20,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "training_lib", srcs = [ "training_lib.py", diff --git a/examples/models/llama3_2_vision/TARGETS b/examples/models/llama3_2_vision/TARGETS index b5ceb1da8ae..133fd3a6839 100644 --- a/examples/models/llama3_2_vision/TARGETS +++ b/examples/models/llama3_2_vision/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "multimodal_lib", srcs = [ "__init__.py", diff --git a/examples/models/llama3_2_vision/text_decoder/TARGETS b/examples/models/llama3_2_vision/text_decoder/TARGETS index a0d3f5f7e51..e87b567f2bc 100644 --- a/examples/models/llama3_2_vision/text_decoder/TARGETS +++ b/examples/models/llama3_2_vision/text_decoder/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "model", srcs = [ "model.py", diff --git a/examples/models/llama3_2_vision/vision_encoder/TARGETS b/examples/models/llama3_2_vision/vision_encoder/TARGETS index e910388f268..82717a56d08 100644 --- a/examples/models/llama3_2_vision/vision_encoder/TARGETS +++ b/examples/models/llama3_2_vision/vision_encoder/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "model", srcs = [ "__init__.py", diff --git a/examples/qualcomm/TARGETS b/examples/qualcomm/TARGETS index 713f8be8280..47f4fa422ce 100644 --- a/examples/qualcomm/TARGETS +++ b/examples/qualcomm/TARGETS @@ -1,7 +1,7 @@ # 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("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") @@ -33,7 +33,7 @@ runtime.command_alias( exe = ":export_example", ) -runtime.python_library( +python_library( name = "utils", srcs = ["utils.py"], deps = [ diff --git a/examples/qualcomm/oss_scripts/llama/TARGETS b/examples/qualcomm/oss_scripts/llama/TARGETS index bf780bb1308..e4bad10a234 100644 --- a/examples/qualcomm/oss_scripts/llama/TARGETS +++ b/examples/qualcomm/oss_scripts/llama/TARGETS @@ -1,11 +1,11 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +python_library( name = "static_llama", srcs = [ "model/static_llama.py", @@ -15,7 +15,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "llama_lib", srcs = ["llama.py"], deps = [ diff --git a/exir/TARGETS b/exir/TARGETS index f8a65349265..8539311e27d 100644 --- a/exir/TARGETS +++ b/exir/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "tracer", srcs = [ "tracer.py", @@ -19,7 +19,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "graph", srcs = [ "graph.py", @@ -30,7 +30,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "graph_module", srcs = [ "graph_module.py", @@ -40,14 +40,14 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "scalar_type", srcs = [ "scalar_type.py", ], ) -runtime.python_library( +python_library( name = "schema", srcs = [ "schema.py", @@ -58,14 +58,14 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "version", srcs = [ "version.py", ], ) -runtime.python_library( +python_library( name = "tensor", srcs = [ "tensor.py", @@ -78,7 +78,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "memory", srcs = [ "memory.py", @@ -91,7 +91,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "control_flow", srcs = [ "control_flow.py", @@ -104,7 +104,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "delegate", srcs = [ "delegate.py", @@ -115,7 +115,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "lowered_backend_module", srcs = [ "lowered_backend_module.py", @@ -134,7 +134,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "lib", srcs = [ "__init__.py", @@ -149,7 +149,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "memory_planning", srcs = [ "memory_planning.py", @@ -166,7 +166,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "common", srcs = [ "common.py", @@ -176,7 +176,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "error", srcs = [ "error.py", @@ -184,7 +184,7 @@ runtime.python_library( deps = [], ) -runtime.python_library( +python_library( name = "types", srcs = [ "types.py", @@ -195,7 +195,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "wrap", srcs = [ "wrap.py", @@ -207,7 +207,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "print_program", srcs = [ "print_program.py", @@ -219,14 +219,14 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "dynamic_shape", srcs = [ "dynamic_shape.py", ], ) -runtime.python_library( +python_library( name = "pass_base", srcs = [ "pass_base.py", @@ -240,7 +240,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "pass_manager", srcs = [ "pass_manager.py", @@ -252,7 +252,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "sym_util", srcs = ["sym_util.py"], deps = [ @@ -261,7 +261,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "dim_order_utils", srcs = ["dim_order_utils.py"], deps = [ @@ -269,7 +269,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "_warnings", srcs = ["_warnings.py"], deps = [ diff --git a/exir/backend/test/TARGETS b/exir/backend/test/TARGETS index 8e0e02e3c93..b453f4c722a 100644 --- a/exir/backend/test/TARGETS +++ b/exir/backend/test/TARGETS @@ -1,9 +1,9 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +python_library( name = "backend_with_compiler_demo", srcs = [ "backend_with_compiler_demo.py", @@ -20,7 +20,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "backend_with_delegate_mapping_demo", srcs = [ "backend_with_delegate_mapping_demo.py", @@ -38,7 +38,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "qnn_backend_demo", srcs = [ "qnn_backend_demo.py", @@ -53,7 +53,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "hta_partitioner_demo", srcs = [ "hta_partitioner_demo.py", @@ -72,7 +72,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "op_partitioner_demo", srcs = [ "op_partitioner_demo.py", @@ -93,7 +93,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "example_backends", deps = [ ":backend_with_compiler_demo", diff --git a/exir/capture/TARGETS b/exir/capture/TARGETS index 983cdd210c9..65e03c70bc9 100644 --- a/exir/capture/TARGETS +++ b/exir/capture/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "__init__.py", @@ -13,7 +13,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "capture", srcs = [ "_capture.py", @@ -29,7 +29,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "config", srcs = [ "_config.py", diff --git a/exir/dialects/TARGETS b/exir/dialects/TARGETS index 39f0a9d0f1b..c1f677071c5 100644 --- a/exir/dialects/TARGETS +++ b/exir/dialects/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "_ops.py", diff --git a/exir/dialects/backend/TARGETS b/exir/dialects/backend/TARGETS index 1bfd78a9ae1..ed3d46a6b38 100644 --- a/exir/dialects/backend/TARGETS +++ b/exir/dialects/backend/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "_ops.py", diff --git a/exir/dialects/edge/TARGETS b/exir/dialects/edge/TARGETS index 4fcf1948b5f..3a941d0ecee 100644 --- a/exir/dialects/edge/TARGETS +++ b/exir/dialects/edge/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:export_files.bzl", "export_file") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "_ops.py", diff --git a/exir/dialects/edge/arg/TARGETS b/exir/dialects/edge/arg/TARGETS index 79705a06357..7c499fa4bfa 100644 --- a/exir/dialects/edge/arg/TARGETS +++ b/exir/dialects/edge/arg/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("ai_infra_mobile_platform") -runtime.python_library( +python_library( name = "lib", srcs = [ "model.py", diff --git a/exir/dialects/edge/dtype/TARGETS b/exir/dialects/edge/dtype/TARGETS index 9fbec419812..6beb5635c5b 100644 --- a/exir/dialects/edge/dtype/TARGETS +++ b/exir/dialects/edge/dtype/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("ai_infra_mobile_platform") -runtime.python_library( +python_library( name = "lib", srcs = [ "runner.py", diff --git a/exir/dialects/edge/op/TARGETS b/exir/dialects/edge/op/TARGETS index c4f5b5c4d70..ed4cda67bad 100644 --- a/exir/dialects/edge/op/TARGETS +++ b/exir/dialects/edge/op/TARGETS @@ -1,9 +1,9 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("ai_infra_mobile_platform") -runtime.python_library( +python_library( name = "lib", srcs = [ "api.py", diff --git a/exir/dialects/edge/spec/TARGETS b/exir/dialects/edge/spec/TARGETS index ce5c5970e14..9433415b993 100644 --- a/exir/dialects/edge/spec/TARGETS +++ b/exir/dialects/edge/spec/TARGETS @@ -1,9 +1,9 @@ load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("ai_infra_mobile_platform") -runtime.python_library( +python_library( name = "lib", srcs = [ "gen.py", diff --git a/exir/emit/TARGETS b/exir/emit/TARGETS index 0adee10e82e..b97368c8312 100644 --- a/exir/emit/TARGETS +++ b/exir/emit/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "__init__.py", @@ -12,7 +12,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "emit", srcs = [ "_emit_program.py", diff --git a/exir/operator/TARGETS b/exir/operator/TARGETS index 209d1100773..0c08a47e620 100644 --- a/exir/operator/TARGETS +++ b/exir/operator/TARGETS @@ -1,9 +1,9 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +python_library( name = "convert", srcs = [ "convert.py", @@ -14,7 +14,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "manip", srcs = [ "manip.py", @@ -25,7 +25,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "util", srcs = [ "util.py", diff --git a/exir/passes/TARGETS b/exir/passes/TARGETS index 97cc2c0add1..c34d4acede2 100644 --- a/exir/passes/TARGETS +++ b/exir/passes/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "__init__.py", @@ -46,7 +46,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "pass_registry", srcs = [ "pass_registry.py", @@ -57,7 +57,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "external_constants_pass", srcs = [ "external_constants_pass.py", @@ -67,7 +67,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "insert_write_back_for_buffers_pass", srcs = [ "insert_write_back_for_buffers_pass.py", @@ -77,7 +77,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "weights_to_outputs_pass", srcs = [ "weights_to_outputs_pass.py", @@ -87,7 +87,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "const_prop_pass", srcs = [ "const_prop_pass.py", @@ -99,7 +99,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "scalar_to_tensor_pass", srcs = [ "scalar_to_tensor_pass.py", @@ -110,7 +110,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "constant_prop_pass", srcs = [ "constant_prop_pass.py", @@ -122,7 +122,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "remove_graph_asserts_pass", srcs = [ "remove_graph_asserts_pass.py", @@ -132,7 +132,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "sym_to_tensor_pass", srcs = [ "sym_to_tensor_pass.py", @@ -143,7 +143,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "quant_fusion_pass", srcs = [ "_quant_patterns_and_replacements.py", @@ -157,7 +157,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "quantize_io_pass", srcs = [ "quantize_io_pass.py", @@ -170,7 +170,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "memory_planning_pass", srcs = [ "memory_planning_pass.py", @@ -186,7 +186,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "remove_noop_pass", srcs = [ "remove_noop_pass.py", @@ -198,7 +198,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "prune_empty_tensor_pass", srcs = [ "prune_empty_tensors_pass.py", @@ -210,7 +210,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "remove_mixed_type_operators", srcs = [ "remove_mixed_type_operators.py", @@ -221,7 +221,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "spec_prop_pass", srcs = [ "spec_prop_pass.py", @@ -234,7 +234,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "init_mutable_pass", srcs = [ "init_mutable_pass.py", @@ -244,7 +244,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "sym_shape_eval_pass", srcs = [ "sym_shape_eval_pass.py", @@ -259,7 +259,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "replace_broken_ops_with_function_ops_pass", srcs = [ "replace_broken_ops_with_function_ops_pass.py", @@ -270,7 +270,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "replace_sym_size_op_pass", srcs = [ "replace_sym_size_op_pass.py", @@ -281,7 +281,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "replace_edge_with_backend_pass", srcs = [ "replace_edge_with_backend_pass.py", @@ -293,7 +293,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "normalize_transpose_pass", srcs = [ "normalize_transpose_pass.py", @@ -304,7 +304,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "replace_aten_with_edge_pass", srcs = [ "replace_aten_with_edge_pass.py", @@ -318,7 +318,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "debug_handle_generator_pass", srcs = [ "debug_handle_generator_pass.py", @@ -330,7 +330,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "prim_ops_py_registry", srcs = ["executorch_prim_ops_registry.py"], deps = [ @@ -339,7 +339,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "dim_order_ops_registry", srcs = ["dim_order_ops_registry.py"], deps = [ @@ -349,7 +349,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "memory_format_ops_pass", srcs = [ "memory_format_ops_pass.py", @@ -363,7 +363,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "normalize_view_copy_base_pass", srcs = [ "normalize_view_copy_base_pass.py", @@ -374,7 +374,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "replace_view_copy_with_view_pass", srcs = [ "replace_view_copy_with_view_pass.py", diff --git a/exir/program/TARGETS b/exir/program/TARGETS index aeddcb6ced9..33e417e7326 100644 --- a/exir/program/TARGETS +++ b/exir/program/TARGETS @@ -1,9 +1,9 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "__init__.py", @@ -14,7 +14,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "program", srcs = [ "_program.py", @@ -48,7 +48,7 @@ runtime.python_library( ] + (["//executorch/exir/program/fb:logger"] if not runtime.is_oss else []) ) -runtime.python_library( +python_library( name = "fake_program", srcs = [ "_fake_program.py", diff --git a/exir/serde/TARGETS b/exir/serde/TARGETS index 6183474180e..7bede435359 100644 --- a/exir/serde/TARGETS +++ b/exir/serde/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( # @autodeps-skip for some reason autodeps thinks this target # needs to depend on exir:lib which it doesn't. name = "serialize", diff --git a/exir/tests/TARGETS b/exir/tests/TARGETS index 80fdf2069f2..650a77c6ef6 100644 --- a/exir/tests/TARGETS +++ b/exir/tests/TARGETS @@ -1,10 +1,10 @@ load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +python_library( name = "lib", srcs = [ "common.py", @@ -15,7 +15,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "models", srcs = [ "models.py", @@ -27,7 +27,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "control_flow_models", srcs = [ "control_flow_models.py", @@ -37,7 +37,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "dynamic_shape_models", srcs = [ "dynamic_shape_models.py", @@ -47,7 +47,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "transformer", srcs = [ "transformer.py", @@ -57,7 +57,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "asr_joiner", srcs = [ "asr_joiner.py", @@ -403,7 +403,7 @@ python_unittest( ], ) -runtime.python_library( +python_library( name = "test_memory_format_ops_pass_utils", srcs = [ "test_memory_format_ops_pass_utils.py", diff --git a/exir/verification/TARGETS b/exir/verification/TARGETS index 8362d87a238..092b48658df 100644 --- a/exir/verification/TARGETS +++ b/exir/verification/TARGETS @@ -1,5 +1,5 @@ load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") @@ -17,7 +17,7 @@ cpp_python_extension( ], ) -runtime.python_library( +python_library( name = "interpreter", srcs = [ "interpreter.py", @@ -32,7 +32,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "devhtml", srcs = [ "dev_html.py", @@ -42,7 +42,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "verifier", srcs = [ "arg_validator.py", diff --git a/extension/llm/modules/TARGETS b/extension/llm/modules/TARGETS index 72cb146ef31..c0d2edf3818 100644 --- a/extension/llm/modules/TARGETS +++ b/extension/llm/modules/TARGETS @@ -1,8 +1,8 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") oncall("executorch") -runtime.python_library( +python_library( name = "kv_cache", srcs = [ "kv_cache.py", @@ -13,7 +13,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "attention", srcs = [ "attention.py", @@ -26,7 +26,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "position_embeddings", srcs = [ "_position_embeddings.py", @@ -36,7 +36,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "module_lib", srcs = [ "__init__.py", diff --git a/extension/pytree/TARGETS b/extension/pytree/TARGETS index 32eea9b3bdb..005c5c9c2d7 100644 --- a/extension/pytree/TARGETS +++ b/extension/pytree/TARGETS @@ -2,7 +2,7 @@ # targets.bzl. This file can contain fbcode-only targets. load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension") -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load(":targets.bzl", "define_common_targets") oncall("executorch") @@ -33,7 +33,7 @@ cpp_python_extension( ], ) -runtime.python_library( +python_library( name = "pylib", srcs = [ "__init__.py", diff --git a/extension/training/TARGETS b/extension/training/TARGETS index eeed302c339..d7a1a161370 100644 --- a/extension/training/TARGETS +++ b/extension/training/TARGETS @@ -1,14 +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("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load(":targets.bzl", "define_common_targets") oncall("executorch") define_common_targets() -runtime.python_library( +python_library( name = "lib", srcs = [ "__init__.py", diff --git a/test/end2end/TARGETS b/test/end2end/TARGETS index e8c23edc500..fdac0e4887a 100644 --- a/test/end2end/TARGETS +++ b/test/end2end/TARGETS @@ -1,11 +1,11 @@ # @noautodeps -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest") oncall("executorch") -runtime.python_library( +python_library( name = "exported_module", srcs = [ "exported_module.py", @@ -22,7 +22,7 @@ runtime.python_library( ], ) -runtime.python_library( +python_library( name = "register_scratch_meta_fns", srcs = [ "register_scratch_meta_fns.py",