From 668e53a1d99b213e3e64fc83789f0c18c6bcba95 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 11:37:26 +0200 Subject: [PATCH 01/63] intriduce universal linux pipeline --- .github/workflows/linux.yml | 283 ++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000000..bb31d6ab12 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,283 @@ +name: Linux (Ubuntu 20.04, Python 3.8) +on: + workflow_dispatch: + pull_request: + merge_group: + push: + branches: + - master + - 'releases/**' + +concurrency: + # github.ref is not unique in post-commit + group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-linux + cancel-in-progress: true + +env: + PYTHON_VERSION: '3.8' + OV_BRANCH: 'master' + OV_TARBALL: '' + +permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions + +jobs: + openvino_download: + outputs: + status: ${{ steps.openvino_download.outcome }} + timeout-minutes: 10 + defaults: + run: + shell: bash + runs-on: ubuntu-20.04 + + steps: + - name: Download OpenVINO build + id: openvino_download + run: | + wget ${{ env.OV_TARBALL}} --progress=bar:force:noscroll -O openvino_package.tar.gz + tar -tvf openvino_package.tar.gz + continue-on-error: true + + # + # Upload to artifacts + # + + - name: Upload openvino package + if: steps.openvino_download.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: openvino_package + path: openvino_package.tar.gz + if-no-files-found: 'error' + + openvino_build: + needs: [openvino_download] + if: needs.openvino_download.outputs.status != 'success' + timeout-minutes: 150 + defaults: + run: + shell: bash + runs-on: ubuntu-20.04-16-cores + env: + DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input + CMAKE_BUILD_TYPE: 'Release' + CMAKE_GENERATOR: 'Ninja Multi-Config' + CMAKE_CXX_COMPILER_LAUNCHER: ccache + CMAKE_C_COMPILER_LAUNCHER: ccache + OPENVINO_REPO: ${{ github.workspace }}/openvino + INSTALL_DIR: ${{ github.workspace }}/openvino/install + BUILD_DIR: ${{ github.workspace }}/openvino/build + + steps: + - name: Set apt retries + run: echo 'Acquire::Retries "10";' | sudo tee -a /etc/apt/apt.conf.d/80-retries > /dev/null + + - name: Install git + run: | + sudo apt-get update + sudo apt-get install --assume-yes --no-install-recommends git ca-certificates + + - name: Clone OpenVINO + uses: actions/checkout@v4 + with: + repository: 'openvinotoolkit/openvino' + path: ${{ env.OPENVINO_REPO }} + submodules: 'true' + ref: ${{ env.OV_BRANCH}} + + # + # Dependencies + # + + - name: Install build dependencies + run: | + sudo -E ${OPENVINO_REPO}/install_build_dependencies.sh + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Install python dependencies + run: | + # For Python API: build and wheel packaging + python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt + + # + # Build + # + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: "2000M" + # Should save cache only if run in the master branch of the base repo + # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push + save: ${{ github.ref_name == 'master' && 'true' || 'false' }} + verbose: 2 + key: linux-ubuntu + restore-keys: | + linux-ubuntu + + - name: CMake configure - OpenVINO + run: | + cmake \ + -G "${{ env.CMAKE_GENERATOR }}" \ + -DENABLE_CPPLINT=OFF \ + -DENABLE_NCC_STYLE=OFF \ + -DENABLE_TESTS=OFF \ + -DENABLE_STRICT_DEPENDENCIES=OFF \ + -DENABLE_SYSTEM_TBB=ON \ + -DENABLE_SYSTEM_OPENCL=ON \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCPACK_GENERATOR=TGZ \ + -DENABLE_JS=OFF \ + -DENABLE_SAMPLES=OFF \ + -DENABLE_INTEL_NPU=OFF \ + -DENABLE_OV_ONNX_FRONTEND=OFF \ + -DENABLE_OV_PADDLE_FRONTEND=OFF \ + -DENABLE_OV_PYTORCH_FRONTEND=OFF \ + -DENABLE_OV_TF_FRONTEND=ON \ + -DENABLE_OV_TF_LITE_FRONTEND=OFF \ + -DENABLE_INTEL_GPU=OFF \ + -DENABLE_INTEL_NPU=OFF \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DENABLE_PYTHON=ON \ + -DENABLE_WHEEL=ON \ + -S ${OPENVINO_REPO} \ + -B ${BUILD_DIR} + + - name: Clean ccache stats + run: ccache --zero-stats --show-config + + - name: Cmake build - OpenVINO + run: cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} + + - name: Show ccache stats + run: ccache --show-stats + + - name: Cmake install - OpenVINO + run: | + cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/openvino_package -P ${BUILD_DIR}/cmake_install.cmake + cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/openvino_package -DCOMPONENT=python_wheels -P ${BUILD_DIR}/cmake_install.cmake + + - name: Pack Artifacts + run: | + pushd ${INSTALL_DIR} + tar -czvf ${BUILD_DIR}/openvino_package.tar.gz * + popd + + # + # Upload build artifacts and logs + # + + - name: Upload openvino package + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: openvino_package + path: ${{ env.BUILD_DIR }}/openvino_package.tar.gz + if-no-files-found: 'error' + + genai_python_lib: + needs: [ openvino_download, openvino_build ] + if: | + always() && + (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') + timeout-minutes: 30 + defaults: + run: + shell: bash + runs-on: ubuntu-22.04 + env: + # A tokenizers' dependency fails to compile with Ninja in CenOS7 env. + CMAKE_GENERATOR: Unix Makefiles + CMAKE_BUILD_PARALLEL_LEVEL: null + OV_INSTALL_DIR: ${{ github.workspace }}/ov + + steps: + - name: Clone openvino.genai + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Download OpenVINO package + uses: actions/download-artifact@v4 + with: + name: openvino_package + path: ${{ env.OV_INSTALL_DIR }} + + - name: Extract OpenVINO packages + run: | + pushd ${OV_INSTALL_DIR} + tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1 + popd + + - name: Install build dependencies + run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_build_dependencies.sh + + - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ + - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --build ./build/ --config Release -j + - run: source ${OV_INSTALL_DIR}/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 + - run: source ${OV_INSTALL_DIR}/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + - run: source ${OV_INSTALL_DIR}/setupvars.sh && python -m pip install . --verbose + - run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + + genai_package: + strategy: + matrix: + build-type: [Release, Debug] + runs-on: ubuntu-20.04 + env: + CMAKE_BUILD_PARALLEL_LEVEL: null + OV_INSTALL_DIR: ${{ github.workspace }}/ov + + steps: + - name: Clone openvino.genai + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Download OpenVINO package + uses: actions/download-artifact@v4 + with: + name: openvino_package + path: ${{ env.OV_INSTALL_DIR }} + + - name: Extract OpenVINO packages + run: | + pushd ${OV_INSTALL_DIR} + tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1 + popd + + - name: Install build dependencies + run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_build_dependencies.sh + + - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ + - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j + - run: source ${OV_INSTALL_DIR}/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly + - run: source ${OV_INSTALL_DIR}/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly + - run: source ${OV_INSTALL_DIR}/setupvars.sh && optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 + - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov + - run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build + - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${OV_INSTALL_DIR}/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 + if: ${{ 'Release' != matrix.build-type }} + - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only From 3d34aa4926b3dc33f844a105c787e3d7c6212c70 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 11:43:04 +0200 Subject: [PATCH 02/63] save cache --- .github/workflows/linux.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bb31d6ab12..81067b6109 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -114,7 +114,8 @@ jobs: max-size: "2000M" # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push - save: ${{ github.ref_name == 'master' && 'true' || 'false' }} + # save: ${{ github.ref_name == 'master' && 'true' || 'false' }} + save: true # TODO: remove before merge verbose: 2 key: linux-ubuntu restore-keys: | @@ -236,6 +237,14 @@ jobs: strategy: matrix: build-type: [Release, Debug] + needs: [ openvino_download, openvino_build ] + if: | + always() && + (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') + timeout-minutes: 30 + defaults: + run: + shell: bash runs-on: ubuntu-20.04 env: CMAKE_BUILD_PARALLEL_LEVEL: null From 41587ba0caa2baa455c1c2a347a560888ec50d0a Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 12:06:45 +0200 Subject: [PATCH 03/63] use ubuntu 20 --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 81067b6109..c6f9f55efb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -192,7 +192,7 @@ jobs: defaults: run: shell: bash - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 env: # A tokenizers' dependency fails to compile with Ninja in CenOS7 env. CMAKE_GENERATOR: Unix Makefiles From 190b43b5f2c10b675ef67645e16d509808b2213d Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 12:10:49 +0200 Subject: [PATCH 04/63] install_openvino_dependencies --- .github/workflows/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c6f9f55efb..fb374cd6f8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -224,7 +224,7 @@ jobs: popd - name: Install build dependencies - run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_build_dependencies.sh + run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --build ./build/ --config Release -j @@ -275,7 +275,7 @@ jobs: popd - name: Install build dependencies - run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_build_dependencies.sh + run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j From 9ff40cb7cbd2491a12cb2492fbd365fe533cae9e Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 12:19:03 +0200 Subject: [PATCH 05/63] build with tbb --- .github/workflows/linux.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fb374cd6f8..c95328e1b7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -129,7 +129,6 @@ jobs: -DENABLE_NCC_STYLE=OFF \ -DENABLE_TESTS=OFF \ -DENABLE_STRICT_DEPENDENCIES=OFF \ - -DENABLE_SYSTEM_TBB=ON \ -DENABLE_SYSTEM_OPENCL=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCPACK_GENERATOR=TGZ \ From 2d1e12bfe0ce61c085893dd5b16c4f12d650229d Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 12:37:31 +0200 Subject: [PATCH 06/63] added torch FE --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c95328e1b7..02ce017b4a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -137,7 +137,7 @@ jobs: -DENABLE_INTEL_NPU=OFF \ -DENABLE_OV_ONNX_FRONTEND=OFF \ -DENABLE_OV_PADDLE_FRONTEND=OFF \ - -DENABLE_OV_PYTORCH_FRONTEND=OFF \ + -DENABLE_OV_PYTORCH_FRONTEND=ON \ -DENABLE_OV_TF_FRONTEND=ON \ -DENABLE_OV_TF_LITE_FRONTEND=OFF \ -DENABLE_INTEL_GPU=OFF \ From 34cd0212653dc1607f5e570d8fc944269d3f27b2 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 12:57:34 +0200 Subject: [PATCH 07/63] added win pipeline --- .github/workflows/windows.yml | 241 ++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..9385d1555e --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,241 @@ +name: Windows (VS 2019, Python 3.11) +on: + workflow_dispatch: + pull_request: + merge_group: + push: + branches: + - master + - 'releases/**' + +concurrency: + # github.ref is not unique in post-commit + group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-windows + cancel-in-progress: true + +env: + PYTHON_VERSION: '3.11' + OV_BRANCH: 'master' + OV_TARBALL: '' + +permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions + +jobs: + openvino_download: + outputs: + status: ${{ steps.openvino_download.outcome }} + timeout-minutes: 10 + defaults: + run: + shell: bash + runs-on: ubuntu-20.04 + + steps: + - name: Download OpenVINO build + id: openvino_download + run: | + wget ${{ env.OV_TARBALL}} --progress=bar:force:noscroll -O openvino_package.zip + unzip -l openvino_package.zip + continue-on-error: true + + # + # Upload to artifacts + # + + - name: Upload openvino package + if: steps.openvino_download.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: openvino_package + path: openvino_package.zip + if-no-files-found: 'error' + + openvino_build: + needs: [openvino_download] + if: needs.openvino_download.outputs.status != 'success' + timeout-minutes: 150 + defaults: + run: + shell: pwsh + runs-on: windows-2019-16-core + env: + CMAKE_BUILD_TYPE: 'Release' + CMAKE_GENERATOR: 'Ninja Multi-Config' + CMAKE_CXX_COMPILER_LAUNCHER: ccache + CMAKE_C_COMPILER_LAUNCHER: ccache + OPENVINO_REPO: ${{ github.workspace }}\\openvino + INSTALL_DIR: ${{ github.workspace }}\\openvino\\install + BUILD_DIR: ${{ github.workspace }}\\openvino\\build + + steps: + - name: git configuration + run: git config --system core.longpaths true + + - name: Clone OpenVINO + uses: actions/checkout@v4 + with: + repository: 'openvinotoolkit/openvino' + path: ${{ env.OPENVINO_REPO }} + submodules: 'true' + ref: ${{ env.OV_BRANCH }} + + # + # Dependencies + # + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Install python dependencies + run: | + # For Python API: build and wheel packaging + python3 -m pip install -r ${env:OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt + + - name: Install build dependencies + run: | + Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip -MaximumRetryCount 10 + Expand-Archive -Force ninja-win.zip + # Add it to the GitHub Path so it would be available in the subsequent steps + Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}/ninja-win" + + # + # Build + # + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: "2000M" + # Should save cache only if run in the master branch of the base repo + # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push + save: ${{ github.ref_name == 'master' && 'true' || 'false' }} + verbose: 2 + key: ccache-windows + restore-keys: | + ccache-windows + + - name: Configure Developer Command Prompt for Microsoft Visual C++ + uses: ilammy/msvc-dev-cmd@v1 + + - name: CMake configure - OpenVINO + run: | + cmake -G "${{ env.CMAKE_GENERATOR }}" ` + -DENABLE_CPPLINT=OFF ` + -DBUILD_nvidia_plugin=OFF ` + -DBUILD_SHARED_LIBS=ON ` + -DENABLE_TESTS=OFF ` + -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF ` + -DENABLE_STRICT_DEPENDENCIES=OFF ` + -DENABLE_PYTHON=ON ` + -DENABLE_WHEEL=ON ` + -DENABLE_JS=OFF ` + -DENABLE_SAMPLES=OFF ` + -DENABLE_INTEL_NPU=OFF ` + -DENABLE_OV_ONNX_FRONTEND=OFF ` + -DENABLE_OV_PADDLE_FRONTEND=OFF ` + -DENABLE_OV_PYTORCH_FRONTEND=ON ` + -DENABLE_OV_TF_FRONTEND=ON ` + -DENABLE_OV_TF_LITE_FRONTEND=OFF ` + -DENABLE_INTEL_GPU=OFF ` + -DENABLE_INTEL_NPU=OFF ` + -DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON ` + -S ${{ env.OPENVINO_REPO }} ` + -B ${{ env.BUILD_DIR }} + + - name: Clean ccache stats + run: ccache --zero-stats --show-config + + - name: Cmake build - OpenVINO + run: cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} --verbose + + - name: Show ccache stats + run: ccache --show-stats + + - name: Cmake install - OpenVINO + run: | + cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}/ov_package -P ${{ env.BUILD_DIR }}/cmake_install.cmake + cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}/ov_package -DCOMPONENT=python_wheels -P ${{ env.BUILD_DIR }}/cmake_install.cmake + + - name: Pack Artifacts + run: | + $file=Get-ChildItem -Path "${{ env.INSTALL_DIR }}" + $compress = @{ + Path = $file + CompressionLevel = "Optimal" + DestinationPath = "${{ env.BUILD_DIR }}/openvino_package.zip" + } + Compress-Archive @compress + + # + # Upload build artifacts and logs + # + + - name: Upload openvino package + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: openvino_package + path: ${{ env.BUILD_DIR }}/openvino_package.zip + if-no-files-found: 'error' + + genai_python_lib: + needs: [ openvino_download, openvino_build ] + if: | + always() && + (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') + timeout-minutes: 25 + defaults: + run: + shell: pwsh + runs-on: windows-latest + + env: + OV_INSTALL_DIR: ${{ github.workspace }}\\ov + + steps: + - name: Clone openvino.genai + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Download OpenVINO package + uses: actions/download-artifact@v4 + with: + name: openvino_package + path: ${{ env.OV_INSTALL_DIR }} + + - name: Extract OpenVINO packages + run: | + pushd ${{ env.OV_INSTALL_DIR }} + Expand-Archive openvino_package.zip -DestinationPath ./tmp + mv ./tmp/*/* . + popd + + - name: build gen_ai + run: | + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ + cmake --build ./build/ --config Release -j + + - name: test bindings + run: + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + 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 + python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + env: + PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. + + - name: test bindings from whell + run: + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + python -m pip install . --verbose + python -m pytest ./tests/python_tests/test_generate_api.py -m precommit From 57b48b62cec98f772331698bfb3c6b06f5b9c268 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 13:04:28 +0200 Subject: [PATCH 08/63] use wheel from ov package --- .github/workflows/linux.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 02ce017b4a..33ad9a5d32 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -225,12 +225,25 @@ jobs: - name: Install build dependencies run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh - - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ - - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --build ./build/ --config Release -j - - run: source ${OV_INSTALL_DIR}/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 - - run: source ${OV_INSTALL_DIR}/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/test_generate_api.py -m precommit - - run: source ${OV_INSTALL_DIR}/setupvars.sh && python -m pip install . --verbose - - run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + - name: Buils genai + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ + cmake --build ./build/ --config Release -j + + - name: test bindings + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/tools --upgrade-strategy eager + python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + env: + PYTHONPATH: "./build/:$PYTHONPATH" + + - name: test bindings (wheel) + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools + python -m pytest ./tests/python_tests/test_generate_api.py -m precommit genai_package: strategy: From af43bf437840935d4f0b3cf76b4adec186eda537 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 13:05:14 +0200 Subject: [PATCH 09/63] save win cache --- .github/workflows/windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9385d1555e..cca8266d15 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -111,7 +111,8 @@ jobs: max-size: "2000M" # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push - save: ${{ github.ref_name == 'master' && 'true' || 'false' }} + #save: ${{ github.ref_name == 'master' && 'true' || 'false' }} + save: 'true' # TODO: remove before merge verbose: 2 key: ccache-windows restore-keys: | From 012b521ade798d83b9c89b7e429f864aed547766 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 13:21:13 +0200 Subject: [PATCH 10/63] build samples --- .github/workflows/linux.yml | 47 +++++++++++++++++++++++++---------- .github/workflows/windows.yml | 2 +- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 33ad9a5d32..96426a38ad 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -133,7 +133,7 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCPACK_GENERATOR=TGZ \ -DENABLE_JS=OFF \ - -DENABLE_SAMPLES=OFF \ + -DENABLE_SAMPLES=ON \ -DENABLE_INTEL_NPU=OFF \ -DENABLE_OV_ONNX_FRONTEND=OFF \ -DENABLE_OV_PADDLE_FRONTEND=OFF \ @@ -225,7 +225,7 @@ jobs: - name: Install build dependencies run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh - - name: Buils genai + - name: Build genai run: | source ${OV_INSTALL_DIR}/setupvars.sh cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ @@ -289,16 +289,37 @@ jobs: - name: Install build dependencies run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh - - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ - - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j - - run: source ${OV_INSTALL_DIR}/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly - - run: source ${OV_INSTALL_DIR}/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly - - run: source ${OV_INSTALL_DIR}/setupvars.sh && optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov - - run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + - name: Build genai + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ + cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j + + - name: Test bindings + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${OV_INSTALL_DIR}/tools + python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${OV_INSTALL_DIR}/tools + optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 + + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR} + ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - - run: source ${OV_INSTALL_DIR}/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${OV_INSTALL_DIR}/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 + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${OV_INSTALL_DIR}/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 if: ${{ 'Release' != matrix.build-type }} - - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cca8266d15..b217ee7340 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -133,7 +133,7 @@ jobs: -DENABLE_PYTHON=ON ` -DENABLE_WHEEL=ON ` -DENABLE_JS=OFF ` - -DENABLE_SAMPLES=OFF ` + -DENABLE_SAMPLES=ON ` -DENABLE_INTEL_NPU=OFF ` -DENABLE_OV_ONNX_FRONTEND=OFF ` -DENABLE_OV_PADDLE_FRONTEND=OFF ` From c9096079cda04ad83d43777088fea326e3080251 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 13:39:09 +0200 Subject: [PATCH 11/63] win package pipeline --- .github/workflows/windows.yml | 81 ++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b217ee7340..c32e4ea988 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -228,7 +228,7 @@ jobs: cmake --build ./build/ --config Release -j - name: test bindings - run: + run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" 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 python -m pytest ./tests/python_tests/test_generate_api.py -m precommit @@ -236,7 +236,84 @@ jobs: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. - name: test bindings from whell - run: + run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install . --verbose python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + + genai_package: + strategy: + matrix: + build-type: [Release, Debug] + needs: [ openvino_download, openvino_build ] + if: | + always() && + (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') + timeout-minutes: 30 + defaults: + run: + shell: pwsh + runs-on: windows-latest + + env: + OV_INSTALL_DIR: ${{ github.workspace }}\\ov + + steps: + - name: Clone openvino.genai + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Download OpenVINO package + uses: actions/download-artifact@v4 + with: + name: openvino_package + path: ${{ env.OV_INSTALL_DIR }} + + - name: Extract OpenVINO packages + run: | + pushd ${{ env.OV_INSTALL_DIR }} + Expand-Archive openvino_package.zip -DestinationPath ./tmp + mv ./tmp/*/* . + popd + + - name: Build gen_ai + run: | + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ + cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j + + - name: Test bindings + run: | + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly + python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly + optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 + + - run: | + if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${{ env.OV_INSTALL_DIR }} + ${{ env.OV_INSTALL_DIR }}\samples\cpp\build_samples.ps1 -i "${{ github.workspace }}/samples_install" + + - run: | + if: ${{ 'Release' != matrix.build-type }} + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + 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 samples_install + + - run: | + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + "${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm" .\TinyLlama-1.1B-Chat-v1.0\ "" + + - run: | + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" + python ${{ env.OV_INSTALL_DIR }}\samples\python\multinomial_causal_lm\multinomial_causal_lm.py .\TinyLlama-1.1B-Chat-v1.0\ 0 From f2b5e1b6d7115771fe9a33b622aac1880bc62ea3 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 13:42:42 +0200 Subject: [PATCH 12/63] --find-links --- .github/workflows/windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c32e4ea988..e40179b183 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -230,7 +230,7 @@ jobs: - name: test bindings run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - 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 + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}/tools--upgrade-strategy eager python -m pytest ./tests/python_tests/test_generate_api.py -m precommit env: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. @@ -292,8 +292,8 @@ jobs: - name: Test bindings run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly - python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${{ env.OV_INSTALL_DIR }}/tools + python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}/tools optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - run: | From 56579ccca24c11a85413082ca07f8fe58e0f570d Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 13:46:41 +0200 Subject: [PATCH 13/63] Configure Developer Command Prompt --- .github/workflows/windows.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e40179b183..a3bba5c109 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -119,7 +119,9 @@ jobs: ccache-windows - name: Configure Developer Command Prompt for Microsoft Visual C++ - uses: ilammy/msvc-dev-cmd@v1 + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + with: + toolset: 14.40 - name: CMake configure - OpenVINO run: | @@ -221,6 +223,11 @@ jobs: mv ./tmp/*/* . popd + - name: Configure Developer Command Prompt for Microsoft Visual C++ + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + with: + toolset: 14.40 + - name: build gen_ai run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" @@ -283,6 +290,11 @@ jobs: mv ./tmp/*/* . popd + - name: Configure Developer Command Prompt for Microsoft Visual C++ + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + with: + toolset: 14.40 + - name: Build gen_ai run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" From db274b6720ddc17f238d9998c85783082d5ad7ed Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 13:49:18 +0200 Subject: [PATCH 14/63] fixed pipelines tests --- .github/workflows/linux.yml | 3 +-- .github/workflows/windows.yml | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 96426a38ad..8efa86d28c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -302,7 +302,6 @@ jobs: python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${OV_INSTALL_DIR}/tools optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - - run: | source ${OV_INSTALL_DIR}/setupvars.sh cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR} @@ -322,4 +321,4 @@ jobs: - run: | source ${OV_INSTALL_DIR}/setupvars.sh timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a3bba5c109..6168992a26 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -309,23 +309,23 @@ jobs: optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - run: | - if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${{ env.OV_INSTALL_DIR }} ${{ env.OV_INSTALL_DIR }}\samples\cpp\build_samples.ps1 -i "${{ github.workspace }}/samples_install" + if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - run: | - if: ${{ 'Release' != matrix.build-type }} . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" 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 samples_install + if: ${{ 'Release' != matrix.build-type }} - run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" "${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm" .\TinyLlama-1.1B-Chat-v1.0\ "" - run: | - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python ${{ env.OV_INSTALL_DIR }}\samples\python\multinomial_causal_lm\multinomial_causal_lm.py .\TinyLlama-1.1B-Chat-v1.0\ 0 + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only \ No newline at end of file From 283031b2417e6abdd3285174b199f9532d4d9524 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 14:01:03 +0200 Subject: [PATCH 15/63] use win_2019 runners only --- .github/workflows/windows.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6168992a26..05b6d02cf1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -120,8 +120,6 @@ jobs: - name: Configure Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - with: - toolset: 14.40 - name: CMake configure - OpenVINO run: | @@ -193,7 +191,7 @@ jobs: defaults: run: shell: pwsh - runs-on: windows-latest + runs-on: windows-2019 env: OV_INSTALL_DIR: ${{ github.workspace }}\\ov @@ -225,8 +223,6 @@ jobs: - name: Configure Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - with: - toolset: 14.40 - name: build gen_ai run: | @@ -260,7 +256,7 @@ jobs: defaults: run: shell: pwsh - runs-on: windows-latest + runs-on: windows-2019 env: OV_INSTALL_DIR: ${{ github.workspace }}\\ov @@ -292,8 +288,6 @@ jobs: - name: Configure Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - with: - toolset: 14.40 - name: Build gen_ai run: | From 1f74605d519f7060bd179f6141c1cf7295f78ba8 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 14:16:54 +0200 Subject: [PATCH 16/63] mac pipelines --- .github/workflows/mac.yml | 236 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 .github/workflows/mac.yml diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 0000000000..c0c570e24d --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,236 @@ +name: macOS (13, Python 3.11) +on: + workflow_dispatch: + pull_request: + merge_group: + push: + branches: + - master + - 'releases/**' + +concurrency: + # github.ref is not unique in post-commit + group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-mac + cancel-in-progress: true + +env: + PYTHON_VERSION: '3.11' + OV_BRANCH: 'master' + OV_TARBALL: '' + +permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions + +jobs: + openvino_download: + outputs: + status: ${{ steps.openvino_download.outcome }} + timeout-minutes: 10 + defaults: + run: + shell: bash + runs-on: ubuntu-20.04 + + steps: + - name: Download OpenVINO build + id: openvino_download + run: | + wget ${{ env.OV_TARBALL}} --progress=bar:force:noscroll -O openvino_package.tar.gz + tar -tvf openvino_package.tar.gz + continue-on-error: true + + # + # Upload to artifacts + # + + - name: Upload openvino package + if: steps.openvino_download.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: openvino_package + path: openvino_package.tar.gz + if-no-files-found: 'error' + + openvino_build: + needs: [openvino_download] + if: needs.openvino_download.outputs.status != 'success' + timeout-minutes: 150 + defaults: + run: + shell: bash + runs-on: 'macos-13-large' + env: + CMAKE_BUILD_TYPE: 'Release' + CMAKE_GENERATOR: 'Ninja Multi-Config' + CMAKE_CXX_COMPILER_LAUNCHER: ccache + CMAKE_C_COMPILER_LAUNCHER: ccache + OPENVINO_REPO: ${{ github.workspace }}/openvino + INSTALL_DIR: ${{ github.workspace }}/openvino/install + BUILD_DIR: ${{ github.workspace }}/openvino/build + + steps: + - name: Clone OpenVINO + uses: actions/checkout@v4 + with: + repository: 'openvinotoolkit/openvino' + path: ${{ env.OPENVINO_REPO }} + submodules: 'true' + ref: ${{ env.OV_BRANCH }} + + # + # Dependencies + # + + - name: Install build dependencies + run: brew install coreutils ninja + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Install python dependencies + run: | + # For Python API: build and wheel packaging + python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt + + # + # Build + # + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: "2000M" + # Should save cache only if run in the master branch of the base repo + # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push + #save: ${{ github.ref_name == 'master' && 'true' || 'false' }} + save: 'true' # TODO: remove before merge + verbose: 2 + key: ccache-mac + restore-keys: | + ccache-mac + + - name: CMake configure - OpenVINO + run: | + cmake \ + -G "${{ env.CMAKE_GENERATOR }}" \ + -DENABLE_CPPLINT=OFF \ + -DENABLE_NCC_STYLE=OFF \ + -DENABLE_TESTS=OFF \ + -DENABLE_STRICT_DEPENDENCIES=OFF \ + -DENABLE_SYSTEM_OPENCL=ON \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCPACK_GENERATOR=TGZ \ + -DENABLE_JS=OFF \ + -DENABLE_SAMPLES=ON \ + -DENABLE_INTEL_NPU=OFF \ + -DENABLE_OV_ONNX_FRONTEND=OFF \ + -DENABLE_OV_PADDLE_FRONTEND=OFF \ + -DENABLE_OV_PYTORCH_FRONTEND=OFF \ + -DENABLE_OV_TF_FRONTEND=ON \ + -DENABLE_OV_TF_LITE_FRONTEND=OFF \ + -DENABLE_INTEL_GPU=OFF \ + -DENABLE_INTEL_NPU=OFF \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DENABLE_PYTHON=ON \ + -DENABLE_WHEEL=ON \ + -S ${OPENVINO_REPO} \ + -B ${BUILD_DIR} + + - name: Clean ccache stats + run: ccache --zero-stats --show-config + + - name: Cmake build - OpenVINO + run: cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} + + - name: Show ccache stats + run: ccache --show-stats + + - name: Cmake install - OpenVINO + run: | + cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/openvino_package -P ${BUILD_DIR}/cmake_install.cmake + cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/openvino_package -DCOMPONENT=python_wheels -P ${BUILD_DIR}/cmake_install.cmake + + - name: Pack Artifacts + run: | + pushd ${INSTALL_DIR} + tar -czvf ${BUILD_DIR}/openvino_package.tar.gz * + popd + + # + # Upload build artifacts and logs + # + + - name: Upload openvino package + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: openvino_package + path: ${{ env.BUILD_DIR }}/openvino_package.tar.gz + if-no-files-found: 'error' + + genai_python_lib: + name: OpenVINO genai extension + needs: [ openvino_download, openvino_build ] + if: | + always() && + (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') + timeout-minutes: 25 + defaults: + run: + shell: bash + runs-on: macos-13 + + env: + OV_INSTALL_DIR: ${{ github.workspace }}/ov + + steps: + - name: Clone openvino.genai + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Download OpenVINO package + uses: actions/download-artifact@v4 + with: + name: openvino_package + path: ${{ env.OV_INSTALL_DIR }} + + - name: Extract OpenVINO packages + run: | + pushd ${OV_INSTALL_DIR} + tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1 + popd + + - name: Install build dependencies + run: brew install coreutils ninja scons + + - name: Build genai + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ + cmake --build ./build/ --config Release -j + + - name: test bindings + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/tools --upgrade-strategy eager + python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + env: + PYTHONPATH: "./build/:$PYTHONPATH" + + - name: test bindings (wheel) + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools + python -c "from openvino_genai import LLMPipeline" + python -m pytest ./tests/python_tests/test_generate_api.py -m precommit From 5ce71ebdbbc67074cb63b911f5d31fc79bc814bb Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 14:30:21 +0200 Subject: [PATCH 17/63] fixed pathes --- .github/workflows/linux.yml | 1 + .github/workflows/mac.yml | 75 +++++++++++++++++++++++++++++++++++ .github/workflows/windows.yml | 6 +-- 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8efa86d28c..5a3f9a40da 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -183,6 +183,7 @@ jobs: if-no-files-found: 'error' genai_python_lib: + name: OpenVINO genai extension needs: [ openvino_download, openvino_build ] if: | always() && diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c0c570e24d..250610a709 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -234,3 +234,78 @@ jobs: python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools python -c "from openvino_genai import LLMPipeline" python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + + genai_package: + strategy: + matrix: + build-type: [Release, Debug] + needs: [ openvino_download, openvino_build ] + if: | + always() && + (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') + timeout-minutes: 30 + defaults: + run: + shell: bash + runs-on: macos-13 + env: + OV_INSTALL_DIR: ${{ github.workspace }}/ov + + steps: + - name: Clone openvino.genai + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' + + - name: Download OpenVINO package + uses: actions/download-artifact@v4 + with: + name: openvino_package + path: ${{ env.OV_INSTALL_DIR }} + + - name: Extract OpenVINO packages + run: | + pushd ${OV_INSTALL_DIR} + tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1 + popd + + - name: Build genai + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ + cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j + + - name: Test bindings + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${OV_INSTALL_DIR}/tools + python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${OV_INSTALL_DIR}/tools + optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR} + ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${OV_INSTALL_DIR}/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 + if: ${{ 'Release' != matrix.build-type }} + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + + - run: | + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 05b6d02cf1..dfe6fc3a7c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -233,7 +233,7 @@ jobs: - name: test bindings run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}/tools--upgrade-strategy eager + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}\\tools--upgrade-strategy eager python -m pytest ./tests/python_tests/test_generate_api.py -m precommit env: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. @@ -298,8 +298,8 @@ jobs: - name: Test bindings run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${{ env.OV_INSTALL_DIR }}/tools - python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}/tools + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${{ env.OV_INSTALL_DIR }}\\tools + python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}\\tools optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - run: | From b8dc3f11478c30fa12a08a0bc01a54b058d3f43b Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 15:31:53 +0200 Subject: [PATCH 18/63] fixed ci win and lin --- .github/workflows/linux.yml | 8 ++------ .github/workflows/windows.yml | 10 +++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5a3f9a40da..854838a9c8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -315,11 +315,7 @@ jobs: cmake --install ./samples\ build/ --config ${{ matrix.build-type }} --component samples_bin --prefix s\ pace if: ${{ 'Release' != matrix.build-type }} - - run: | - source ${OV_INSTALL_DIR}/setupvars.sh - timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - - run: | - source ${OV_INSTALL_DIR}/setupvars.sh - timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index dfe6fc3a7c..d16db9db55 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -232,8 +232,8 @@ jobs: - name: test bindings run: | - . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}\\tools--upgrade-strategy eager + . "${env.OV_INSTALL_DIR}/setupvars.ps1" + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${env:OV_INSTALL_DIR}/tools --upgrade-strategy eager python -m pytest ./tests/python_tests/test_generate_api.py -m precommit env: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. @@ -297,9 +297,9 @@ jobs: - name: Test bindings run: | - . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${{ env.OV_INSTALL_DIR }}\\tools - python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${{ env.OV_INSTALL_DIR }}\\tools + . "${env.OV_INSTALL_DIR}/setupvars.ps1" + python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${env:OV_INSTALL_DIR}/tools + python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${env:OV_INSTALL_DIR}/tools optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - run: | From 085865af84933e462d664385c50874d85b75ebc9 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 15:38:09 +0200 Subject: [PATCH 19/63] lock ov commit in macos --- .github/workflows/mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 250610a709..107753da05 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -15,7 +15,7 @@ concurrency: env: PYTHON_VERSION: '3.11' - OV_BRANCH: 'master' + OV_BRANCH: '4282043a9e38fb4fa3f6418f24bd061b736194c9' OV_TARBALL: '' permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions From 5051a18d7a8d7c9bce13deb94579f244632c6f99 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 16:05:43 +0200 Subject: [PATCH 20/63] fixed samples builds --- .github/workflows/linux.yml | 6 ++++-- .github/workflows/mac.yml | 6 ++++-- .github/workflows/windows.yml | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 854838a9c8..c0f6db58c1 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -303,10 +303,12 @@ jobs: python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${OV_INSTALL_DIR}/tools optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - - run: | + - name: Install samples + run: | source ${OV_INSTALL_DIR}/setupvars.sh cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR} - ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + + - run: ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - run: | diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 107753da05..409cbb7b53 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -288,10 +288,12 @@ jobs: python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${OV_INSTALL_DIR}/tools optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - - run: | + - name: Install samples + run: | source ${OV_INSTALL_DIR}/setupvars.sh cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR} - ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + + - run: ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d16db9db55..5edfe057a8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -302,10 +302,12 @@ jobs: python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${env:OV_INSTALL_DIR}/tools optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 - - run: | + - name: Install samples + run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${{ env.OV_INSTALL_DIR }} - ${{ env.OV_INSTALL_DIR }}\samples\cpp\build_samples.ps1 -i "${{ github.workspace }}/samples_install" + + - run: ${{ env.OV_INSTALL_DIR }}\samples\cpp\build_samples.ps1 -i "${{ github.workspace }}/samples_install" if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - run: | From c437859868ffdfb86d4463e4c546b74b2158c69b Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 16:12:31 +0200 Subject: [PATCH 21/63] fixed win pipelines --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5edfe057a8..c61819a39d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -232,7 +232,7 @@ jobs: - name: test bindings run: | - . "${env.OV_INSTALL_DIR}/setupvars.ps1" + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${env:OV_INSTALL_DIR}/tools --upgrade-strategy eager python -m pytest ./tests/python_tests/test_generate_api.py -m precommit env: @@ -297,7 +297,7 @@ jobs: - name: Test bindings run: | - . "${env.OV_INSTALL_DIR}/setupvars.ps1" + . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${env:OV_INSTALL_DIR}/tools python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${env:OV_INSTALL_DIR}/tools optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 From 7735c0db9f8cef1912bd6d9388166ec7eeaddf42 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 16:31:18 +0200 Subject: [PATCH 22/63] MACOSX_DEPLOYMENT_TARGET: '10.12' --- .github/workflows/mac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 409cbb7b53..6604a47b47 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -14,6 +14,7 @@ concurrency: cancel-in-progress: true env: + MACOSX_DEPLOYMENT_TARGET: '10.12' PYTHON_VERSION: '3.11' OV_BRANCH: '4282043a9e38fb4fa3f6418f24bd061b736194c9' OV_TARBALL: '' From 49ec45e71b21b42526532fbaab17389509035e86 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 10 Jul 2024 17:22:35 +0200 Subject: [PATCH 23/63] ci fixes --- .github/workflows/mac.yml | 6 +++--- .github/workflows/windows.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 6604a47b47..a772d47505 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -58,7 +58,7 @@ jobs: defaults: run: shell: bash - runs-on: 'macos-13-large' + runs-on: 'macos-12-large' env: CMAKE_BUILD_TYPE: 'Release' CMAKE_GENERATOR: 'Ninja Multi-Config' @@ -183,7 +183,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-13 + runs-on: macos-12 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov @@ -248,7 +248,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-13 + runs-on: macos-12 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c61819a39d..e278ea9706 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -195,6 +195,7 @@ jobs: env: OV_INSTALL_DIR: ${{ github.workspace }}\\ov + CMAKE_BUILD_PARALLEL_LEVEL: null steps: - name: Clone openvino.genai @@ -260,6 +261,7 @@ jobs: env: OV_INSTALL_DIR: ${{ github.workspace }}\\ov + CMAKE_BUILD_PARALLEL_LEVEL: null steps: - name: Clone openvino.genai From b1b86124b9ede2b39617e042fc918523f9ae5e4e Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 09:35:25 +0200 Subject: [PATCH 24/63] fixed smaples build --- samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt b/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt index 087c95bfc4..b026b32863 100644 --- a/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt +++ b/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt @@ -16,6 +16,10 @@ set_target_properties(prompt_lookup_decoding_lm PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON) target_compile_definitions(prompt_lookup_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}") target_compile_features(prompt_lookup_decoding_lm PRIVATE cxx_std_17) +if(APPLE) + # aligned deallocation is only available on macOS 10.14 or newer + target_compile_options(prompt_lookup_decoding_lm PRIVATE -fno-aligned-allocation) +endif() install(TARGETS prompt_lookup_decoding_lm RUNTIME DESTINATION samples_bin/ COMPONENT samples_bin From e47c83ad4ad170f25040a8763f468a05482f2ced Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 09:57:17 +0200 Subject: [PATCH 25/63] powershell call fix --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e278ea9706..691f3f83e2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -321,9 +321,9 @@ jobs: - run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - "${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm" .\TinyLlama-1.1B-Chat-v1.0\ "" + ${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm .\TinyLlama-1.1B-Chat-v1.0\ "" - run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python ${{ env.OV_INSTALL_DIR }}\samples\python\multinomial_causal_lm\multinomial_causal_lm.py .\TinyLlama-1.1B-Chat-v1.0\ 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only \ No newline at end of file + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only From 6590d36bf5ea78428d4dc27b33d2eaaf4ee116c8 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 10:02:46 +0200 Subject: [PATCH 26/63] one more sample build fix --- samples/cpp/speculative_decoding_lm/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/cpp/speculative_decoding_lm/CMakeLists.txt b/samples/cpp/speculative_decoding_lm/CMakeLists.txt index b30905bdb9..26ccceeceb 100644 --- a/samples/cpp/speculative_decoding_lm/CMakeLists.txt +++ b/samples/cpp/speculative_decoding_lm/CMakeLists.txt @@ -16,6 +16,10 @@ set_target_properties(speculative_decoding_lm PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON) target_compile_definitions(speculative_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}") target_compile_features(speculative_decoding_lm PRIVATE cxx_std_17) +if(APPLE) + # aligned deallocation is only available on macOS 10.14 or newer + target_compile_options(prompt_lookup_decoding_lm PRIVATE -fno-aligned-allocation) +endif() install(TARGETS speculative_decoding_lm RUNTIME DESTINATION samples_bin/ COMPONENT samples_bin From 4a00bb400454a4281e3a1c29dd1707784c472813 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 10:13:37 +0200 Subject: [PATCH 27/63] fixed target name --- samples/cpp/speculative_decoding_lm/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cpp/speculative_decoding_lm/CMakeLists.txt b/samples/cpp/speculative_decoding_lm/CMakeLists.txt index 26ccceeceb..80283b3b91 100644 --- a/samples/cpp/speculative_decoding_lm/CMakeLists.txt +++ b/samples/cpp/speculative_decoding_lm/CMakeLists.txt @@ -18,7 +18,7 @@ target_compile_definitions(speculative_decoding_lm PRIVATE OPENVINO_TOKENIZERS_P target_compile_features(speculative_decoding_lm PRIVATE cxx_std_17) if(APPLE) # aligned deallocation is only available on macOS 10.14 or newer - target_compile_options(prompt_lookup_decoding_lm PRIVATE -fno-aligned-allocation) + target_compile_options(speculative_decoding_lm PRIVATE -fno-aligned-allocation) endif() install(TARGETS speculative_decoding_lm RUNTIME DESTINATION samples_bin/ From d9df8d5d19e8244cb380ba17e929613352081f1a Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 10:25:15 +0200 Subject: [PATCH 28/63] macos 13 --- .github/workflows/mac.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index a772d47505..6604a47b47 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -58,7 +58,7 @@ jobs: defaults: run: shell: bash - runs-on: 'macos-12-large' + runs-on: 'macos-13-large' env: CMAKE_BUILD_TYPE: 'Release' CMAKE_GENERATOR: 'Ninja Multi-Config' @@ -183,7 +183,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-12 + runs-on: macos-13 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov @@ -248,7 +248,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-12 + runs-on: macos-13 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov From d00411270b65a81522303d8a0b9d908e59ef221b Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 12:37:31 +0200 Subject: [PATCH 29/63] switched back to 10.12 --- .github/workflows/mac.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 6604a47b47..d5d3bc2d46 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -1,4 +1,4 @@ -name: macOS (13, Python 3.11) +name: macOS (12, Python 3.8) on: workflow_dispatch: pull_request: @@ -15,7 +15,7 @@ concurrency: env: MACOSX_DEPLOYMENT_TARGET: '10.12' - PYTHON_VERSION: '3.11' + PYTHON_VERSION: '3.8' OV_BRANCH: '4282043a9e38fb4fa3f6418f24bd061b736194c9' OV_TARBALL: '' @@ -58,7 +58,7 @@ jobs: defaults: run: shell: bash - runs-on: 'macos-13-large' + runs-on: 'macos-12-large' env: CMAKE_BUILD_TYPE: 'Release' CMAKE_GENERATOR: 'Ninja Multi-Config' @@ -183,7 +183,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-13 + runs-on: macos-12 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov @@ -248,7 +248,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-13 + runs-on: macos-12 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov From 382888c99b6b6a1a0d4ceb63dd4e72b0a039f349 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 17:59:17 +0200 Subject: [PATCH 30/63] try another samples call --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 691f3f83e2..611c7d3d43 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -321,9 +321,9 @@ jobs: - run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - ${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm .\TinyLlama-1.1B-Chat-v1.0\ "" + ${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm TinyLlama-1.1B-Chat-v1.0 "" - run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - python ${{ env.OV_INSTALL_DIR }}\samples\python\multinomial_causal_lm\multinomial_causal_lm.py .\TinyLlama-1.1B-Chat-v1.0\ 0 + python ${{ env.OV_INSTALL_DIR }}\samples\python\multinomial_causal_lm\multinomial_causal_lm.py TinyLlama-1.1B-Chat-v1.0 0 if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only From 505fd30cadbff908e0d6094ca52f3a3577b56133 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 11 Jul 2024 18:03:48 +0200 Subject: [PATCH 31/63] removed deployment target --- .github/workflows/mac.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index d5d3bc2d46..3ac50f3bae 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -14,7 +14,6 @@ concurrency: cancel-in-progress: true env: - MACOSX_DEPLOYMENT_TARGET: '10.12' PYTHON_VERSION: '3.8' OV_BRANCH: '4282043a9e38fb4fa3f6418f24bd061b736194c9' OV_TARBALL: '' @@ -58,7 +57,7 @@ jobs: defaults: run: shell: bash - runs-on: 'macos-12-large' + runs-on: 'macos-13-large' env: CMAKE_BUILD_TYPE: 'Release' CMAKE_GENERATOR: 'Ninja Multi-Config' @@ -183,7 +182,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-12 + runs-on: macos-13 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov @@ -248,7 +247,7 @@ jobs: defaults: run: shell: bash - runs-on: macos-12 + runs-on: macos-13 env: OV_INSTALL_DIR: ${{ github.workspace }}/ov From 619815761adac646aeca217947d9537d7251f796 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 12 Jul 2024 09:18:43 +0200 Subject: [PATCH 32/63] Revert "removed deployment target" This reverts commit 87bc09a077d5bf2d0dc2541600dd20e0a82e6fc8. --- .github/workflows/mac.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 3ac50f3bae..16d1a5d6bb 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -57,8 +57,9 @@ jobs: defaults: run: shell: bash - runs-on: 'macos-13-large' + runs-on: 'macos-12-large' env: + MACOSX_DEPLOYMENT_TARGET: '10.12' CMAKE_BUILD_TYPE: 'Release' CMAKE_GENERATOR: 'Ninja Multi-Config' CMAKE_CXX_COMPILER_LAUNCHER: ccache From 2ac85a2a582a0c845f0e9c477d03b045b3e4366b Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 12 Jul 2024 09:37:34 +0200 Subject: [PATCH 33/63] Start-Process --- .github/workflows/windows.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 611c7d3d43..db54d3a8ef 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -309,21 +309,27 @@ jobs: . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${{ env.OV_INSTALL_DIR }} - - run: ${{ env.OV_INSTALL_DIR }}\samples\cpp\build_samples.ps1 -i "${{ github.workspace }}/samples_install" + - name: Build samples (${{ matrix.build-type }}) if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build + run: | + & ${{ env.OV_INSTALL_DIR }}\samples\cpp\build_samples.ps1 -i ${{ github.workspace }}/samples_install - - run: | + - name: Build samples (${{ matrix.build-type }}) + if: ${{ 'Release' != matrix.build-type }} + run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" 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 samples_install - if: ${{ 'Release' != matrix.build-type }} - - run: | + - name: Test C++ samples (greedy_causal_lm) + run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - ${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm TinyLlama-1.1B-Chat-v1.0 "" + Start-Process -FilePath "${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm.exe" -ArgumentList "TinyLlama-1.1B-Chat-v1.0 ''" - - run: | + - name: Test python samples (multinomial_causal_lm) + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only + run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python ${{ env.OV_INSTALL_DIR }}\samples\python\multinomial_causal_lm\multinomial_causal_lm.py TinyLlama-1.1B-Chat-v1.0 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only + From 4efccb0b37c4f83aff2401b938a3d842cc813636 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 12 Jul 2024 10:08:01 +0200 Subject: [PATCH 34/63] unlock ov branch on mac --- .github/workflows/mac.yml | 2 +- .github/workflows/windows.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 16d1a5d6bb..67033a16b5 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -15,7 +15,7 @@ concurrency: env: PYTHON_VERSION: '3.8' - OV_BRANCH: '4282043a9e38fb4fa3f6418f24bd061b736194c9' + OV_BRANCH: '' OV_TARBALL: '' permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index db54d3a8ef..b3fd760c05 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -309,16 +309,16 @@ jobs: . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${{ env.OV_INSTALL_DIR }} - - name: Build samples (${{ matrix.build-type }}) + - name: Build samples (Release) if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build run: | & ${{ env.OV_INSTALL_DIR }}\samples\cpp\build_samples.ps1 -i ${{ github.workspace }}/samples_install - - name: Build samples (${{ matrix.build-type }}) + - name: Build samples (Debug) if: ${{ 'Release' != matrix.build-type }} run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" - cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ov/samples/cpp/ -B "samples build" + cmake -DCMAKE_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 samples_install From d9065d1a9a9807e4df97e33a6644d0710392f745 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 12 Jul 2024 10:28:17 +0200 Subject: [PATCH 35/63] fixed typo --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b3fd760c05..726361f8e9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -239,7 +239,7 @@ jobs: env: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. - - name: test bindings from whell + - name: test bindings from weel run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install . --verbose From 08b954211fafa462316d15b1225025b09e5395a6 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 12 Jul 2024 15:11:13 +0200 Subject: [PATCH 36/63] enabled pytorch fe on mac --- .github/workflows/mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 67033a16b5..c23945fb09 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -128,7 +128,7 @@ jobs: -DENABLE_INTEL_NPU=OFF \ -DENABLE_OV_ONNX_FRONTEND=OFF \ -DENABLE_OV_PADDLE_FRONTEND=OFF \ - -DENABLE_OV_PYTORCH_FRONTEND=OFF \ + -DENABLE_OV_PYTORCH_FRONTEND=ON \ -DENABLE_OV_TF_FRONTEND=ON \ -DENABLE_OV_TF_LITE_FRONTEND=OFF \ -DENABLE_INTEL_GPU=OFF \ From 5f9472a23165f84b22c2d250333223bcc64558c3 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 12 Jul 2024 15:12:10 +0200 Subject: [PATCH 37/63] encreased timeot for win pipeline --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 726361f8e9..43d0b66c4d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -187,7 +187,7 @@ jobs: if: | always() && (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') - timeout-minutes: 25 + timeout-minutes: 45 defaults: run: shell: pwsh From 266e5cf39c27e610078f0f737622b0a247438090 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 10:27:52 +0200 Subject: [PATCH 38/63] name Linux steps --- .github/workflows/linux.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c0f6db58c1..eeade2adae 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -308,16 +308,26 @@ jobs: source ${OV_INSTALL_DIR}/setupvars.sh cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR} - - run: ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + - name: Build samples (Release) if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build + run: | + ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + - - run: | + - name: Build samples (Debug) + if: ${{ 'Release' != matrix.build-type }} + run: | source ${OV_INSTALL_DIR}/setupvars.sh cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${OV_INSTALL_DIR}/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 - if: ${{ 'Release' != matrix.build-type }} - - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + - name: Test C++ samples (greedy_causal_lm) + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - - run: source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + - name: Test python samples (multinomial_causal_lm) if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only + run: | + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 From f1c1a5ed859f6ff0262b970d263f6de06c63145d Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 10:31:04 +0200 Subject: [PATCH 39/63] named mac steps --- .github/workflows/mac.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c23945fb09..15c85f9fa5 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -294,21 +294,26 @@ jobs: source ${OV_INSTALL_DIR}/setupvars.sh cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR} - - run: ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace + - name: Build samples (Release) if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build + run: | + ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace - - run: | + - name: Build samples (Debug) + if: ${{ 'Release' != matrix.build-type }} + run: | source ${OV_INSTALL_DIR}/setupvars.sh cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${OV_INSTALL_DIR}/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 - if: ${{ 'Release' != matrix.build-type }} - - run: | + - name: Test C++ samples (greedy_causal_lm) + run: | source ${OV_INSTALL_DIR}/setupvars.sh timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - - run: | + - name: Test python samples (multinomial_causal_lm) + if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only + run: | source ${OV_INSTALL_DIR}/setupvars.sh timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only From 50cfb2894a6997333ac1c32bf04f6fea3ecc4f09 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 11:36:02 +0200 Subject: [PATCH 40/63] fixed test bash commands --- .github/workflows/linux.yml | 8 ++++---- .github/workflows/mac.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index eeade2adae..41922d7a8c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -323,11 +323,11 @@ jobs: - name: Test C++ samples (greedy_causal_lm) run: | - source ${OV_INSTALL_DIR}/setupvars.sh - timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s + ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - name: Test python samples (multinomial_causal_lm) if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only run: | - source ${OV_INSTALL_DIR}/setupvars.sh - timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s + ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 15c85f9fa5..e7d8895ebf 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -309,11 +309,11 @@ jobs: - name: Test C++ samples (greedy_causal_lm) run: | - source ${OV_INSTALL_DIR}/setupvars.sh - timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s + ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - name: Test python samples (multinomial_causal_lm) if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only run: | - source ${OV_INSTALL_DIR}/setupvars.sh - timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s + ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 From 216b7c6115d1f9913496aed14561ec8805d42664 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 12:19:00 +0200 Subject: [PATCH 41/63] mac build deps --- .github/workflows/mac.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index e7d8895ebf..3ab3ddb878 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -276,6 +276,9 @@ jobs: tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1 popd + - name: Install build dependencies + run: brew install coreutils scons + - name: Build genai run: | source ${OV_INSTALL_DIR}/setupvars.sh From f31a6144b0b6708681aa4c33e7d0f0e474434a20 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 12:43:49 +0200 Subject: [PATCH 42/63] fixed timeout args --- .github/workflows/linux.yml | 8 ++++---- .github/workflows/mac.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 41922d7a8c..eeade2adae 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -323,11 +323,11 @@ jobs: - name: Test C++ samples (greedy_causal_lm) run: | - source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s - ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - name: Test python samples (multinomial_causal_lm) if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only run: | - source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s - ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 3ab3ddb878..260f3fcb6b 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -312,11 +312,11 @@ jobs: - name: Test C++ samples (greedy_causal_lm) run: | - source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s - ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - name: Test python samples (multinomial_causal_lm) if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only run: | - source ${OV_INSTALL_DIR}/setupvars.sh && timeout 25s - ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + source ${OV_INSTALL_DIR}/setupvars.sh + timeout 25s ${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 From 4d31d5a0f0baf2269cadedb17c9955ce83c6aaf4 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 13:41:52 +0200 Subject: [PATCH 43/63] enabled skipped tests --- tests/python_tests/test_generate_api.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/python_tests/test_generate_api.py b/tests/python_tests/test_generate_api.py index b4e275eef2..bca493b778 100644 --- a/tests/python_tests/test_generate_api.py +++ b/tests/python_tests/test_generate_api.py @@ -220,13 +220,6 @@ def test_genai_tokenizer_encode(model_descr, prompt): @pytest.mark.parametrize("model_descr", get_models_list()) @pytest.mark.parametrize("encoded_prompt", encoded_prompts) @pytest.mark.precommit -@pytest.mark.nightly -@pytest.mark.xfail( - raises=TypeError, - reason="pybind was unable to find ov::Tensor from openvino yet", - strict=False, - condition=sys.platform in ["linux", "win32"] -) def test_genai_tokenizer_decode(model_descr, encoded_prompt): model_id, path, tokenizer, model, pipe = read_model(model_descr) tok = pipe.get_tokenizer() From 331ab926d44db622ea3bce1fc6d3f087a6a1fbd7 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 14:21:17 +0200 Subject: [PATCH 44/63] use ccache --- .github/workflows/linux.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index eeade2adae..710a0b46fb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -262,6 +262,10 @@ jobs: env: CMAKE_BUILD_PARALLEL_LEVEL: null OV_INSTALL_DIR: ${{ github.workspace }}/ov + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_MAXSIZE: 500Mi + CMAKE_CXX_COMPILER_LAUNCHER: ccache + CMAKE_C_COMPILER_LAUNCHER: ccache steps: - name: Clone openvino.genai @@ -290,6 +294,15 @@ jobs: - name: Install build dependencies run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh + - name: Setup ccache + uses: actions/cache@v4 + with: + save-always: true + path: ${{ env.CCACHE_DIR }} + key: ${{ runner.os }}-${{ runner.arch }}-ccache-genai-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-ccache-genai + - name: Build genai run: | source ${OV_INSTALL_DIR}/setupvars.sh From dd8151dcfe574db305eb4fb98b286beb28022b02 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 14:35:20 +0200 Subject: [PATCH 45/63] install ccache --- .github/workflows/linux.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 710a0b46fb..0163e87c8f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -291,8 +291,17 @@ jobs: tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1 popd + - name: Set apt + run: | + echo 'Acquire::Retries "10";' > /etc/apt/apt.conf > /dev/null + echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf > /dev/null + echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf > /dev/null + echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf > /dev/null + - name: Install build dependencies - run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh + run: | + sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh + sudo apt-get install ccache - name: Setup ccache uses: actions/cache@v4 From d18310c1b8ec7c4b95564e83b59fa9108d6f75d0 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 14:53:48 +0200 Subject: [PATCH 46/63] fixed apt config --- .github/workflows/linux.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0163e87c8f..661d67513b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -293,10 +293,10 @@ jobs: - name: Set apt run: | - echo 'Acquire::Retries "10";' > /etc/apt/apt.conf > /dev/null - echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf > /dev/null - echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf > /dev/null - echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf > /dev/null + echo 'Acquire::Retries "10";' | sudo tee -a /etc/apt/apt.conf.d/80-retries > /dev/null + echo 'APT::Get::Assume-Yes "true";' | sudo tee -a /etc/apt/apt.conf.d/81-assume-yes > /dev/null + echo 'APT::Get::Fix-Broken "true";' | sudo tee -a /etc/apt/apt.conf.d/82-fix-broken > /dev/null + echo 'APT::Get::no-install-recommends "true"' | sudo tee -a /etc/apt/apt.conf.d/83-no-reommends > /dev/null - name: Install build dependencies run: | From be20fd1467e2f7913c3575da37f8676858943d37 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 15:23:27 +0200 Subject: [PATCH 47/63] apt conf fix --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 661d67513b..c2e4e0c5bd 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -296,7 +296,7 @@ jobs: echo 'Acquire::Retries "10";' | sudo tee -a /etc/apt/apt.conf.d/80-retries > /dev/null echo 'APT::Get::Assume-Yes "true";' | sudo tee -a /etc/apt/apt.conf.d/81-assume-yes > /dev/null echo 'APT::Get::Fix-Broken "true";' | sudo tee -a /etc/apt/apt.conf.d/82-fix-broken > /dev/null - echo 'APT::Get::no-install-recommends "true"' | sudo tee -a /etc/apt/apt.conf.d/83-no-reommends > /dev/null + echo 'APT::Get::no-install-recommends "true";' | sudo tee -a /etc/apt/apt.conf.d/83-no-reсommends > /dev/null - name: Install build dependencies run: | From 6e5b1d29255511477f44e16bfee13dd33eb9c84e Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 15 Jul 2024 17:16:56 +0200 Subject: [PATCH 48/63] renamed cache --- .github/workflows/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c2e4e0c5bd..2008b5524a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -308,9 +308,9 @@ jobs: with: save-always: true path: ${{ env.CCACHE_DIR }} - key: ${{ runner.os }}-${{ runner.arch }}-ccache-genai-${{ github.sha }} + key: ${{ runner.os }}-${{ runner.arch }}-ccache-genai-${{ matrix.build-type }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-ccache-genai + ${{ runner.os }}-${{ runner.arch }}-ccache-genai-${{ matrix.build-type }} - name: Build genai run: | From db59631fddfd28475d66f3b7b4dcbc56b1135753 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Tue, 16 Jul 2024 11:12:38 +0200 Subject: [PATCH 49/63] ccache for lib --- .github/workflows/linux.yml | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2008b5524a..1540622dbe 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -69,8 +69,12 @@ jobs: BUILD_DIR: ${{ github.workspace }}/openvino/build steps: - - name: Set apt retries - run: echo 'Acquire::Retries "10";' | sudo tee -a /etc/apt/apt.conf.d/80-retries > /dev/null + - name: Set apt + run: | + echo 'Acquire::Retries "10";' | sudo tee -a /etc/apt/apt.conf.d/80-retries > /dev/null + echo 'APT::Get::Assume-Yes "true";' | sudo tee -a /etc/apt/apt.conf.d/81-assume-yes > /dev/null + echo 'APT::Get::Fix-Broken "true";' | sudo tee -a /etc/apt/apt.conf.d/82-fix-broken > /dev/null + echo 'APT::Get::no-install-recommends "true";' | sudo tee -a /etc/apt/apt.conf.d/83-no-reсommends > /dev/null - name: Install git run: | @@ -198,6 +202,10 @@ jobs: CMAKE_GENERATOR: Unix Makefiles CMAKE_BUILD_PARALLEL_LEVEL: null OV_INSTALL_DIR: ${{ github.workspace }}/ov + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_MAXSIZE: 500Mi + CMAKE_CXX_COMPILER_LAUNCHER: ccache + CMAKE_C_COMPILER_LAUNCHER: ccache steps: - name: Clone openvino.genai @@ -223,8 +231,26 @@ jobs: tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1 popd + - name: Set apt + run: | + echo 'Acquire::Retries "10";' | sudo tee -a /etc/apt/apt.conf.d/80-retries > /dev/null + echo 'APT::Get::Assume-Yes "true";' | sudo tee -a /etc/apt/apt.conf.d/81-assume-yes > /dev/null + echo 'APT::Get::Fix-Broken "true";' | sudo tee -a /etc/apt/apt.conf.d/82-fix-broken > /dev/null + echo 'APT::Get::no-install-recommends "true";' | sudo tee -a /etc/apt/apt.conf.d/83-no-reсommends > /dev/null + - name: Install build dependencies - run: sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh + run: | + sudo ${OV_INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh + sudo apt-get install ccache + + - name: Setup ccache + uses: actions/cache@v4 + with: + save-always: true + path: ${{ env.CCACHE_DIR }} + key: ${{ runner.os }}-${{ runner.arch }}-ccache-genai-Release-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-ccache-genai-Release - name: Build genai run: | From 593f415d53b7659326315e3ea1f16471c34fb582 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Tue, 16 Jul 2024 11:21:43 +0200 Subject: [PATCH 50/63] removed old pipelines --- .github/workflows/genai_package.yml | 118 ------------------------- .github/workflows/genai_python_lib.yml | 88 ------------------ .github/workflows/linux.yml | 4 +- .github/workflows/mac.yml | 4 +- thirdparty/openvino_tokenizers | 2 +- 5 files changed, 5 insertions(+), 211 deletions(-) delete mode 100644 .github/workflows/genai_package.yml delete mode 100644 .github/workflows/genai_python_lib.yml diff --git a/.github/workflows/genai_package.yml b/.github/workflows/genai_package.yml deleted file mode 100644 index d89ad2097b..0000000000 --- a/.github/workflows/genai_package.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: genai_package -on: pull_request -permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true -env: - 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 - 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 - 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 -jobs: - ubuntu_genai_package: - strategy: - matrix: - build-type: [Release, Debug] - runs-on: ubuntu-20.04 - env: - CMAKE_BUILD_PARALLEL_LEVEL: null - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - run: mkdir ./ov/ - - run: curl ${{ env.l_ov_link }} | tar --directory ./ov/ --strip-components 1 -xz - - run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh - - run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ - - run: source ./ov/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j - - run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly - - 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 - - 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 - - run: source ./ov/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov - - run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace - if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - - 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 - if: ${{ 'Release' != matrix.build-type }} - - run: source ./ov/setupvars.sh && timeout 25s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - - run: source ./ov/setupvars.sh && timeout 25s ./ov/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only - - macos_genai_package: - strategy: - matrix: - build-type: [Release, Debug] - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - run: mkdir ./ov/ - - run: curl ${{ env.m_ov_link }} | tar --directory ./ov/ --strip-components 1 -xz - - run: brew install coreutils scons - - run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ - - run: source ./ov/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j - - run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly - - 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 - - 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 - - run: source ./ov/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov - - run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace - if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - - 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 - if: ${{ 'Release' != matrix.build-type }} - - run: source ./ov/setupvars.sh && timeout 30s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" - - run: source ./ov/setupvars.sh && timeout 25s ./ov/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only - - windows_genai_package: - strategy: - matrix: - build-type: [Release, Debug] - runs-on: windows-latest - env: - CMAKE_BUILD_PARALLEL_LEVEL: null - PYTHONIOENCODING: "utf8" - defaults: - run: - shell: cmd - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - run: > - curl --output ov.zip ${{ env.w_ov_link }} - && unzip -d ov ov.zip - && dirs=(ov/*) - && mv ov/*/* ov - && rmdir "${dirs[@]}" - shell: bash - - run: call ov\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ - - run: call ov\setupvars.bat && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j - - run: call ov\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly - - 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 - - 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 - - run: call ov\setupvars.bat && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov - - run: call ov\samples\cpp\build_samples_msvc.bat -i "${{ github.workspace }}/samples_install" - if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build - - run: > - call ov\setupvars.bat - && 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 samples_install - if: ${{ 'Release' != matrix.build-type }} - - run: call ov\setupvars.bat && "${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm" .\TinyLlama-1.1B-Chat-v1.0\ "" - if: ${{ 'Release' == matrix.build-type }} # Tokenizers don't work in debug - - run: call ov\setupvars.bat && python .\ov\samples\python\multinomial_causal_lm\multinomial_causal_lm.py .\TinyLlama-1.1B-Chat-v1.0\ 0 - if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only diff --git a/.github/workflows/genai_python_lib.yml b/.github/workflows/genai_python_lib.yml deleted file mode 100644 index 58e340a5b9..0000000000 --- a/.github/workflows/genai_python_lib.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: genai_python_lib -on: pull_request -permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true -env: - 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 - 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 - 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 -jobs: - ubuntu_genai_python_lib: - # A tokenizers' dependency fails to compile on ubuntu-20 n CenOS7 env. - runs-on: ubuntu-22.04-16-cores - env: - # A tokenizers' dependency fails to compile with Ninja in CenOS7 env. - CMAKE_GENERATOR: Unix Makefiles - CMAKE_BUILD_PARALLEL_LEVEL: null - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - run: mkdir ./ov/ - # Install CentOS7 instead of Ubuntu to match PyPI distribution ABI. - - run: curl ${{ env.l_ov_centos_link }} | tar --directory ./ov/ --strip-components 1 -xz - - run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh - - run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ - - run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j - - 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 - - run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/ - - run: source ./ov/setupvars.sh && python -m pip install . --verbose - - run: python -m pytest ./tests/python_tests/ - - macos_genai_python_lib: - runs-on: macos-12 - env: - # A tokenizers' dependency fails to compile with Ninja. - CMAKE_GENERATOR: Unix Makefiles - CMAKE_BUILD_PARALLEL_LEVEL: null - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - run: mkdir ./ov/ - - run: curl ${{ env.m_ov_link }} | tar --directory ./ov/ --strip-components 1 -xz - - run: brew install coreutils scons - - run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ - - run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j - - 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 - - run: source ./ov/setupvars.sh && PYTHONPATH=./build/:$PYTHONPATH python -m pytest ./tests/python_tests/ - - run: source ./ov/setupvars.sh && python -m pip install . --verbose - - run: python -c "from openvino_genai import LLMPipeline" - - run: python -m pytest ./tests/python_tests/ - - windows_genai_python_lib: - runs-on: windows-latest - env: - CMAKE_BUILD_PARALLEL_LEVEL: null - PYTHONIOENCODING: "utf8" - defaults: - run: - shell: cmd - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Install OpenVINO - run: | - curl --output ov.zip ${{ env.w_ov_link }} - unzip -d ov ov.zip - dirs=(ov/*) && mv ov/*/* ov && rmdir "${dirs[@]}" - shell: bash - - run: call ./ov/setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ - - run: call ./ov/setupvars.bat && cmake --build ./build/ --config Release -j - - 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 - # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. - - run: set "PYTHONPATH=./build/" && call ./ov/setupvars.bat && python -m pytest ./tests/python_tests/ - - run: call ./ov/setupvars.bat && python -m pip install . --verbose - - run: python -m pytest ./tests/python_tests/ diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1540622dbe..1f5c22fe4b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -262,7 +262,7 @@ jobs: run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/tools --upgrade-strategy eager - python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + python -m pytest ./tests/python_tests env: PYTHONPATH: "./build/:$PYTHONPATH" @@ -270,7 +270,7 @@ jobs: run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools - python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + python -m pytest ./tests/python_tests genai_package: strategy: diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 260f3fcb6b..34da7b2895 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -225,7 +225,7 @@ jobs: run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/tools --upgrade-strategy eager - python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + python -m pytest ./tests/python_tests/ env: PYTHONPATH: "./build/:$PYTHONPATH" @@ -234,7 +234,7 @@ jobs: source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools python -c "from openvino_genai import LLMPipeline" - python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + python -m pytest ./tests/python_tests/ genai_package: strategy: diff --git a/thirdparty/openvino_tokenizers b/thirdparty/openvino_tokenizers index b89d05b757..738a190e69 160000 --- a/thirdparty/openvino_tokenizers +++ b/thirdparty/openvino_tokenizers @@ -1 +1 @@ -Subproject commit b89d05b757e45df056b86f1041f6bfeb70d863b6 +Subproject commit 738a190e69202a70e04ecec4033e175ad13a581b From 7fec3995694cebd2ae46353f480fa531e0eec8bd Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Tue, 16 Jul 2024 12:20:10 +0200 Subject: [PATCH 51/63] increased timeouts --- .github/workflows/linux.yml | 2 +- .github/workflows/windows.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1f5c22fe4b..9e907ee60f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -192,7 +192,7 @@ jobs: if: | always() && (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') - timeout-minutes: 30 + timeout-minutes: 45 defaults: run: shell: bash diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 43d0b66c4d..a797543257 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -235,7 +235,7 @@ jobs: run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${env:OV_INSTALL_DIR}/tools --upgrade-strategy eager - python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + python -m pytest ./tests/python_tests/ env: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. @@ -243,7 +243,7 @@ jobs: run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install . --verbose - python -m pytest ./tests/python_tests/test_generate_api.py -m precommit + python -m pytest ./tests/python_tests/ genai_package: strategy: @@ -253,7 +253,7 @@ jobs: if: | always() && (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') - timeout-minutes: 30 + timeout-minutes: 60 defaults: run: shell: pwsh From b8e29ab2bdfe67a4638355bdd59888df562e7155 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Tue, 16 Jul 2024 14:52:51 +0200 Subject: [PATCH 52/63] increase timeouts --- .github/workflows/linux.yml | 4 ++-- .github/workflows/mac.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9e907ee60f..a9b96d0e61 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -192,7 +192,7 @@ jobs: if: | always() && (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') - timeout-minutes: 45 + timeout-minutes: 60 defaults: run: shell: bash @@ -280,7 +280,7 @@ jobs: if: | always() && (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') - timeout-minutes: 30 + timeout-minutes: 60 defaults: run: shell: bash diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 34da7b2895..41544532d2 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -179,7 +179,7 @@ jobs: if: | always() && (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') - timeout-minutes: 25 + timeout-minutes: 60 defaults: run: shell: bash diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a797543257..cd8b371dec 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -187,7 +187,7 @@ jobs: if: | always() && (needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success') - timeout-minutes: 45 + timeout-minutes: 60 defaults: run: shell: pwsh From 61f2b2184cfe7ba1bfaab659e5d539d53d653c98 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 31 Jul 2024 15:02:03 +0300 Subject: [PATCH 53/63] reverted wa to support 10.12 deployment target --- .github/workflows/mac.yml | 1 + samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt | 5 +---- samples/cpp/speculative_decoding_lm/CMakeLists.txt | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 41544532d2..e1f62a1368 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -187,6 +187,7 @@ jobs: env: OV_INSTALL_DIR: ${{ github.workspace }}/ov + MACOSX_DEPLOYMENT_TARGET: '11.0' steps: - name: Clone openvino.genai diff --git a/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt b/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt index b026b32863..1dbf655df9 100644 --- a/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt +++ b/samples/cpp/prompt_lookup_decoding_lm/CMakeLists.txt @@ -16,10 +16,7 @@ set_target_properties(prompt_lookup_decoding_lm PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON) target_compile_definitions(prompt_lookup_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}") target_compile_features(prompt_lookup_decoding_lm PRIVATE cxx_std_17) -if(APPLE) - # aligned deallocation is only available on macOS 10.14 or newer - target_compile_options(prompt_lookup_decoding_lm PRIVATE -fno-aligned-allocation) -endif() + install(TARGETS prompt_lookup_decoding_lm RUNTIME DESTINATION samples_bin/ COMPONENT samples_bin diff --git a/samples/cpp/speculative_decoding_lm/CMakeLists.txt b/samples/cpp/speculative_decoding_lm/CMakeLists.txt index 80283b3b91..732301aca1 100644 --- a/samples/cpp/speculative_decoding_lm/CMakeLists.txt +++ b/samples/cpp/speculative_decoding_lm/CMakeLists.txt @@ -16,10 +16,7 @@ set_target_properties(speculative_decoding_lm PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON) target_compile_definitions(speculative_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH="${OPENVINO_TOKENIZERS_PATH}") target_compile_features(speculative_decoding_lm PRIVATE cxx_std_17) -if(APPLE) - # aligned deallocation is only available on macOS 10.14 or newer - target_compile_options(speculative_decoding_lm PRIVATE -fno-aligned-allocation) -endif() + install(TARGETS speculative_decoding_lm RUNTIME DESTINATION samples_bin/ COMPONENT samples_bin From 421ff386aebf7da9bb72b9060f3a3af690062698 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 31 Jul 2024 16:07:42 +0300 Subject: [PATCH 54/63] review fixes --- .github/workflows/linux.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a9b96d0e61..f2ea9aba2e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -268,7 +268,6 @@ jobs: - name: test bindings (wheel) run: | - source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools python -m pytest ./tests/python_tests @@ -344,7 +343,7 @@ jobs: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j - - name: Test bindings + - name: Build and Install dependencies run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${OV_INSTALL_DIR}/tools From 8a625fcd1dbece9ad04a2d003e67b0037977f18b Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 11:41:20 +0300 Subject: [PATCH 55/63] added job names --- .github/workflows/linux.yml | 6 ++++-- .github/workflows/mac.yml | 7 +++++-- .github/workflows/windows.yml | 14 +++++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f2ea9aba2e..d16634dd10 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -22,6 +22,7 @@ permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8 jobs: openvino_download: + name: Download OpenVINO package outputs: status: ${{ steps.openvino_download.outcome }} timeout-minutes: 10 @@ -51,6 +52,7 @@ jobs: if-no-files-found: 'error' openvino_build: + name: Build OpenVINO package needs: [openvino_download] if: needs.openvino_download.outputs.status != 'success' timeout-minutes: 150 @@ -187,7 +189,7 @@ jobs: if-no-files-found: 'error' genai_python_lib: - name: OpenVINO genai extension + name: OpenVINO genai extension (cmake + wheel) needs: [ openvino_download, openvino_build ] if: | always() && @@ -272,6 +274,7 @@ jobs: python -m pytest ./tests/python_tests genai_package: + name: OpenVINO genai extension (install to OpenVINO package) strategy: matrix: build-type: [Release, Debug] @@ -360,7 +363,6 @@ jobs: run: | ${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace - - name: Build samples (Debug) if: ${{ 'Release' != matrix.build-type }} run: | diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index e1f62a1368..842f113448 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -22,6 +22,7 @@ permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8 jobs: openvino_download: + name: Download OpenVINO package outputs: status: ${{ steps.openvino_download.outcome }} timeout-minutes: 10 @@ -51,6 +52,7 @@ jobs: if-no-files-found: 'error' openvino_build: + name: Build OpenVINO package needs: [openvino_download] if: needs.openvino_download.outputs.status != 'success' timeout-minutes: 150 @@ -174,7 +176,7 @@ jobs: if-no-files-found: 'error' genai_python_lib: - name: OpenVINO genai extension + name: OpenVINO genai extension (cmake + wheel) needs: [ openvino_download, openvino_build ] if: | always() && @@ -238,6 +240,7 @@ jobs: python -m pytest ./tests/python_tests/ genai_package: + name: OpenVINO genai extension (install to OpenVINO package) strategy: matrix: build-type: [Release, Debug] @@ -286,7 +289,7 @@ jobs: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j - - name: Test bindings + - name: Build and Install dependencies run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${OV_INSTALL_DIR}/tools diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cd8b371dec..d8e8a2bbd3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -22,6 +22,7 @@ permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8 jobs: openvino_download: + name: Download OpenVINO package outputs: status: ${{ steps.openvino_download.outcome }} timeout-minutes: 10 @@ -51,6 +52,7 @@ jobs: if-no-files-found: 'error' openvino_build: + name: Build OpenVINO package needs: [openvino_download] if: needs.openvino_download.outputs.status != 'success' timeout-minutes: 150 @@ -183,6 +185,7 @@ jobs: if-no-files-found: 'error' genai_python_lib: + name: OpenVINO genai extension (cmake + wheel) needs: [ openvino_download, openvino_build ] if: | always() && @@ -225,13 +228,13 @@ jobs: - name: Configure Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - - name: build gen_ai + - name: Build genai libs run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ cmake --build ./build/ --config Release -j - - name: test bindings + - name: Test bindings run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${env:OV_INSTALL_DIR}/tools --upgrade-strategy eager @@ -239,13 +242,14 @@ jobs: env: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. - - name: test bindings from weel + - name: Test bindings from weel run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install . --verbose python -m pytest ./tests/python_tests/ genai_package: + name: OpenVINO genai extension (install to OpenVINO package) strategy: matrix: build-type: [Release, Debug] @@ -291,13 +295,13 @@ jobs: - name: Configure Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - - name: Build gen_ai + - name: Build genai libs run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j - - name: Test bindings + - name: Build and Install dependencies run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${env:OV_INSTALL_DIR}/tools From 295d934e8de5150cb2f920a213a34bde7d8bf3cf Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 12:09:26 +0300 Subject: [PATCH 56/63] reverted until we switch to ov wheel in the build --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d16634dd10..f53ed8cd50 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -270,6 +270,7 @@ jobs: - name: test bindings (wheel) run: | + source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools python -m pytest ./tests/python_tests From 60ace2152ff31c63ab0dc14a5f6b8facc4b35b82 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 12:12:37 +0300 Subject: [PATCH 57/63] aligned the names --- .github/workflows/linux.yml | 4 ++-- .github/workflows/mac.yml | 4 ++-- .github/workflows/windows.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f53ed8cd50..4d618a3321 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -260,7 +260,7 @@ jobs: cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ cmake --build ./build/ --config Release -j - - name: test bindings + - name: Test bindings run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/tools --upgrade-strategy eager @@ -268,7 +268,7 @@ jobs: env: PYTHONPATH: "./build/:$PYTHONPATH" - - name: test bindings (wheel) + - name: Test bindings (wheel) run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 842f113448..ed0263a4a3 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -224,7 +224,7 @@ jobs: cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ cmake --build ./build/ --config Release -j - - name: test bindings + - name: Test bindings run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/tools --upgrade-strategy eager @@ -232,7 +232,7 @@ jobs: env: PYTHONPATH: "./build/:$PYTHONPATH" - - name: test bindings (wheel) + - name: Test bindings (wheel) run: | source ${OV_INSTALL_DIR}/setupvars.sh python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/tools diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d8e8a2bbd3..f1cdebb882 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -242,7 +242,7 @@ jobs: env: PYTHONPATH: "./build/" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that. - - name: Test bindings from weel + - name: Test bindings (wheel) run: | . "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" python -m pip install . --verbose From fc8f9835a9259c3e8a2bb0f723aa96e68435794d Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 12:55:27 +0300 Subject: [PATCH 58/63] removed todos --- .github/workflows/linux.yml | 3 +-- .github/workflows/mac.yml | 3 +-- .github/workflows/windows.yml | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4d618a3321..169826c310 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -120,8 +120,7 @@ jobs: max-size: "2000M" # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push - # save: ${{ github.ref_name == 'master' && 'true' || 'false' }} - save: true # TODO: remove before merge + save: ${{ github.ref_name == 'master' && 'true' || 'false' }} verbose: 2 key: linux-ubuntu restore-keys: | diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index ed0263a4a3..4b7eb6401a 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -107,8 +107,7 @@ jobs: max-size: "2000M" # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push - #save: ${{ github.ref_name == 'master' && 'true' || 'false' }} - save: 'true' # TODO: remove before merge + save: ${{ github.ref_name == 'master' && 'true' || 'false' }} verbose: 2 key: ccache-mac restore-keys: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f1cdebb882..b7b16bad1d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -113,8 +113,7 @@ jobs: max-size: "2000M" # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push - #save: ${{ github.ref_name == 'master' && 'true' || 'false' }} - save: 'true' # TODO: remove before merge + save: ${{ github.ref_name == 'master' && 'true' || 'false' }} verbose: 2 key: ccache-windows restore-keys: | From 2465659cd305bbda300427662533d63c4dbdae65 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 17:03:36 +0300 Subject: [PATCH 59/63] Update .github/workflows/linux.yml Co-authored-by: Zlobin Vladimir --- .github/workflows/linux.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 169826c310..548ebf67cd 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -78,11 +78,6 @@ jobs: echo 'APT::Get::Fix-Broken "true";' | sudo tee -a /etc/apt/apt.conf.d/82-fix-broken > /dev/null echo 'APT::Get::no-install-recommends "true";' | sudo tee -a /etc/apt/apt.conf.d/83-no-reсommends > /dev/null - - name: Install git - run: | - sudo apt-get update - sudo apt-get install --assume-yes --no-install-recommends git ca-certificates - - name: Clone OpenVINO uses: actions/checkout@v4 with: From 4020448d4f6c868c97cbc72d15fe54ea78d782ab Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 17:03:48 +0300 Subject: [PATCH 60/63] Update .github/workflows/linux.yml Co-authored-by: Zlobin Vladimir --- .github/workflows/linux.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 548ebf67cd..14334b3202 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -142,7 +142,6 @@ jobs: -DENABLE_OV_TF_LITE_FRONTEND=OFF \ -DENABLE_INTEL_GPU=OFF \ -DENABLE_INTEL_NPU=OFF \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DENABLE_PYTHON=ON \ From b0c465842f067b319e3b99f7daad6829dd16d6a6 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 17:03:56 +0300 Subject: [PATCH 61/63] Update .github/workflows/linux.yml Co-authored-by: Zlobin Vladimir --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 14334b3202..991728bfc9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -146,6 +146,7 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DENABLE_PYTHON=ON \ -DENABLE_WHEEL=ON \ + -DENABLE_FASTER_BUILD=ON \ -S ${OPENVINO_REPO} \ -B ${BUILD_DIR} From 2bb141687b29a90e757444677393459fdf7a0d91 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 1 Aug 2024 19:28:48 +0300 Subject: [PATCH 62/63] use gha cache action for ccache --- .github/workflows/linux.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 169826c310..f617f2d5c0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -69,6 +69,8 @@ jobs: OPENVINO_REPO: ${{ github.workspace }}/openvino INSTALL_DIR: ${{ github.workspace }}/openvino/install BUILD_DIR: ${{ github.workspace }}/openvino/build + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_MAXSIZE: 2000Mi steps: - name: Set apt @@ -98,6 +100,7 @@ jobs: - name: Install build dependencies run: | sudo -E ${OPENVINO_REPO}/install_build_dependencies.sh + sudo apt-get install ccache - name: Setup Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v5 @@ -115,16 +118,15 @@ jobs: # - name: Setup ccache - uses: hendrikmuhs/ccache-action@v1.2 + uses: actions/cache@v4 with: - max-size: "2000M" # Should save cache only if run in the master branch of the base repo # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push - save: ${{ github.ref_name == 'master' && 'true' || 'false' }} - verbose: 2 - key: linux-ubuntu + save-always: ${{ github.ref_name == 'master' && 'true' || 'false' }} + path: ${{ env.CCACHE_DIR }} + key: ${{ runner.os }}-${{ runner.arch }}-ccache-ov-${{ github.sha }} restore-keys: | - linux-ubuntu + ${{ runner.os }}-${{ runner.arch }}-ccache-ov - name: CMake configure - OpenVINO run: | @@ -247,11 +249,13 @@ jobs: - name: Setup ccache uses: actions/cache@v4 with: - save-always: true + # Should save cache only if run in the master branch of the base repo + # github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push + save-always: ${{ github.ref_name == 'master' && 'true' || 'false' }} path: ${{ env.CCACHE_DIR }} - key: ${{ runner.os }}-${{ runner.arch }}-ccache-genai-Release-${{ github.sha }} + key: ${{ runner.os }}-${{ runner.arch }}-ccache-genai-release-${{ github.sha }} restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-ccache-genai-Release + ${{ runner.os }}-${{ runner.arch }}-ccache-genai-release - name: Build genai run: | From ee0effe43d5715f5a53a50c485bb05ffeda67e1b Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Fri, 2 Aug 2024 13:51:05 +0300 Subject: [PATCH 63/63] revert tokenizers --- thirdparty/openvino_tokenizers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/openvino_tokenizers b/thirdparty/openvino_tokenizers index 738a190e69..b89d05b757 160000 --- a/thirdparty/openvino_tokenizers +++ b/thirdparty/openvino_tokenizers @@ -1 +1 @@ -Subproject commit 738a190e69202a70e04ecec4033e175ad13a581b +Subproject commit b89d05b757e45df056b86f1041f6bfeb70d863b6