|
149 | 149 |
|
150 | 150 | which "${PYTHON_EXECUTABLE}" |
151 | 151 |
|
152 | | -cmake_install_executorch_libraries() { |
153 | | - echo "Installing libexecutorch.a, libextension_module.so, libportable_ops_lib.a" |
| 152 | +cmake_build_llama() { |
| 153 | + echo "Building llama runner" |
| 154 | + pushd extension/llm/tokenizers |
| 155 | + echo "Updating tokenizers submodule" |
| 156 | + git submodule update --init |
| 157 | + popd |
154 | 158 | rm -rf cmake-out |
155 | 159 | retry cmake --preset llm \ |
156 | 160 | -DEXECUTORCH_BUILD_TESTS=ON \ |
157 | 161 | -DBUILD_TESTING=OFF \ |
158 | | - -DCMAKE_INSTALL_PREFIX=cmake-out \ |
159 | 162 | -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \ |
160 | 163 | -DEXECUTORCH_BUILD_QNN="$QNN" \ |
161 | 164 | -DEXECUTORCH_ENABLE_LOGGING=ON \ |
162 | 165 | -DQNN_SDK_ROOT="$QNN_SDK_ROOT" |
163 | | - cmake --build cmake-out -j9 --target install --config "$CMAKE_BUILD_TYPE" |
164 | | -} |
165 | | - |
166 | | -cmake_build_llama_runner() { |
167 | | - echo "Building llama runner" |
168 | | - pushd extension/llm/tokenizers |
169 | | - echo "Updating tokenizers submodule" |
170 | | - git submodule update --init |
171 | | - popd |
172 | | - dir="examples/models/llama" |
173 | | - if [[ "$CMAKE_BUILD_TYPE" == "Debug" ]]; then |
174 | | - PRESET="llama-debug" |
175 | | - else |
176 | | - PRESET="llama-release" |
177 | | - fi |
178 | | - pushd "${dir}" |
179 | | - cmake --workflow --preset "${PRESET}" |
180 | | - popd |
| 166 | + cmake --build cmake-out -j9 --target llama_main --config "$CMAKE_BUILD_TYPE" |
181 | 167 | } |
182 | 168 |
|
183 | 169 | cleanup_files() { |
@@ -269,8 +255,7 @@ if [[ "${BUILD_TOOL}" == "buck2" ]]; then |
269 | 255 | # shellcheck source=/dev/null |
270 | 256 | $BUCK run examples/models/llama:main -- ${RUNTIME_ARGS} > result.txt |
271 | 257 | elif [[ "${BUILD_TOOL}" == "cmake" ]]; then |
272 | | - cmake_install_executorch_libraries |
273 | | - cmake_build_llama_runner |
| 258 | + cmake_build_llama |
274 | 259 | # Run llama runner |
275 | 260 | NOW=$(date +"%H:%M:%S") |
276 | 261 | echo "Starting to run llama runner at ${NOW}" |
|
0 commit comments