Skip to content

Commit bc3e4ab

Browse files
committed
Update test_llama.sh and test_llava.sh to use release mode as default
1 parent 10d1dc9 commit bc3e4ab

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

.ci/scripts/test_llama.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ MODE=${MODE:-"xnnpack+custom"}
4848
# Default UPLOAD_DIR to empty string if not set
4949
UPLOAD_DIR="${UPLOAD_DIR:-}"
5050

51+
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
5152
if [[ $# -lt 4 ]]; then # Assuming 4 mandatory args
5253
echo "Expecting atleast 4 positional arguments"
5354
echo "Usage: [...]"
@@ -140,7 +141,7 @@ cmake_install_executorch_libraries() {
140141
rm -rf cmake-out
141142
retry cmake \
142143
-DCMAKE_INSTALL_PREFIX=cmake-out \
143-
-DCMAKE_BUILD_TYPE=Debug \
144+
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
144145
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
145146
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
146147
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
@@ -154,22 +155,22 @@ cmake_install_executorch_libraries() {
154155
-DQNN_SDK_ROOT="$QNN_SDK_ROOT" \
155156
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
156157
-Bcmake-out .
157-
cmake --build cmake-out -j9 --target install --config Debug
158+
cmake --build cmake-out -j9 --target install --config "$CMAKE_BUILD_TYPE"
158159
}
159160

160161
cmake_build_llama_runner() {
161162
echo "Building llama runner"
162163
dir="examples/models/llama"
163164
retry cmake \
164165
-DCMAKE_INSTALL_PREFIX=cmake-out \
165-
-DCMAKE_BUILD_TYPE=Debug \
166+
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
166167
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
167168
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
168169
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
169170
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
170171
-Bcmake-out/${dir} \
171172
${dir}
172-
cmake --build cmake-out/${dir} -j9 --config Debug
173+
cmake --build cmake-out/${dir} -j9 --config "$CMAKE_BUILD_TYPE"
173174

174175
}
175176

.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
Submodule XNNPACK updated 237 files

0 commit comments

Comments
 (0)