Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive #59

Draft
wants to merge 25 commits into
base: generate_pipeline
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove leftovers
Wovchena committed May 16, 2024
commit ebb027e077a06c94e18c2dd08157f1fa722dac04
43 changes: 15 additions & 28 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")

set(TARGET_NAME genai)
add_library(${TARGET_NAME} SHARED ${SOURCE_FILES})
add_library(openvino::genai ALIAS genai)
add_library(openvino::${TARGET_NAME} ALIAS ${TARGET_NAME})

target_include_directories(${TARGET_NAME}
# TODO: remove it, because beam_search algo should not be exposed to end users
@@ -59,26 +59,15 @@ target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_TOKENIZERS_PATH=\"$<T

target_compile_features(${TARGET_NAME} PUBLIC cxx_std_17)

install(TARGETS ${TARGET_NAME} LIBRARY DESTINATION . COMPONENT core_genai RUNTIME DESTINATION . COMPONENT core_genai)

# Populate python with the libraries to allow skipping wheel installation
add_custom_command(TARGET genai POST_BUILD
# Copy the library to python to allow skipping wheel installation
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:genai>"
"${CMAKE_CURRENT_SOURCE_DIR}/../python/openvino_genai/$<TARGET_FILE_NAME:genai>"
COMMENT "Copy genai to src/python/openvino_genai")
"$<TARGET_FILE:${TARGET_NAME}>"
"${CMAKE_CURRENT_SOURCE_DIR}/../python/openvino_genai/$<TARGET_FILE_NAME:${TARGET_NAME}>"
COMMENT "Copy ${TARGET_NAME} to src/python/openvino_genai")

export(TARGETS genai NAMESPACE openvino:: FILE "${CMAKE_BINARY_DIR}/openvino_genaiConfig.cmake") # TODO: try to merge
install(TARGETS ${TARGET_NAME} LIBRARY DESTINATION . COMPONENT core_genai RUNTIME DESTINATION . COMPONENT core_genai)

include(GenerateExportHeader)

generate_export_header(genai)
# set_property(TARGET genai PROPERTY VERSION ${openvino_genai_VERSION})
# set_property(TARGET genai PROPERTY SOVERSION 3)
# set_property(TARGET genai PROPERTY INTERFACE_genai_MAJOR_VERSION 3)
# set_property(TARGET genai APPEND PROPERTY COMPATIBLE_INTERFACE_STRING genai_MAJOR_VERSION)

string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_FOLDER)
if(X86_64)
set(ARCH_FOLDER intel64)
@@ -90,23 +79,21 @@ elseif((MSVC OR APPLE) AND AARCH64)
set(ARCH_FOLDER arm64)
elseif(UNIVERSAL2)
set(ARCH_FOLDER universal2)
elseif(ARCH_FOLDER STREQUAL "x86_64" OR ARCH_FOLDER STREQUAL "amd64" # Windows detects Intel's 64-bit CPU as AMD64
elseif(ARCH_FOLDER STREQUAL "x86_64" OR ARCH_FOLDER STREQUAL "amd64" # Windows detects Intel's 64-bit CPU as AMD64
OR CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(ARCH_FOLDER intel64)
endif()
install(TARGETS genai EXPORT openvino_genaiTargets
install(TARGETS ${TARGET_NAME} EXPORT openvino_genaiTargets
LIBRARY DESTINATION runtime/lib/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} COMPONENT core_genai_dev
ARCHIVE DESTINATION runtime/lib/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} COMPONENT core_genai_dev
RUNTIME DESTINATION runtime/bin/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} COMPONENT core_genai_dev
INCLUDES DESTINATION runtime/include)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION runtime/include COMPONENT core_genai_dev)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION runtime/include COMPONENT core_genai_dev)
install(EXPORT openvino_genaiTargets FILE openvino_genaiTargets.cmake NAMESPACE openvino:: DESTINATION runtime/cmake)
include(CMakePackageConfigHelpers)
write_basic_package_version_file("${CMAKE_BINARY_DIR}/openvino_genaiConfigVersion.cmake" VERSION ${openvino_genai_VERSION} COMPATIBILITY AnyNewerVersion)

configure_package_config_file(openvino_genaiConfig.cmake.in "${CMAKE_BINARY_DIR}/openvino_genaiConfig.cmake" INSTALL_DESTINATION runtime/cmake)
install(FILES "${CMAKE_BINARY_DIR}/openvino_genaiConfig.cmake" "${CMAKE_BINARY_DIR}/openvino_genaiConfigVersion.cmake" DESTINATION runtime/cmake COMPONENT core_genai_dev)
include(CMakePackageConfigHelpers)
write_basic_package_version_file("${CMAKE_BINARY_DIR}/openvino_genaiConfigVersion.cmake" VERSION ${CMAKE_PROJECT_VERSION} COMPATIBILITY AnyNewerVersion)
export(EXPORT openvino_genaiTargets FILE "${CMAKE_BINARY_DIR}/openvino_genaiTargets.cmake" NAMESPACE openvino::)
configure_file(cmake/openvino_genaiConfig.cmake "${CMAKE_BINARY_DIR}/openvino_genaiConfig.cmake" COPYONLY)

install(EXPORT openvino_genaiTargets FILE openvino_genaiTargets.cmake NAMESPACE openvino:: DESTINATION runtime/cmake)
install(FILES cmake/openvino_genaiConfig.cmake "${CMAKE_BINARY_DIR}/openvino_genaiConfigVersion.cmake"
DESTINATION runtime/cmake COMPONENT core_genai_dev)
# export(TARGETS ${TARGET_NAME} NAMESPACE openvino:: FILE "${CMAKE_BINARY_DIR}/openvino_genaiConfig.cmake") TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(OpenVINO COMPONENTS Runtime)

if(NOT TARGET genai)
include("${CMAKE_CURRENT_LIST_DIR}/openvino_genaiTargets.cmake")
endif()

check_required_components(openvino_genai)
2 changes: 1 addition & 1 deletion src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ if(rpaths)
set_target_properties(py_generate_pipeline PROPERTIES INSTALL_RPATH "${rpaths}")
endif()

# Populate python with the libraries to allow skipping wheel installation
# Copy the library to python to allow skipping wheel installation
add_custom_command(TARGET py_generate_pipeline POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:py_generate_pipeline>"
8 changes: 3 additions & 5 deletions text_generation/causal_lm/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -10,11 +10,9 @@ else()
set(OPENVINO_TOKENIZERS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../bin/openvino_tokenizers.dll) # TODO: I'll go away after the generate() gets a way to find openvino_tokenizers
endif()

if(openvino_genai_SOURCE_DIR)
set(openvino_genai_DIR "${CMAKE_BINARY_DIR}")
endif()

find_package(openvino_genai REQUIRED)
find_package(openvino_genai REQUIRED
PATHS "${CMAKE_BINARY_DIR}" # Reuse the package from the build. The lowest priority.
)

add_executable(greedy_causal_lm greedy_causal_lm.cpp)
target_compile_definitions(greedy_causal_lm PRIVATE OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}")