Skip to content

Commit 8a6d857

Browse files
Wovchenawgzintelpeterchen-intelyatarkan
authoredMay 9, 2024
Merge releases/2024/1 into master (openvinotoolkit#427)
Co-authored-by: guozhong wang <guozhong.wang@intel.com> Co-authored-by: Chen Peter <peter.chen@intel.com> Co-authored-by: yatarkan <yaroslav.tarkan@intel.com>
1 parent 563e05d commit 8a6d857

24 files changed

+742
-253
lines changed
 

‎.github/dependabot.yml

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ updates:
88
directory: "image_generation/lcm_dreamshaper_v7/cpp/scripts/"
99
schedule:
1010
interval: "weekly"
11+
- package-ecosystem: "pip"
12+
directory: "text_generation/causal_lm/cpp/"
13+
schedule:
14+
interval: "weekly"

‎.github/workflows/bandit.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: python -m bandit --recursive --configfile bandit.yml .
2+
on:
3+
pull_request:
4+
paths-ignore:
5+
- 'thirdparty'
6+
- '**.md'
7+
jobs:
8+
bandit:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v4
13+
with:
14+
python-version: 3.11
15+
- run: python -m pip install bandit
16+
- run: python -m bandit --recursive --configfile bandit.yml .

‎.github/workflows/causal_lm_cpp.yml

+68-70
Large diffs are not rendered by default.
+85-53
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: lcm_dreamshaper
2+
23
on:
34
pull_request:
45
paths:
@@ -7,75 +8,106 @@ on:
78
- .github/workflows/lcm_dreamshaper_cpp.yml
89
- thirdparty/openvino_tokenizers
910
- "!**.md"
11+
12+
env:
13+
working_directory: "./image_generation/lcm_dreamshaper_v7/cpp/"
14+
1015
concurrency:
1116
group: ${{ github.workflow }}-${{ github.ref }}
1217
cancel-in-progress: true
18+
1319
jobs:
1420
lcm_dreamshaper_v7_cpp-linux:
1521
runs-on: ubuntu-20.04
22+
defaults:
23+
run:
24+
# Do not ignore bash profile files. From:
25+
# https://github.com/marketplace/actions/setup-miniconda#important
26+
shell: bash -l {0}
1627
steps:
1728
- uses: actions/checkout@v4
1829
with:
1930
submodules: recursive
20-
- uses: actions/setup-python@v4
31+
32+
- name: Setup conda
33+
uses: conda-incubator/setup-miniconda@v3
2134
with:
22-
python-version: 3.8
23-
- name: Initialize OpenVINO
35+
miniconda-version: "latest"
36+
activate-environment: openvino_lcm_cpp
37+
python-version: "3.10"
38+
39+
- name: Install OpenVINO and other conda dependencies
2440
run: |
25-
mkdir openvino
26-
curl https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.1.0-14645-e6dc0865128/l_openvino_toolkit_ubuntu20_2024.1.0.dev20240304_x86_64.tgz | tar --directory ./openvino/ --strip-components 1 -xz
27-
sudo ./openvino/install_dependencies/install_openvino_dependencies.sh
28-
- name: Download / convert a model / tokenizer
41+
conda activate openvino_lcm_cpp
42+
conda update -c conda-forge --all
43+
conda install -c conda-forge openvino=2024.1.0 c-compiler cxx-compiler git make cmake
44+
conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
45+
46+
- name: Install python dependencies
47+
working-directory: ${{ env.working_directory }}
2948
run: |
30-
source ./openvino/setupvars.sh
31-
cd ./image_generation/lcm_dreamshaper_v7/cpp/scripts/
32-
python -m pip install -U pip
33-
python -m pip install -r ./requirements.txt
34-
python -m pip install ../../../../thirdparty/openvino_tokenizers/
35-
python convert_model.py -lcm "SimianLuo/LCM_Dreamshaper_v7" -t "FP16"
49+
conda activate openvino_lcm_cpp
50+
python -m pip install -r requirements.txt
51+
python -m pip install ../../../thirdparty/openvino_tokenizers/[transformers]
52+
53+
- name: Download and convert model and tokenizer
54+
working-directory: ${{ env.working_directory }}
55+
run: |
56+
conda activate openvino_lcm_cpp
57+
optimum-cli export openvino --model SimianLuo/LCM_Dreamshaper_v7 --weight-format fp16 models/lcm_dreamshaper_v7/FP16
58+
3659
- name: Build app
60+
working-directory: ${{ env.working_directory }}
3761
run: |
38-
source ./openvino/setupvars.sh
39-
cd ./image_generation/lcm_dreamshaper_v7/cpp/
62+
conda activate openvino_lcm_cpp
4063
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
4164
cmake --build ./build/ --config Release --parallel
65+
4266
- name: Run app
43-
run: |
44-
source ./openvino/setupvars.sh
45-
cd ./image_generation/lcm_dreamshaper_v7/cpp/build/
46-
./lcm_dreamshaper
67+
working-directory: ${{ env.working_directory }}
68+
run: ./build/lcm_dreamshaper
69+
4770
lcm_dreamshaper_v7_cpp-windows:
48-
runs-on: windows-latest
49-
steps:
50-
- uses: actions/checkout@v4
51-
with:
52-
submodules: recursive
53-
- uses: actions/setup-python@v4
54-
with:
55-
python-version: 3.8
56-
- name: Initialize OpenVINO
57-
shell: cmd
58-
run: |
59-
curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.1.0-14645-e6dc0865128/w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64.zip
60-
unzip ov.zip
61-
- name: Download / convert a model / tokenizer
62-
shell: cmd
63-
run: |
64-
call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64/setupvars.bat
65-
cd ./image_generation/lcm_dreamshaper_v7/cpp/scripts/
66-
python -m pip install -r ./requirements.txt
67-
python -m pip install ../../../../thirdparty/openvino_tokenizers/
68-
python convert_model.py -lcm "SimianLuo/LCM_Dreamshaper_v7" -t "FP16"
69-
- name: Build app
70-
shell: cmd
71-
run: |
72-
call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64/setupvars.bat
73-
cd ./image_generation/lcm_dreamshaper_v7/cpp/
74-
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
75-
cmake --build ./build/ --config Release --parallel
76-
- name: Run app
77-
shell: cmd
78-
run: |
79-
call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64/setupvars.bat
80-
cd ./image_generation/lcm_dreamshaper_v7/cpp/build/
81-
call "./Release/lcm_dreamshaper.exe"
71+
runs-on: windows-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
with:
75+
submodules: recursive
76+
77+
- name: Setup conda
78+
uses: conda-incubator/setup-miniconda@v3
79+
with:
80+
miniconda-version: "latest"
81+
activate-environment: openvino_lcm_cpp
82+
python-version: "3.10"
83+
84+
- name: Install OpenVINO and other conda dependencies
85+
run: |
86+
conda activate openvino_lcm_cpp
87+
conda update -c conda-forge --all
88+
conda install -c conda-forge openvino=2024.1.0 c-compiler cxx-compiler git make cmake
89+
conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
90+
91+
- name: Install python dependencies
92+
working-directory: ${{ env.working_directory }}
93+
run: |
94+
conda activate openvino_lcm_cpp
95+
python -m pip install -r requirements.txt
96+
python -m pip install ../../../thirdparty/openvino_tokenizers/[transformers]
97+
98+
- name: Download and convert model and tokenizer
99+
working-directory: ${{ env.working_directory }}
100+
run: |
101+
conda activate openvino_lcm_cpp
102+
optimum-cli export openvino --model SimianLuo/LCM_Dreamshaper_v7 --weight-format fp16 models/lcm_dreamshaper_v7/FP16
103+
104+
- name: Build app
105+
working-directory: ${{ env.working_directory }}
106+
run: |
107+
conda activate openvino_lcm_cpp
108+
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
109+
cmake --build ./build/ --config Release --parallel
110+
111+
- name: Run app
112+
working-directory: ${{ env.working_directory }}
113+
run: '& "./build/Release/lcm_dreamshaper.exe" -r --dynamic'

‎.github/workflows/stable_diffusion_1_5_cpp.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install OpenVINO and other conda dependencies
4040
run: |
4141
conda activate openvino_sd_cpp
42-
conda install -c conda-forge openvino=2024.0.0 c-compiler cxx-compiler make cmake
42+
conda install -c conda-forge openvino=2024.1.0 c-compiler cxx-compiler git make cmake
4343
conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
4444
4545
- name: Install python dependencies
@@ -53,9 +53,7 @@ jobs:
5353
working-directory: ${{ env.working_directory }}
5454
run: |
5555
conda activate openvino_sd_cpp
56-
export MODEL_PATH="models/stable_diffusion_v1_5_ov/FP16"
57-
optimum-cli export openvino --model runwayml/stable-diffusion-v1-5 --task stable-diffusion --convert-tokenizer --weight-format fp16 $MODEL_PATH
58-
convert_tokenizer $MODEL_PATH/tokenizer/ --tokenizer-output-type i32 -o $MODEL_PATH/tokenizer/
56+
optimum-cli export openvino --model runwayml/stable-diffusion-v1-5 --task stable-diffusion --weight-format fp16 models/stable_diffusion_v1_5_ov/FP16
5957
6058
- name: Build app
6159
working-directory: ${{ env.working_directory }}
@@ -66,8 +64,7 @@ jobs:
6664
6765
- name: Run app
6866
working-directory: ${{ env.working_directory }}
69-
run: |
70-
./build/stable_diffusion -m ./models/stable_diffusion_v1_5_ov -t FP16
67+
run: ./build/stable_diffusion -m ./models/stable_diffusion_v1_5_ov -t FP16
7168

7269
stable_diffusion_1_5_cpp-windows:
7370
runs-on: windows-latest
@@ -86,7 +83,7 @@ jobs:
8683
- name: Install OpenVINO and other conda dependencies
8784
run: |
8885
conda activate openvino_sd_cpp
89-
conda install -c conda-forge openvino=2024.0.0 c-compiler cxx-compiler make cmake
86+
conda install -c conda-forge openvino=2024.1.0 c-compiler cxx-compiler git make cmake
9087
9188
- name: Install python dependencies
9289
working-directory: ${{ env.working_directory }}
@@ -99,9 +96,7 @@ jobs:
9996
working-directory: ${{ env.working_directory }}
10097
run: |
10198
conda activate openvino_sd_cpp
102-
$env:MODEL_PATH='models/stable_diffusion_v1_5_ov/FP16'
103-
optimum-cli export openvino --model runwayml/stable-diffusion-v1-5 --task stable-diffusion --convert-tokenizer --weight-format fp16 $env:MODEL_PATH
104-
convert_tokenizer $env:MODEL_PATH/tokenizer/ --tokenizer-output-type i32 -o $env:MODEL_PATH/tokenizer/
99+
optimum-cli export openvino --model runwayml/stable-diffusion-v1-5 --task stable-diffusion --weight-format fp16 models/stable_diffusion_v1_5_ov/FP16
105100
106101
- name: Build app
107102
working-directory: ${{ env.working_directory }}
@@ -112,5 +107,4 @@ jobs:
112107
113108
- name: Run app
114109
working-directory: ${{ env.working_directory }}
115-
run: |
116-
& "./build/Release/stable_diffusion.exe" -m ./models/stable_diffusion_v1_5_ov -t FP16 --dynamic
110+
run: '& "./build/Release/stable_diffusion.exe" -m ./models/stable_diffusion_v1_5_ov -t FP16 --dynamic'

0 commit comments

Comments
 (0)