-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9324ea
commit 1a24acb
Showing
9 changed files
with
85 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
# Copyright (C) 2023-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if(TARGET openvino_tokenizers) | ||
set(OPENVINO_TOKENIZERS_PATH $<TARGET_FILE:openvino_tokenizers>) | ||
else() | ||
message(FATAL_ERROR "multinomial_causal_lm must be compiled as part of OpenVIINOGenAI to have the path to openvino_tokenizers hardcoded.") | ||
endif() | ||
find_package(OpenVINO REQUIRED COMPONENTS Runtime) | ||
find_package(OpenVINOGenAI REQUIRED PATHS | ||
"${CMAKE_BINARY_DIR}" # Reuse the package from the build. | ||
${OpenVINO_DIR} # GenAI may be installed alogside OpenVINO. | ||
) | ||
|
||
find_package(TBB REQUIRED COMPONENTS tbb) | ||
|
||
add_executable(prompt_lookup_decoding_lm prompt_lookup_decoding_lm.cpp) | ||
target_link_libraries(prompt_lookup_decoding_lm PRIVATE openvino::runtime TBB::tbb) | ||
set_target_properties(prompt_lookup_decoding_lm PROPERTIES | ||
COMPILE_PDB_NAME prompt_lookup_decoding_lm | ||
# Ensure out of box LC_RPATH on macOS with SIP | ||
INSTALL_RPATH_USE_LINK_PATH ON) | ||
target_compile_definitions(prompt_lookup_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}") | ||
target_compile_features(prompt_lookup_decoding_lm PRIVATE cxx_std_17) | ||
|
||
get_target_property(genai_imported openvino::genai IMPORTED_LOCATION) | ||
set(OPENVINO_TOKENIZERS_PATH $<IF:$<BOOL:${genai_imported}>,${genai_imported},$<TARGET_FILE_DIR:openvino::genai>>) | ||
set(OPENVINO_TOKENIZERS_FILENAME "${CMAKE_SHARED_LIBRARY_PREFIX}openvino_tokenizer${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
target_compile_definitions(prompt_lookup_decoding_lm PRIVATE | ||
OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}/${OPENVINO_TOKENIZERS_FILENAME}") | ||
|
||
install(TARGETS prompt_lookup_decoding_lm | ||
RUNTIME DESTINATION samples_bin/ | ||
COMPONENT samples_bin | ||
EXCLUDE_FROM_ALL) | ||
RUNTIME DESTINATION samples_bin/ | ||
COMPONENT samples_bin | ||
EXCLUDE_FROM_ALL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
# Copyright (C) 2023-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if(TARGET openvino_tokenizers) | ||
set(OPENVINO_TOKENIZERS_PATH $<TARGET_FILE:openvino_tokenizers>) | ||
else() | ||
message(FATAL_ERROR "multinomial_causal_lm must be compiled as part of OpenVIINOGenAI to have the path to openvino_tokenizers hardcoded.") | ||
endif() | ||
find_package(OpenVINO REQUIRED COMPONENTS Runtime) | ||
find_package(OpenVINOGenAI REQUIRED PATHS | ||
"${CMAKE_BINARY_DIR}" # Reuse the package from the build. | ||
${OpenVINO_DIR} # GenAI may be installed alogside OpenVINO. | ||
) | ||
|
||
find_package(TBB REQUIRED COMPONENTS tbb) | ||
|
||
add_executable(speculative_decoding_lm speculative_decoding_lm.cpp) | ||
target_link_libraries(speculative_decoding_lm PRIVATE openvino::runtime TBB::tbb) | ||
set_target_properties(speculative_decoding_lm PROPERTIES | ||
COMPILE_PDB_NAME speculative_decoding_lm | ||
# Ensure out of box LC_RPATH on macOS with SIP | ||
INSTALL_RPATH_USE_LINK_PATH ON) | ||
target_compile_definitions(speculative_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}") | ||
target_compile_features(speculative_decoding_lm PRIVATE cxx_std_17) | ||
|
||
get_target_property(genai_imported openvino::genai IMPORTED_LOCATION) | ||
set(OPENVINO_TOKENIZERS_PATH $<IF:$<BOOL:${genai_imported}>,${genai_imported},$<TARGET_FILE_DIR:openvino::genai>>) | ||
set(OPENVINO_TOKENIZERS_FILENAME "${CMAKE_SHARED_LIBRARY_PREFIX}openvino_tokenizer${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
target_compile_definitions(speculative_decoding_lm PRIVATE | ||
OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}/${OPENVINO_TOKENIZERS_FILENAME}") | ||
|
||
install(TARGETS speculative_decoding_lm | ||
RUNTIME DESTINATION samples_bin/ | ||
COMPONENT samples_bin | ||
EXCLUDE_FROM_ALL) | ||
RUNTIME DESTINATION samples_bin/ | ||
COMPONENT samples_bin | ||
EXCLUDE_FROM_ALL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters