Skip to content

Commit

Permalink
Use latest OpenVINO (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Sep 3, 2024
1 parent fd9287c commit f2545c2
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 89 deletions.
74 changes: 39 additions & 35 deletions .github/workflows/causal_lm_cpp.yml

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions .github/workflows/lcm_dreamshaper_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b
env:
WORKING_DIRECTORY: "./image_generation/lcm_dreamshaper_v7/cpp/"
PYTHON_VERSION: '3.8'
LINUX_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16527-382ac845923/l_openvino_toolkit_ubuntu20_2024.4.0.dev20240828_x86_64.tgz
WINDOWS_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16527-382ac845923/w_openvino_toolkit_windows_2024.4.0.dev20240828_x86_64.zip
LINUX_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.5.0-16570-19eb02fe60b/l_openvino_toolkit_ubuntu20_2024.5.0.dev20240830_x86_64.tgz
WINDOWS_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.5.0-16570-19eb02fe60b/w_openvino_toolkit_windows_2024.5.0.dev20240830_x86_64.zip
OV_INSTALL_DIR: ${{ github.workspace }}/ov

concurrency:
Expand All @@ -41,36 +41,36 @@ jobs:
mkdir ${{ env.OV_INSTALL_DIR }}
tar -xzf openvino_package.tar.gz -C ${{ env.OV_INSTALL_DIR }} --strip-components=1
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Create virtual environment
working-directory: ${{ env.WORKING_DIRECTORY }}
run: python3 -m venv openvino_lcm_cpp

- name: Install python dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
source openvino_lcm_cpp/bin/activate
python -m pip install ../../../thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
python -m pip install -r ../../requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
- name: Download and convert model and tokenizer
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
source openvino_lcm_cpp/bin/activate
optimum-cli export openvino --model SimianLuo/LCM_Dreamshaper_v7 models/lcm_dreamshaper_v7/FP16
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
- name: Run app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
Expand All @@ -96,16 +96,23 @@ jobs:
mv ./tmp/*/* .
popd
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1"
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Create virtual environment
working-directory: ${{ env.WORKING_DIRECTORY }}
run: python -m venv openvino_lcm_cpp

- name: Install python dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
Expand All @@ -118,14 +125,7 @@ jobs:
run: |
. "./openvino_lcm_cpp/Scripts/Activate.ps1"
optimum-cli export openvino --model SimianLuo/LCM_Dreamshaper_v7 models/lcm_dreamshaper_v7/FP16
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1"
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
- name: Run app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/stable_diffusion_1_5_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b
env:
WORKING_DIRECTORY: "./image_generation/stable_diffusion_1_5/cpp/"
PYTHON_VERSION: '3.8'
LINUX_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16527-382ac845923/l_openvino_toolkit_ubuntu20_2024.4.0.dev20240828_x86_64.tgz
WINDOWS_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16527-382ac845923/w_openvino_toolkit_windows_2024.4.0.dev20240828_x86_64.zip
LINUX_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.5.0-16570-19eb02fe60b/l_openvino_toolkit_ubuntu20_2024.5.0.dev20240830_x86_64.tgz
WINDOWS_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.5.0-16570-19eb02fe60b/w_openvino_toolkit_windows_2024.5.0.dev20240830_x86_64.zip
OV_INSTALL_DIR: ${{ github.workspace }}/ov

concurrency:
Expand All @@ -41,12 +41,19 @@ jobs:
mkdir ${{ env.OV_INSTALL_DIR }}
tar -xzf openvino_package.tar.gz -C ${{ env.OV_INSTALL_DIR }} --strip-components=1
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Create virtual environment
working-directory: ${{ env.WORKING_DIRECTORY }}
run: python3 -m venv openvino_sd_cpp
Expand All @@ -62,14 +69,7 @@ jobs:
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
source openvino_sd_cpp/bin/activate
optimum-cli export openvino --model runwayml/stable-diffusion-v1-5 --task stable-diffusion models/stable_diffusion_v1_5_ov/FP16
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
optimum-cli export openvino --model dreamlike-art/dreamlike-anime-1.0 --task stable-diffusion models/stable_diffusion_v1_5_ov/FP16
- name: Run app
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand All @@ -95,37 +95,37 @@ jobs:
Expand-Archive openvino_package.zip -DestinationPath ./tmp
mv ./tmp/*/* .
popd
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1"
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Create virtual environment
working-directory: ${{ env.WORKING_DIRECTORY }}
run: python -m venv openvino_sd_cpp

- name: Install python dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
. "./openvino_sd_cpp/Scripts/Activate.ps1"
python -m pip install ../../../thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
python -m pip install -r ../../requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
- name: Download and convert model and tokenizer
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
. "./openvino_sd_cpp/Scripts/Activate.ps1"
optimum-cli export openvino --model runwayml/stable-diffusion-v1-5 --task stable-diffusion models/stable_diffusion_v1_5_ov/FP16
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1"
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --parallel
optimum-cli export openvino --model dreamlike-art/dreamlike-anime-1.0 --task stable-diffusion models/stable_diffusion_v1_5_ov/FP16
- name: Run app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ if(POLICY CMP0169)
endif()

project(OpenVINOGenAI
VERSION 2024.4.0.0
VERSION 2024.5.0.0
DESCRIPTION "OpenVINO GenAI"
HOMEPAGE_URL "https://github.com/openvinotoolkit/openvino.genai"
LANGUAGES CXX)

# Find OpenVINODeveloperPackage first to compile with SDL flags
find_package(OpenVINODeveloperPackage ${OpenVINOGenAI_VERSION} QUIET
COMPONENTS Runtime Threading
COMPONENTS Runtime
PATHS "${OpenVINO_DIR}")
if(NOT OpenVINODeveloperPackage_FOUND)
find_package(OpenVINO ${OpenVINOGenAI_VERSION} REQUIRED
COMPONENTS Runtime Threading)
COMPONENTS Runtime)
endif()

include(cmake/features.cmake)
Expand Down
2 changes: 1 addition & 1 deletion image_generation/lcm_dreamshaper_v7/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type")

# dependencies

find_package(OpenVINO REQUIRED COMPONENTS Runtime Threading)
find_package(OpenVINO REQUIRED COMPONENTS Runtime)

include(FetchContent)

Expand Down
2 changes: 1 addition & 1 deletion image_generation/stable_diffusion_1_5/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build type")

# dependencies

find_package(OpenVINO REQUIRED COMPONENTS Runtime Threading)
find_package(OpenVINO REQUIRED COMPONENTS Runtime)

include(FetchContent)

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openvino_genai"
version = "2024.4.0.0"
version = "2024.5.0.0"
description = "Python bindings for https://github.com/openvinotoolkit/openvino.genai"
requires-python = ">=3.8"
readme = {file = "src/README.md", content-type="text/markdown"}
Expand All @@ -16,7 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
"openvino_tokenizers~=2024.4.0.0.dev"
"openvino_tokenizers~=2024.5.0.0.dev"
]

[tool.py-build-cmake.module]
Expand Down

0 comments on commit f2545c2

Please sign in to comment.