Skip to content

Commit 879e424

Browse files
pytorchbotlucylqmetascroy
authored
Update llama cmake for custom ops (#10201)
Fix #10166 target_link_options_shared_lib has different behavior for macos and other platforms; seems like whole-archive was causing issues. Test Plan `sh .ci/scripts/test_llama_torchao_lowbit.sh` https://github.com/pytorch/executorch/blob/main/examples/models/llama/README.md#running-with-low-bit-kernels Co-authored-by: lucylq <[email protected]> Co-authored-by: Scott Roy <[email protected]>
1 parent b700d30 commit 879e424

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/models/llama/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ target_link_options_shared_lib(quantized_ops_lib)
111111
list(APPEND link_libraries quantized_kernels quantized_ops_lib)
112112

113113
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
114-
list(APPEND link_libraries $<LINK_LIBRARY:WHOLE_ARCHIVE,custom_ops>)
114+
target_link_options_shared_lib(custom_ops)
115+
list(APPEND link_libraries custom_ops)
115116
endif()
116117

117118
if(EXECUTORCH_BUILD_TORCHAO)

examples/models/llama/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ cmake -DPYTHON_EXECUTABLE=python \
431431
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
432432
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
433433
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
434-
-DEXECUTORCH_BUILD_XNNPACK=ON \
434+
-DEXECUTORCH_BUILD_XNNPACK=OFF \
435435
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
436436
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
437437
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \

0 commit comments

Comments
 (0)