Skip to content

Commit e4960df

Browse files
committed
[llm] Fix llama/README.md
This PR simplifies README.md's cmake command by using preset.
1 parent c6c3616 commit e4960df

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

examples/models/llama/README.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -269,33 +269,17 @@ You can export and run the original Llama 3 8B instruct model.
269269
270270
1. Build executorch with optimized CPU performance as follows. Build options available [here](https://github.com/pytorch/executorch/blob/main/CMakeLists.txt#L59).
271271
```
272-
cmake -DPYTHON_EXECUTABLE=python \
273-
-DCMAKE_INSTALL_PREFIX=cmake-out \
274-
-DEXECUTORCH_ENABLE_LOGGING=1 \
275-
-DCMAKE_BUILD_TYPE=Release \
276-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
277-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
278-
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
279-
-DEXECUTORCH_BUILD_XNNPACK=ON \
280-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
281-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
282-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
283-
-Bcmake-out .
272+
cmake --preset llm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out
284273
285274
cmake --build cmake-out -j16 --target install --config Release
286275
```
287276
Note for Mac users: There's a known linking issue with Xcode 15.1. Refer to the section of Common Issues and Mitigations below for solutions.
288277
289278
2. Build llama runner.
290279
```
291-
cmake -DPYTHON_EXECUTABLE=python \
292-
-DCMAKE_INSTALL_PREFIX=cmake-out \
280+
cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
281+
-DBUILD_TESTING=OFF \
293282
-DCMAKE_BUILD_TYPE=Release \
294-
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
295-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
296-
-DEXECUTORCH_BUILD_XNNPACK=ON \
297-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
298-
-DSUPPORT_REGEX_LOOKAHEAD=ON
299283
-Bcmake-out/examples/models/llama \
300284
examples/models/llama
301285

extension/llm/runner/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ target_include_directories(
4444
add_library(extension_llm_runner STATIC ${_extension_llm_runner__srcs})
4545

4646
# add tokenizers
47+
set(SUPPORT_REGEX_LOOKAHEAD ON)
48+
set(PCRE2_STATIC_PIC ON)
4749
add_subdirectory(
4850
${EXECUTORCH_ROOT}/extension/llm/tokenizers
4951
${CMAKE_CURRENT_BINARY_DIR}/../../../extension/llm/tokenizers

0 commit comments

Comments
 (0)