From 75bfda3066685ebdd16308e32b9d35f3a3b9962f Mon Sep 17 00:00:00 2001 From: Chen Lai Date: Tue, 1 Oct 2024 15:28:13 -0700 Subject: [PATCH] Remove preprocess xplat build Summary: Fix the error ``` BUILD FAILED Error running analysis for `fbsource//xplat/executorch/backends/qualcomm:preprocess (cfg:linux-x86_64-fbcode-platform010-clang15-no-san#5d1c5fc41fddc9ad)` Caused by: 0: Error in configured node dependency, dependency chain follows (-> indicates depends on, ^ indicates same configuration as previous): fbsource//xplat/executorch/backends/qualcomm:preprocess (cfg:linux-x86_64-fbcode-platform010-clang15-no-san#5d1c5fc41fddc9ad) -> fbsource//xplat/executorch/backends/qualcomm/passes:passes (^) 1: looking up unconfigured target node `fbsource//xplat/executorch/backends/qualcomm/passes:passes` 2: Error loading targets in package `fbsource//xplat/executorch/backends/qualcomm/passes` for target `fbsource//xplat/executorch/backends/qualcomm/passes:passes` 3: package `fbsource//xplat/executorch/backends/qualcomm/passes:` does not exist missing `BUCK` file (also missing alternatives `BUCK.v2`, `BUCK`) ``` In https://www.internalfb.com/sandcastle/workflow/941252322124876986/artifact/actionlog.941252322206237690.stdout.1?selectedLines=622-633-1-77 Differential Revision: D63587929 --- backends/qualcomm/TARGETS | 13 +++++++++++++ backends/qualcomm/passes/TARGETS | 17 +++++++++++++++-- backends/qualcomm/passes/targets.bzl | 22 ---------------------- backends/qualcomm/targets.bzl | 16 +--------------- 4 files changed, 29 insertions(+), 39 deletions(-) delete mode 100644 backends/qualcomm/passes/targets.bzl diff --git a/backends/qualcomm/TARGETS b/backends/qualcomm/TARGETS index 0a42614a385..6a720a62479 100644 --- a/backends/qualcomm/TARGETS +++ b/backends/qualcomm/TARGETS @@ -1,5 +1,18 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") oncall("executorch") define_common_targets() + +runtime.python_library( + name = "preprocess", + srcs = ["qnn_preprocess.py"], + visibility = [ + "//executorch/backends/qualcomm/...", + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//executorch/backends/qualcomm/passes:passes", + ], +) diff --git a/backends/qualcomm/passes/TARGETS b/backends/qualcomm/passes/TARGETS index 0a42614a385..a824ca9f6e5 100644 --- a/backends/qualcomm/passes/TARGETS +++ b/backends/qualcomm/passes/TARGETS @@ -1,5 +1,18 @@ -load(":targets.bzl", "define_common_targets") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -define_common_targets() +runtime.python_library( + name = "passes", + srcs = glob([ + "*.py", + ]), + visibility = [ + "@EXECUTORCH_CLIENTS", + ], + deps = [ + "//executorch/backends/transforms:addmm_mm_to_linear", + "//executorch/exir/backend:backend_details", + "//executorch/exir/backend:compile_spec_schema", + ], +) diff --git a/backends/qualcomm/passes/targets.bzl b/backends/qualcomm/passes/targets.bzl deleted file mode 100644 index d5bf8cf01ee..00000000000 --- a/backends/qualcomm/passes/targets.bzl +++ /dev/null @@ -1,22 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -def define_common_targets(): - """Defines targets that should be shared between fbcode and xplat. - The directory containing this targets.bzl file should also contain both - TARGETS and BUCK files that call this function. - """ - - runtime.python_library( - name = "passes", - srcs = glob([ - "*.py", - ]), - visibility = [ - "@EXECUTORCH_CLIENTS", - ], - deps = [ - "//executorch/exir/backend:backend_details", - "//executorch/exir/backend:compile_spec_schema", - "//executorch/backends/transforms:addmm_mm_to_linear", - ], - ) diff --git a/backends/qualcomm/targets.bzl b/backends/qualcomm/targets.bzl index 680e74681e7..1435d41f8db 100644 --- a/backends/qualcomm/targets.bzl +++ b/backends/qualcomm/targets.bzl @@ -2,10 +2,8 @@ load( "@fbsource//tools/build_defs:default_platform_defs.bzl", "ANDROID", ) -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - # Construct the input and output file names. All input and output files rely on scalar_type file. SCHEMA_NAME = "schema" @@ -56,6 +54,7 @@ def define_common_targets(): [OUTPUT_SCHEMA_HEADER], OUTPUT_SCHEMA_HEADER, ) + # Header-only library target with the generate executorch program schema header. runtime.cxx_library( name = "schema", @@ -77,7 +76,6 @@ def define_common_targets(): platforms = [ANDROID], ) - runtime.cxx_library( name = "qnn_executorch_backend", srcs = [], @@ -94,15 +92,3 @@ def define_common_targets(): ":schema", ], ) - - runtime.python_library( - name = "preprocess", - srcs = ["qnn_preprocess.py"], - deps = [ - "//executorch/backends/qualcomm/passes:passes", - ], - visibility = [ - "//executorch/backends/qualcomm/...", - "@EXECUTORCH_CLIENTS", - ], - )