Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADRENO] Minor changes for Adreno docs and help scripts #15830

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/how_to/deploy/adreno.rst
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ as the OpenCL path is fallback option for any operator didn't go through OpenCLM

python3 -m tvm.driver.tvmc compile \
--cross-compiler ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang \
--target="opencl, clml, llvm" --target-llvm-mtriple aarch64-linux-gnu --target-opencl-device adreno \
--target="opencl, clml, llvm" --desired-layout NCHW --target-llvm-mtriple aarch64-linux-gnu --target-opencl-device adreno \
--tuning-records keras-resnet50.log -o keras-resnet50.tar resnet50.h5

On successful compilation, above command produce ``keras-resnet50.tar``.
Expand Down
18 changes: 13 additions & 5 deletions tests/scripts/setup-adreno-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
ENVIRONMENT=""
RPC_PORT=""
ADB_SERIAL=""
LISTEN_PORT=5000

function usage() {
echo "Helper script to setup the environment for Tracker, RPC Device and for application"
echo "Usage (Help) : source setup-adreno-env.sh -h"
echo "Usage (Tracker): source setup-adreno-env.sh -e tracker -p <RPC PORT>"
echo "Usage (Device): source setup-adreno-env.sh -e device -p <RPC PORT> -d <Android Serial>"
echo "Usage (Device): source setup-adreno-env.sh -e device -p <RPC PORT> -d <Android Serial> [-l <device listen port>]"
echo "Usage (Query): source setup-adreno-env.sh -e query -p <RPC PORT>"
}

Expand All @@ -46,6 +47,11 @@ while [[ $# -gt 0 ]]; do
shift # past argument
shift # past value
;;
-l|--listen-port)
LISTEN_PORT="$2"
shift # past argument
shift # past value
;;
-h|--help)
usage
return 0
Expand All @@ -62,6 +68,7 @@ done
echo "ENVIRONMENT = ${ENVIRONMENT}"
echo "RPC_PORT = ${RPC_PORT}"
echo "ADB_SERIAL = ${ADB_SERIAL}"
echo "DEVICE LISTEN POPRT = ${LISTEN_PORT}"


function def_environment() {
Expand Down Expand Up @@ -100,10 +107,11 @@ case ${ENVIRONMENT} in
fi

adb reverse tcp:${TVM_TRACKER_PORT} tcp:${TVM_TRACKER_PORT}
adb forward tcp:5000 tcp:5000
adb forward tcp:5001 tcp:5001
adb forward tcp:5002 tcp:5002
adb shell "cd ${TARGET_FOLDER}; killall -9 tvm_rpc-${USER}; sleep 2; LD_LIBRARY_PATH=${TARGET_FOLDER}/ ./tvm_rpc-${USER} server --host=0.0.0.0 --port=5000 --port-end=5010 --tracker=127.0.0.1:${TVM_TRACKER_PORT} --key=${RPC_DEVICE_KEY}"
adb forward tcp:${LISTEN_PORT} tcp:${LISTEN_PORT}
adb forward tcp:$((LISTEN_PORT + 1)) tcp:$((LISTEN_PORT + 1))
adb forward tcp:$((LISTEN_PORT + 2)) tcp:$((LISTEN_PORT + 2))
adb forward tcp:$((LISTEN_PORT + 3)) tcp:$((LISTEN_PORT + 3))
adb shell "cd ${TARGET_FOLDER}; killall -9 tvm_rpc-${USER}; sleep 2; LD_LIBRARY_PATH=${TARGET_FOLDER}/ ./tvm_rpc-${USER} server --host=0.0.0.0 --port=${LISTEN_PORT} --port-end=$((LISTEN_PORT + 10)) --tracker=127.0.0.1:${TVM_TRACKER_PORT} --key=${RPC_DEVICE_KEY}"
;;

"query")
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/task_config_build_adreno.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ cp ../cmake/config.cmake .

if [ -f "${ADRENO_OPENCL}/CL/cl_qcom_ml_ops.h" ] ; then
echo set\(USE_CLML ${ADRENO_OPENCL}\) >> config.cmake
else
echo set\(USE_OPENCL ON\) >> config.cmake
fi
echo set\(USE_RPC ON\) >> config.cmake
echo set\(USE_GRAPH_EXECUTOR ON\) >> config.cmake
Expand Down