Skip to content

Commit f1c66f9

Browse files
committed
Merge remote-tracking branch 'upstream/master' into single-package
t push --force ori si
2 parents 25dc8c4 + 47fbb5e commit f1c66f9

File tree

143 files changed

+7210
-3230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+7210
-3230
lines changed

.github/ISSUE_TEMPLATE/good_first_issue.yml

-67
This file was deleted.

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ updates:
1717
schedule:
1818
interval: "weekly"
1919
- package-ecosystem: "pip"
20-
directory: "text_generation/causal_lm/cpp/"
20+
directory: "samples/"
2121
schedule:
2222
interval: "weekly"

.github/workflows/causal_lm_cpp.yml

+235-44
Large diffs are not rendered by default.

.github/workflows/genai_package.yml

+30-22
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: genai_package
22
on: pull_request
3-
permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions
3+
permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions
44
concurrency:
55
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
66
cancel-in-progress: true
7+
env:
8+
l_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16161-d253f4fd89c/l_openvino_toolkit_ubuntu20_2024.4.0.dev20240730_x86_64.tgz
9+
m_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16161-d253f4fd89c/m_openvino_toolkit_macos_12_6_2024.4.0.dev20240730_x86_64.tgz
10+
w_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16161-d253f4fd89c/w_openvino_toolkit_windows_2024.4.0.dev20240730_x86_64.zip
711
jobs:
812
ubuntu_genai_package:
913
strategy:
@@ -20,21 +24,21 @@ jobs:
2024
with:
2125
python-version: 3.8
2226
- run: mkdir ./ov/
23-
- run: curl https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc2/linux/l_openvino_toolkit_ubuntu20_2024.2.0.dev20240529_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz
27+
- run: curl ${{ env.l_ov_link }} | tar --directory ./ov/ --strip-components 1 -xz
2428
- run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh
2529
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/
2630
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j
27-
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
28-
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
31+
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
32+
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
2933
- run: source ./ov/setupvars.sh && optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
3034
- run: source ./ov/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov
3135
- run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace
32-
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build
36+
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build
3337
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ov/samples/cpp/ -B ./samples\ build/ && cmake --build ./samples\ build/ --config ${{ matrix.build-type }} -j && cmake --install ./samples\ build/ --config ${{ matrix.build-type }} --component samples_bin --prefix s\ pace
3438
if: ${{ 'Release' != matrix.build-type }}
3539
- run: source ./ov/setupvars.sh && timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ ""
3640
- run: source ./ov/setupvars.sh && timeout 25s ./ov/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0
37-
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
41+
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
3842

3943
macos_genai_package:
4044
strategy:
@@ -49,34 +53,34 @@ jobs:
4953
with:
5054
python-version: 3.8
5155
- run: mkdir ./ov/
52-
- run: curl https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc2/macos/m_openvino_toolkit_macos_12_6_2024.2.0.dev20240529_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz
56+
- run: curl ${{ env.m_ov_link }} | tar --directory ./ov/ --strip-components 1 -xz
5357
- run: brew install coreutils scons
5458
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/
5559
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j
56-
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
57-
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
60+
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
61+
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
5862
- run: source ./ov/setupvars.sh && optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
5963
- run: source ./ov/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov
6064
- run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace
61-
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build
65+
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build
6266
- run: >
6367
source ./ov/setupvars.sh
6468
&& cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ov/samples/cpp/ -B ./samples\ build/
6569
&& cmake --build ./samples\ build/ --config ${{ matrix.build-type }} -j
6670
&& cmake --install ./samples\ build/ --config ${{ matrix.build-type }} --component samples_bin --prefix s\ pace
6771
if: ${{ 'Release' != matrix.build-type }}
68-
- run: source ./ov/setupvars.sh && timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ ""
72+
- run: source ./ov/setupvars.sh && timeout 30s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ ""
6973
- run: source ./ov/setupvars.sh && timeout 25s ./ov/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0
70-
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
74+
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
7175

