Skip to content

Commit c01d384

Browse files
committed
Fixed import target
1 parent 6e83abf commit c01d384

5 files changed

Lines changed: 9 additions & 3 deletions

File tree

.ci/scripts/build-qnn-sdk.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ set_up_aot() {
4040
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
4141
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
4242
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
43+
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
44+
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON \
4345
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
4446
-DPYTHON_EXECUTABLE=python3
4547
cmake --build $PWD --target "PyQnnManagerAdaptor" -j$(nproc)

backends/qualcomm/aot/python/targets.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def define_common_targets():
2626
"-DEXECUTORCH_PYTHON_MODULE_NAME={}".format(PYTHON_MODULE_NAME),
2727
],
2828
deps = [
29+
"//executorch/kernels/quantized:aot_lib",
30+
"//executorch/kernels/quantized:quantized_ops_lib",
2931
"//executorch/runtime/core:core",
3032
"//executorch/backends/qualcomm/aot/python:python_lib",
3133
"//executorch/backends/qualcomm/aot/wrappers:wrappers",

backends/qualcomm/quantizer/quantizer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010

1111
# To support quantize op lowering in AOT
1212
try:
13-
import executorch.extension.pybindings.portable_lib # noqa[F401]
1413
import executorch.kernels.quantized # noqa[F401]
1514
except:
1615
import logging
1716

1817
logging.info(
19-
"Failed to load portable_lib and quantized_aot_lib. To run on LPAI backend, please build ExecuTorch with portable_lib"
18+
"Failed to load quantized_aot_lib. To run on LPAI backend, please make sure that quantized_aot_lib is accessible."
2019
)
2120
del logging
2221
import torch

backends/qualcomm/quantizer/targets.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def define_common_targets():
1515
visibility = ["PUBLIC"],
1616
deps = [
1717
"//executorch/backends/transforms:decompose_sdpa",
18-
"//executorch/extension/pybindings:portable_lib",
18+
"//executorch/kernels/quantized:aot_lib",
1919
"//executorch/kernels/quantized:quantized_ops_lib",
20+
2021
],
2122
)

backends/qualcomm/scripts/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ if [ "$BUILD_X86_64" = true ]; then
364364
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
365365
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
366366
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
367+
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON \
367368
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
368369
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
369370
-DEXECUTORCH_ENABLE_LOGGING=ON \
@@ -375,6 +376,7 @@ if [ "$BUILD_X86_64" = true ]; then
375376

376377
rm -f $PRJ_ROOT/backends/qualcomm/python/*
377378
cp -fv $BUILD_ROOT/backends/qualcomm/Py* "$PRJ_ROOT/backends/qualcomm/python"
379+
cp -fv $BUILD_ROOT/kernels/quantized/libquantized_ops_aot_lib.so "$PRJ_ROOT/kernels/quantized"
378380
cp -fv "$PRJ_ROOT/schema/program.fbs" "$PRJ_ROOT/exir/_serialize/program.fbs"
379381
cp -fv "$PRJ_ROOT/schema/scalar_type.fbs" "$PRJ_ROOT/exir/_serialize/scalar_type.fbs"
380382

0 commit comments

Comments
 (0)