forked from openvinotoolkit/openvino.genai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Prompt lookup] (openvinotoolkit#1245)
*Description:* * Implementation of Prompt lookup decoding based on continuous batching pipeline (cb_promp_lookup_impl + prompt_lookup_impl) * Update `prompt_lookup_sample` to use new API * Update statistic to make of printing more usable *Ticket:* * https://jira.devtools.intel.com/browse/CVS-137987 *Example of usage:* * **Input:** `return 0;` * **Result Prompt lookup:** ``` =============================== Total duration, ms: 3.02267 Draft model duration, ms: 0.000724718 Main model duration, ms: 3.02195 Draft model duration, %: 0.0239761 Main model duration, %: 99.976 AVG acceptance rate, %: 10.8333 =============================== Request_id: 0 ||| 0 0 0 0 0 0 0 0 20 20 0 0 0 0 20 100 80 0 0 0 0 0 0 60 0 0 20 0 0 0 0 0 20 0 0 50 ``` * **Result Greedy:** ``` =============================== Total duration, ms: 3.18111 Draft model duration, ms: 1.538e-06 Main model duration, ms: 3.18111 Draft model duration, %: 4.83479e-05 Main model duration, %: 100 AVG acceptance rate, %: -nan =============================== ``` * **Speedup**: 100 Generated tokens: 5.24% && 300 Generated tokens: 81% (9.42 vs 5.19) --------- Co-authored-by: Ilya Lavrenov <[email protected]>
- Loading branch information
1 parent
7d2a303
commit 9bcadf7
Showing
27 changed files
with
606 additions
and
406 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
# Copyright (C) 2023-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
find_package(OpenVINO REQUIRED COMPONENTS Runtime Threading) | ||
|
||
find_package(OpenVINOGenAI REQUIRED | ||
PATHS | ||
"${CMAKE_BINARY_DIR}" # Reuse the package from the build. | ||
${OpenVINO_DIR} # GenAI may be installed alogside OpenVINO. | ||
NO_CMAKE_FIND_ROOT_PATH | ||
) | ||
|
||
add_executable(prompt_lookup_decoding_lm prompt_lookup_decoding_lm.cpp) | ||
target_link_libraries(prompt_lookup_decoding_lm PRIVATE openvino::runtime openvino::threading) | ||
set_target_properties(prompt_lookup_decoding_lm PROPERTIES | ||
COMPILE_PDB_NAME prompt_lookup_decoding_lm | ||
set(TARGET_NAME prompt_lookup_decoding_lm) | ||
add_executable(${TARGET_NAME} ${TARGET_NAME}.cpp) | ||
target_link_libraries(${TARGET_NAME} PRIVATE openvino::genai) | ||
|
||
set_target_properties(${TARGET_NAME} PROPERTIES | ||
COMPILE_PDB_NAME ${TARGET_NAME} | ||
# Ensure out of box LC_RPATH on macOS with SIP | ||
INSTALL_RPATH_USE_LINK_PATH ON) | ||
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_tokenizers${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 | ||
install(TARGETS ${TARGET_NAME} | ||
RUNTIME DESTINATION samples_bin/ | ||
COMPONENT samples_bin | ||
EXCLUDE_FROM_ALL) |
Oops, something went wrong.