Skip to content

Commit c77f7c9

Browse files
GHA: use OpenVINO provider for SD (openvinotoolkit#1386)
1 parent 669588d commit c77f7c9

File tree

2 files changed

+80
-43
lines changed

2 files changed

+80
-43
lines changed

.github/workflows/llm_bench-python.yml

-20
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
ov_artifact_name: ${{ steps.openvino_download.outputs.ov_artifact_name }}
2828
ov_wheel_source: ${{ steps.openvino_download.outputs.ov_wheel_source }}
2929
ov_version: ${{ steps.openvino_download.outputs.ov_version }}
30-
docker_tag: ${{ steps.get_docker_tag.outputs.docker_tag }}
3130
timeout-minutes: 10
3231
defaults:
3332
run:
@@ -47,21 +46,6 @@ jobs:
4746
commit_packages_to_provide: wheels
4847
revision: 747d0e7e105c9f2c9966a37861f95b1c7f886868
4948

50-
- name: Clone docker tag from OpenVINO repo
51-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52-
with:
53-
repository: 'openvinotoolkit/openvino'
54-
path: 'openvino'
55-
ref: ${{ env.OV_BRANCH }}
56-
sparse-checkout: |
57-
.github/dockerfiles/docker_tag
58-
59-
- name: Save docker tag to output
60-
id: get_docker_tag
61-
run: |
62-
docker_tag=$(cat openvino/.github/dockerfiles/docker_tag)
63-
echo "docker_tag=$docker_tag" >> $GITHUB_OUTPUT
64-
6549
build:
6650
defaults:
6751
run:
@@ -100,8 +84,6 @@ jobs:
10084
python -m pip install ${{ env.SRC_DIR }} -v ${{ needs.openvino_download.outputs.ov_wheel_source }}
10185
GIT_CLONE_PROTECTION_ACTIVE=false pip install -r ${{ env.LLM_BENCH_PYPATH }}/requirements.txt ${{ needs.openvino_download.outputs.ov_wheel_source }}
10286
working-directory: ${{ env.OV_INSTALL_DIR }}
103-
env:
104-
CMAKE_BUILD_PARALLEL_LEVEL: 4
10587
- name: Lint with flake8
10688
run: |
10789
# stop the build if there are Python syntax errors or undefined names
@@ -194,8 +176,6 @@ jobs:
194176
python ${{ env.LLM_BENCH_PYPATH }}/convert.py --model_id TinyLlama/TinyLlama-1.1B-Chat-v1.0 --output_dir ${{ env.SRC_DIR }} --stateful
195177
grep beam_idx ${{ env.SRC_DIR }}/pytorch/dldt/FP32/openvino_model.xml
196178
working-directory: ${{ env.OV_INSTALL_DIR }}
197-
env:
198-
CMAKE_BUILD_PARALLEL_LEVEL: 4
199179
- name: WWB Tests
200180
run: |
201181
pip install pytest

.github/workflows/stable_diffusion_1_5_cpp.yml

+80-23
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,83 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
env:
20-
PYTHON_VERSION: '3.10'
21-
LINUX_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2025.0.0-17539-6abe2e39391/l_openvino_toolkit_ubuntu20_2025.0.0.dev20241205_x86_64.tgz
22-
WINDOWS_OV_ARCHIVE_URL: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2025.0.0-17539-6abe2e39391/w_openvino_toolkit_windows_2025.0.0.dev20241205_x86_64.zip
20+
PYTHON_VERSION: '3.11'
2321
OV_INSTALL_DIR: ${{ github.workspace }}/ov
2422

2523
jobs:
24+
openvino_download_linux:
25+
name: Download OpenVINO for Linux
26+
outputs:
27+
status: ${{ steps.openvino_download.outcome }}
28+
ov_artifact_name: ${{ steps.openvino_download.outputs.ov_artifact_name }}
29+
ov_wheel_source: ${{ steps.openvino_download.outputs.ov_wheel_source }}
30+
ov_version: ${{ steps.openvino_download.outputs.ov_version }}
31+
timeout-minutes: 10
32+
defaults:
33+
run:
34+
shell: bash
35+
runs-on: aks-linux-2-cores-8gb
36+
container:
37+
image: 'openvinogithubactions.azurecr.io/openvino_provider:0.1.0'
38+
volumes:
39+
- /mount:/mount
40+
- ${{ github.workspace }}:${{ github.workspace }}
41+
42+
steps:
43+
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master
44+
id: openvino_download
45+
with:
46+
platform: ubuntu22
47+
commit_packages_to_provide: wheels
48+
revision: 747d0e7e105c9f2c9966a37861f95b1c7f886868
49+
50+
openvino_download_windows:
51+
name: Download OpenVINO for Windows
52+
outputs:
53+
status: ${{ steps.openvino_download.outcome }}
54+
ov_artifact_name: ${{ steps.openvino_download.outputs.ov_artifact_name }}
55+
ov_wheel_source: ${{ steps.openvino_download.outputs.ov_wheel_source }}
56+
ov_version: ${{ steps.openvino_download.outputs.ov_version }}
57+
timeout-minutes: 10
58+
defaults:
59+
run:
60+
shell: bash
61+
runs-on: aks-linux-2-cores-8gb
62+
container:
63+
image: 'openvinogithubactions.azurecr.io/openvino_provider:0.1.0'
64+
volumes:
65+
- /mount:/mount
66+
- ${{ github.workspace }}:${{ github.workspace }}
67+
68+
steps:
69+
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master
70+
id: openvino_download
71+
with:
72+
platform: windows
73+
commit_packages_to_provide: wheels
74+
revision: 747d0e7e105c9f2c9966a37861f95b1c7f886868
75+
2676
stable_diffusion_1_5_cpp-linux:
27-
runs-on: ubuntu-20.04-8-cores
77+
runs-on: ubuntu-22.04-8-cores
78+
needs: [ openvino_download_linux ]
2879
defaults:
2980
run:
3081
shell: bash -l {0}
3182
env:
3283
build_dir: ${{ github.workspace }}//build
84+
SRC_DIR: ${{ github.workspace }}
85+
3386
steps:
3487
- uses: actions/checkout@v4
3588
with:
3689
submodules: recursive
3790

38-
- name: Download OpenVINO archive
39-
run: |
40-
wget ${{ env.LINUX_OV_ARCHIVE_URL}} --progress=bar:force:noscroll -O openvino_package.tar.gz
41-
mkdir ${{ env.OV_INSTALL_DIR }}
42-
tar -xzf openvino_package.tar.gz -C ${{ env.OV_INSTALL_DIR }} --strip-components=1
91+
- name: Download OpenVINO package
92+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
93+
with:
94+
name: ${{ needs.openvino_download_linux.outputs.ov_artifact_name }}
95+
path: ${{ env.OV_INSTALL_DIR }}
96+
merge-multiple: true
4397

4498
- name: Setup Python ${{ env.PYTHON_VERSION }}
4599
uses: actions/setup-python@v5
@@ -58,9 +112,10 @@ jobs:
58112

59113
- name: Install python dependencies
60114
run: |
61-
source openvino_sd_cpp/bin/activate
62-
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
63-
python -m pip install -r ./samples/requirements.txt
115+
source ${{ github.workspace }}/openvino_sd_cpp/bin/activate
116+
python -m pip install ${{ env.SRC_DIR }}/thirdparty/openvino_tokenizers/[transformers] ${{ needs.openvino_download_linux.outputs.ov_wheel_source }}
117+
python -m pip install -r ${{ env.SRC_DIR }}/samples/requirements.txt
118+
working-directory: ${{ env.OV_INSTALL_DIR }}
64119

65120
- name: Download and convert models and tokenizer
66121
run: |
@@ -95,25 +150,26 @@ jobs:
95150
PYTHONPATH: ${{ env.build_dir }}
96151

97152
stable_diffusion_1_5_cpp-windows:
153+
needs: [ openvino_download_windows ]
98154
runs-on: windows-2019
99155
defaults:
100156
run:
101157
shell: pwsh
102158
env:
103159
build_dir: ${{ github.workspace }}\build
160+
SRC_DIR: ${{ github.workspace }}
161+
104162
steps:
105163
- uses: actions/checkout@v4
106164
with:
107165
submodules: recursive
108166

109-
- name: Download OpenVINO archive
110-
run: |
111-
mkdir ${{ env.OV_INSTALL_DIR }}
112-
pushd ${{ env.OV_INSTALL_DIR }}
113-
Invoke-WebRequest "${{ env.WINDOWS_OV_ARCHIVE_URL}}" -OutFile "openvino_package.zip"
114-
Expand-Archive openvino_package.zip -DestinationPath ./tmp
115-
mv ./tmp/*/* .
116-
popd
167+
- name: Download OpenVINO package
168+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
169+
with:
170+
name: ${{ needs.openvino_download_windows.outputs.ov_artifact_name }}
171+
path: ${{ env.OV_INSTALL_DIR }}
172+
merge-multiple: true
117173

118174
- name: Setup Python ${{ env.PYTHON_VERSION }}
119175
uses: actions/setup-python@v5
@@ -132,9 +188,10 @@ jobs:
132188

133189
- name: Install python dependencies
134190
run: |
135-
. "./openvino_sd_cpp/Scripts/Activate.ps1"
136-
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
137-
python -m pip install -r ./samples/requirements.txt
191+
. "${{ github.workspace }}/openvino_sd_cpp/Scripts/Activate.ps1"
192+
python -m pip install ${{ env.SRC_DIR }}/thirdparty/openvino_tokenizers/[transformers] ${{ needs.openvino_download_windows.outputs.ov_wheel_source }}
193+
python -m pip install -r ${{ env.SRC_DIR }}/samples/requirements.txt
194+
working-directory: ${{ env.OV_INSTALL_DIR }}
138195

139196
- name: Download and convert models and tokenizer
140197
run: |

0 commit comments

Comments
 (0)