7276
windows_genai_package:
73-
if: false
7477
strategy:
7578
matrix:
7679
build-type: [Release, Debug]
7780
runs-on: windows-latest
7881
env:
7982
CMAKE_BUILD_PARALLEL_LEVEL: null
83+
PYTHONIOENCODING: "utf8"
8084
defaults:
8185
run:
8286
shell: cmd
@@ -87,24 +91,28 @@ jobs:
8791
- uses: actions/setup-python@v4
8892
with:
8993
python-version: 3.8
90-
- run: curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc2/windows/w_openvino_toolkit_windows_2024.2.0.dev20240529_x86_64.zip
91-
- run: unzip ov.zip
92-
# Shorten the next setupvars calls.
93-
- run: mklink /D ov w_openvino_toolkit_windows_2024.2.0.dev20240529_x86_64
94+
- run: >
95+
curl --output ov.zip ${{ env.w_ov_link }}
96+
&& unzip -d ov ov.zip
97+
&& dirs=(ov/*)
98+
&& mv ov/*/* ov
99+
&& rmdir "${dirs[@]}"
100+
shell: bash
94101
- run: call ov\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/
95102
- run: call ov\setupvars.bat && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j
96-
- run: call ov\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
97-
- run: call ov\setupvars.bat && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
103+
- run: call ov\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
104+
- run: call ov\setupvars.bat && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
98105
- run: call ov\setupvars.bat && optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
99106
- run: call ov\setupvars.bat && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov
100107
- run: call ov\samples\cpp\build_samples_msvc.bat -i "${{ github.workspace }}/samples_install"
101-
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build
108+
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build
102109
- run: >
103110
call ov\setupvars.bat
104111
&& cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ov/samples/cpp/ -B "samples build"
105112
&& cmake --build "samples build" --config ${{ matrix.build-type }} -j
106113
&& cmake --install "samples build" --config ${{ matrix.build-type }} --component samples_bin --prefix samples_install
107114
if: ${{ 'Release' != matrix.build-type }}
108115
- run: call ov\setupvars.bat && "${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm" .\TinyLlama-1.1B-Chat-v1.0\ ""
109-
- run: call ov\setupvars.bat && ./ov/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0
110-
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
116+
if: ${{ 'Release' == matrix.build-type }} # Tokenizers don't work in debug
117+
- run: call ov\setupvars.bat && python .\ov\samples\python\multinomial_causal_lm\multinomial_causal_lm.py .\TinyLlama-1.1B-Chat-v1.0\ 0
118+
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
+24-18
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name: genai_python_lib
22
on: pull_request
3-
permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions
3+
permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions
44
concurrency:
55
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
66
cancel-in-progress: true
7+
env:
8+
l_ov_centos_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16161-d253f4fd89c/l_openvino_toolkit_centos7_2024.4.0.dev20240730_x86_64.tgz
9+
m_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16161-d253f4fd89c/m_openvino_toolkit_macos_12_6_2024.4.0.dev20240730_x86_64.tgz
10+
w_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.4.0-16161-d253f4fd89c/w_openvino_toolkit_windows_2024.4.0.dev20240730_x86_64.zip
711
jobs:
812
ubuntu_genai_python_lib:
913
# A tokenizers' dependency fails to compile on ubuntu-20 n CenOS7 env.
10-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-22.04-16-cores
1115
env:
1216
# A tokenizers' dependency fails to compile with Ninja in CenOS7 env.
1317
CMAKE_GENERATOR: Unix Makefiles
@@ -21,14 +25,14 @@ jobs:
2125
python-version: 3.8
2226
- run: mkdir ./ov/
2327
# Install CentOS7 instead of Ubuntu to match PyPI distribution ABI.
24-
- run: curl https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc2/linux/l_openvino_toolkit_centos7_2024.2.0.dev20240529_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz
28+
- run: curl ${{ env.l_ov_centos_link }} | tar --directory ./ov/ --strip-components 1 -xz
2529
- run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh
2630
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
2731
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j
28-
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
29-
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
32+
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly --upgrade-strategy eager
33+
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/
3034
- run: source ./ov/setupvars.sh && python -m pip install . --verbose
31-
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
35+
- run: python -m pytest ./tests/python_tests/
3236

3337
macos_genai_python_lib:
3438
runs-on: macos-12
@@ -44,21 +48,21 @@ jobs:
4448
with:
4549
python-version: 3.8
4650
- run: mkdir ./ov/
47-
- run: curl https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc2/macos/m_openvino_toolkit_macos_12_6_2024.2.0.dev20240529_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz
51+
- run: curl ${{ env.m_ov_link }} | tar --directory ./ov/ --strip-components 1 -xz
4852
- run: brew install coreutils scons
4953
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
5054
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j
51-
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
52-
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
55+
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly --upgrade-strategy eager
56+
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/
5357
- run: source ./ov/setupvars.sh && python -m pip install . --verbose
5458
- run: python -c "from openvino_genai import LLMPipeline"
55-
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
59+
- run: python -m pytest ./tests/python_tests/
5660

5761
windows_genai_python_lib:
58-
if: false
5962
runs-on: windows-latest
6063
env:
6164
CMAKE_BUILD_PARALLEL_LEVEL: null
65+
PYTHONIOENCODING: "utf8"
6266
defaults:
6367
run:
6468
shell: cmd
@@ -69,14 +73,16 @@ jobs:
6973
- uses: actions/setup-python@v4
7074
with:
7175
python-version: 3.8
72-
- run: curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc2/windows/w_openvino_toolkit_windows_2024.2.0.dev20240529_x86_64.zip
73-
- run: unzip ov.zip
74-
# Shorten the next setupvars calls.
75-
- run: mklink /D ov w_openvino_toolkit_windows_2024.2.0.dev20240529_x86_64
76+
- name: Install OpenVINO
77+
run: |
78+
curl --output ov.zip ${{ env.w_ov_link }}
79+
unzip -d ov ov.zip
80+
dirs=(ov/*) && mv ov/*/* ov && rmdir "${dirs[@]}"
81+
shell: bash
7682
- run: call ./ov/setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
7783
- run: call ./ov/setupvars.bat && cmake --build ./build/ --config Release -j
78-
- run: call ./ov/setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release --upgrade-strategy eager
84+
- run: call ./ov/setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly --upgrade-strategy eager
7985
# cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that.
80-
- run: set "PYTHONPATH=./build/" && call ./ov/setupvars.bat && python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
86+
- run: set "PYTHONPATH=./build/" && call ./ov/setupvars.bat && python -m pytest ./tests/python_tests/
8187
- run: call ./ov/setupvars.bat && python -m pip install . --verbose
82-
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
88+
- run: python -m pytest ./tests/python_tests/

0 commit comments

Comments
 (0)