Skip to content

Commit 9616854

Browse files
committed
Update test_llama.sh and test_llava.sh to use release mode as default
1 parent 3f1a005 commit 9616854

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

.ci/scripts/test_llama.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ BUILD_TOOL=$2 # buck2 or cmake
1414
DTYPE=$3 # fp16, bf16, or fp32
1515
MODE=${4:-"xnnpack+custom"} # portable or xnnpack+custom or xnnpack+custom+qe
1616
UPLOAD_DIR=${5:-}
17+
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
1718
if [[ $# -lt 4 ]]; then # Assuming 4 mandatory args
1819
echo "Expecting atleast 4 positional arguments"
1920
echo "Usage: [...]"
@@ -106,7 +107,7 @@ cmake_install_executorch_libraries() {
106107
rm -rf cmake-out
107108
retry cmake \
108109
-DCMAKE_INSTALL_PREFIX=cmake-out \
109-
-DCMAKE_BUILD_TYPE=Debug \
110+
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
110111
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
111112
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
112113
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
@@ -120,22 +121,22 @@ cmake_install_executorch_libraries() {
120121
-DQNN_SDK_ROOT="$QNN_SDK_ROOT" \
121122
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
122123
-Bcmake-out .
123-
cmake --build cmake-out -j9 --target install --config Debug
124+
cmake --build cmake-out -j9 --target install --config "$CMAKE_BUILD_TYPE"
124125
}
125126

126127
cmake_build_llama_runner() {
127128
echo "Building llama runner"
128129
dir="examples/models/llama"
129130
retry cmake \
130131
-DCMAKE_INSTALL_PREFIX=cmake-out \
131-
-DCMAKE_BUILD_TYPE=Debug \
132+
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
132133
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
133134
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
134135
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
135136
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
136137
-Bcmake-out/${dir} \
137138
${dir}
138-
cmake --build cmake-out/${dir} -j9 --config Debug
139+
cmake --build cmake-out/${dir} -j9 --config "$CMAKE_BUILD_TYPE"
139140

140141
}
141142

.ci/scripts/test_llava.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
set -exu
99
# shellcheck source=/dev/null
1010

11-
BUILD_TYPE=${1:-Debug}
1211
TARGET_OS=${2:-Native}
1312
BUILD_DIR=${3:-cmake-out}
13+
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
1414

15-
echo "Building with BUILD_TYPE: $BUILD_TYPE, TARGET_OS: $TARGET_OS, BUILD_DIR: $BUILD_DIR"
15+
echo "Building with CMAKE_BUILD_TYPE: $CMAKE_BUILD_TYPE, TARGET_OS: $TARGET_OS, BUILD_DIR: $BUILD_DIR"
1616

1717
if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
1818
PYTHON_EXECUTABLE=python3
@@ -32,7 +32,7 @@ if hash nproc &> /dev/null; then NPROC=$(nproc); fi
3232

3333
EXECUTORCH_COMMON_CMAKE_ARGS=" \
3434
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
35-
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
35+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
3636
-DEXECUTORCH_ENABLE_LOGGING=ON \
3737
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3838
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
@@ -49,7 +49,7 @@ cmake_install_executorch_libraries() {
4949
${EXECUTORCH_COMMON_CMAKE_ARGS} \
5050
-B${BUILD_DIR} .
5151

52-
cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${BUILD_TYPE}
52+
cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${CMAKE_BUILD_TYPE}
5353
}
5454

5555
cmake_install_executorch_libraries_for_android() {
@@ -59,14 +59,14 @@ cmake_install_executorch_libraries_for_android() {
5959
${EXECUTORCH_COMMON_CMAKE_ARGS} \
6060
-B${BUILD_DIR} .
6161

62-
cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${BUILD_TYPE}
62+
cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${CMAKE_BUILD_TYPE}
6363
}
6464

6565

6666
LLAVA_COMMON_CMAKE_ARGS=" \
6767
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
6868
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
69-
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
69+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
7070
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
7171
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
7272
-DEXECUTORCH_BUILD_XNNPACK=ON"
@@ -81,7 +81,7 @@ cmake_build_llava_runner() {
8181
-B${BUILD_DIR}/${dir} \
8282
${dir}
8383

84-
cmake --build ${BUILD_DIR}/${dir} -j${NPROC} --config ${BUILD_TYPE}
84+
cmake --build ${BUILD_DIR}/${dir} -j${NPROC} --config ${CMAKE_BUILD_TYPE}
8585
}
8686

8787

@@ -98,7 +98,7 @@ cmake_build_llava_runner_for_android() {
9898
-B${BUILD_DIR}/${dir} \
9999
${dir}
100100

101-
cmake --build ${BUILD_DIR}/${dir} -j${NPROC} --config ${BUILD_TYPE}
101+
cmake --build ${BUILD_DIR}/${dir} -j${NPROC} --config ${CMAKE_BUILD_TYPE}
102102
}
103103

104104
# only export the one without custom op for now since it's

.github/workflows/trunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ jobs:
290290
# ${CONDA_RUN} python -m unittest examples.models.llava.test.test_llava
291291

292292
# # run e2e (export, tokenizer and runner)
293-
# PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_llava.sh Release
293+
# PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_llava.sh
294294

295295
test-qnn-model:
296296
name: test-qnn-model

0 commit comments

Comments
 (0)