macOS ARM64 (Python 3.11) #226
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS ARM64 (Python 3.11) | |
on: | |
workflow_dispatch: | |
schedule: | |
# at 00:00 on workdays | |
- cron: '0 0 * * 1,2,3,4,5' | |
#pull_request: | |
# paths-ignore: | |
# - '**/docs/**' | |
# - 'docs/**' | |
# - '**/**.md' | |
# - '**.md' | |
# - '**/layer_tests_summary/**' | |
# - '**/conformance/**' | |
#push: | |
# paths-ignore: | |
# - '**/docs/**' | |
# - 'docs/**' | |
# - '**/**.md' | |
# - '**.md' | |
# - '**/layer_tests_summary/**' | |
# - '**/conformance/**' | |
# branches: | |
# - master | |
# - 'releases/**' | |
concurrency: | |
# github.ref is not unique in post-commit | |
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-mac-arm64 | |
cancel-in-progress: true | |
permissions: read-all | |
env: | |
PYTHON_VERSION: '3.11' | |
jobs: | |
Smart_CI: | |
runs-on: ubuntu-latest | |
outputs: | |
affected_components: "${{ steps.smart_ci.outputs.affected_components }}" | |
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}" | |
steps: | |
- name: checkout action | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
sparse-checkout: .github/actions/smart-ci | |
- name: Get affected components | |
id: smart_ci | |
uses: ./.github/actions/smart-ci | |
with: | |
repository: ${{ github.repository }} | |
pr: ${{ github.event.number }} | |
commit_sha: ${{ github.sha }} | |
ref_name: ${{ github.ref_name }} | |
component_pattern: "category: (.*)" | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
skip_when_only_listed_labels_set: 'docs' | |
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg' | |
Build: | |
needs: Smart_CI | |
timeout-minutes: 150 | |
defaults: | |
run: | |
shell: bash | |
runs-on: 'macos-13-xlarge' | |
env: | |
CMAKE_BUILD_TYPE: 'Release' | |
CMAKE_GENERATOR: 'Ninja Multi-Config' | |
MACOSX_DEPLOYMENT_TARGET: '11.0' | |
CMAKE_CXX_COMPILER_LAUNCHER: ccache | |
CMAKE_C_COMPILER_LAUNCHER: ccache | |
OPENVINO_REPO: ${{ github.workspace }}/openvino | |
OPENVINO_CONTRIB_REPO: ${{ github.workspace }}/openvino_contrib | |
INSTALL_DIR: ${{ github.workspace }}/openvino_install | |
INSTALL_DIR_JS: ${{ github.workspace }}/openvino_install/js | |
INSTALL_TEST_DIR: ${{ github.workspace }}/tests_install | |
INSTALL_WHEELS_DIR: ${{ github.workspace }}/install/wheels | |
BUILD_DIR: ${{ github.workspace }}/build | |
if: "!needs.smart_ci.outputs.skip_workflow" | |
steps: | |
- name: Clone OpenVINO | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
path: 'openvino' | |
submodules: 'true' | |
- name: Clone OpenVINO Contrib | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
repository: 'openvinotoolkit/openvino_contrib' | |
path: 'openvino_contrib' | |
# | |
# Print system info | |
# | |
- name: System info | |
uses: ./openvino/.github/actions/system_info | |
# | |
# Dependencies | |
# | |
- name: Install build dependencies | |
run: brew install coreutils ninja scons pigz | |
- name: Setup Python ${{ env.PYTHON_VERSION }} | |
uses: ./openvino/.github/actions/setup_python | |
with: | |
version: ${{ env.PYTHON_VERSION }} | |
should-setup-pip-paths: 'false' | |
self-hosted-runner: 'false' | |
- name: Install python dependencies | |
run: | | |
# For Python API | |
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt | |
# For running ONNX frontend unit tests | |
python3 -m pip install --force-reinstall -r ${{ env.OPENVINO_REPO }}/src/frontends/onnx/tests/requirements.txt | |
# For running TensorFlow frontend unit tests | |
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/frontends/tensorflow/tests/requirements.txt | |
# For running Paddle frontend unit tests | |
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/frontends/paddle/tests/requirements.txt | |
# | |
# Build | |
# | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14 | |
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: ${{ runner.os }}-${{ runner.arch }}-main | |
restore-keys: | | |
${{ runner.os }}-${{ runner.arch }}-main | |
- name: CMake configure | |
run: | | |
cmake \ | |
-G "${{ env.CMAKE_GENERATOR }}" \ | |
-DENABLE_CPPLINT=OFF \ | |
-DENABLE_NCC_STYLE=OFF \ | |
-DENABLE_TESTS=ON \ | |
-DENABLE_WHEEL=OFF \ | |
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ | |
-DENABLE_STRICT_DEPENDENCIES=OFF \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \ | |
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \ | |
-S ${{ env.OPENVINO_REPO }} \ | |
-B ${{ env.BUILD_DIR }} | |
- name: Cmake build - OpenVINO | |
run: cmake --build ${{ env.BUILD_DIR }} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} | |
- name: Show ccache stats | |
run: ccache --show-stats | |
- name: Cmake install - OpenVINO | |
run: | | |
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake | |
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_TEST_DIR }} -DCOMPONENT=tests -P ${{ env.BUILD_DIR }}/cmake_install.cmake | |
- name: Pack Artifacts | |
run: | | |
pushd ${{ env.INSTALL_DIR }} | |
tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_package.tar.gz | |
popd | |
pushd ${{ env.INSTALL_TEST_DIR }} | |
tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_tests.tar.gz | |
popd | |
# Setup additional Python versions for wheels building | |
- name: Setup Python 3.9 | |
uses: ./openvino/.github/actions/setup_python | |
with: | |
version: "3.9" | |
should-setup-pip-paths: 'false' | |
self-hosted-runner: 'false' | |
- name: Setup Python 3.10 | |
uses: ./openvino/.github/actions/setup_python | |
with: | |
version: "3.10" | |
should-setup-pip-paths: 'false' | |
self-hosted-runner: 'false' | |
- name: Setup Python 3.12 | |
uses: ./openvino/.github/actions/setup_python | |
with: | |
version: "3.12" | |
should-setup-pip-paths: 'false' | |
self-hosted-runner: 'false' | |
- name: Build additional Python wheels | |
run: | | |
for py_version in "3.9" "3.10" "3.11" "3.12" | |
do | |
python_exec_path=$(python$py_version -c "import sys; print(sys.executable)") | |
$python_exec_path -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt | |
cmake -DPython3_EXECUTABLE=$python_exec_path -DENABLE_WHEEL=ON -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B ${{ github.workspace }}/py$py_version | |
cmake --build ${{ github.workspace }}/py$py_version --parallel | |
cmake --install ${{ github.workspace }}/py$py_version --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels | |
done | |
# Setup Python 3.11 as the default one | |
- name: Setup Python ${{ env.PYTHON_VERSION }} | |
uses: ./openvino/.github/actions/setup_python | |
with: | |
version: ${{ env.PYTHON_VERSION }} | |
should-setup-pip-paths: 'false' | |
self-hosted-runner: 'false' | |
- name: Cmake & Build - OpenVINO Contrib | |
run: | | |
cmake \ | |
-DCUSTOM_OPERATIONS="calculate_grid;complex_mul;fft;grid_sample;sparse_conv;sparse_conv_transpose" \ | |
-DOPENVINO_EXTRA_MODULES=${{ env.OPENVINO_CONTRIB_REPO }}/modules/custom_operations \ | |
-S ${{ env.OPENVINO_REPO }} \ | |
-B ${{ env.BUILD_DIR }} | |
cmake --build ${{ env.BUILD_DIR }} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} | |
- name: CMake configure, build and install - OpenVINO JS API | |
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API | |
run: | | |
cmake \ | |
-DCPACK_GENERATOR=NPM \ | |
-S ${{ env.OPENVINO_REPO }} \ | |
-B ${{ env.BUILD_DIR }} | |
cmake --build ${{ env.BUILD_DIR }} --parallel $(nproc) | |
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR_JS }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake | |
# | |
# Upload build artifacts | |
# | |
- name: Upload openvino package | |
if: ${{ always() }} | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: openvino_package | |
path: ${{ env.BUILD_DIR }}/openvino_package.tar.gz | |
if-no-files-found: 'error' | |
- name: Upload openvino wheels | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: openvino_wheels | |
path: ${{ env.INSTALL_WHEELS_DIR }}/wheels/*.whl | |
if-no-files-found: 'error' | |
- name: Upload openvino tests package | |
if: ${{ always() }} | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: openvino_tests | |
path: ${{ env.BUILD_DIR }}/openvino_tests.tar.gz | |
if-no-files-found: 'error' | |
- name: Upload openvino js package | |
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: openvino_js_package | |
path: ${{ env.INSTALL_DIR_JS }} | |
if-no-files-found: 'error' | |
Samples: | |
needs: [ Build, Smart_CI ] | |
uses: ./.github/workflows/job_samples_tests.yml | |
with: | |
runner: 'macos-13-xlarge' | |
affected-components: ${{ needs.smart_ci.outputs.affected_components }} | |
JS_API: | |
name: OpenVINO JS API | |
needs: [ Build, Smart_CI ] | |
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API | |
uses: ./.github/workflows/job_openvino_js.yml | |
with: | |
runner: 'macos-13-xlarge' | |
Openvino_tokenizers: | |
name: OpenVINO tokenizers extension | |
needs: [ Build, Smart_CI ] | |
uses: ./.github/workflows/job_tokenizers.yml | |
with: | |
runner: 'macos-13-xlarge' | |
shell: bash | |
affected-components: ${{ needs.smart_ci.outputs.affected_components }} | |
python-version: '3.11' | |
if: fromJSON(needs.smart_ci.outputs.affected_components).TOKENIZERS | |
CXX_Unit_Tests: | |
name: C++ unit tests | |
needs: [ Build, Smart_CI ] | |
uses: ./.github/workflows/job_cxx_unit_tests.yml | |
with: | |
runner: 'macos-13-xlarge' | |
affected-components: ${{ needs.smart_ci.outputs.affected_components }} | |
os: 'mac_13' | |
Python_Unit_Tests: | |
name: Python unit tests | |
needs: [ Build, Smart_CI ] | |
uses: ./.github/workflows/job_python_unit_tests.yml | |
with: | |
runner: 'macos-13-xlarge' | |
affected-components: ${{ needs.smart_ci.outputs.affected_components }} | |
python-version: '3.11' | |
Python_API_Tests: | |
name: Python API tests | |
needs: [ Build, Smart_CI ] | |
uses: ./.github/workflows/job_python_api_tests.yml | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.9', '3.10', '3.11', '3.12' ] | |
with: | |
runner: 'macos-13-xlarge' | |
python-version: ${{ matrix.python-version }} | |
if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test | |
TensorFlow_Layer_Tests: | |
name: TensorFlow Layer Tests | |
needs: [ Build, Smart_CI, Openvino_tokenizers ] | |
uses: ./.github/workflows/job_tensorflow_layer_tests.yml | |
with: | |
runner: 'macos-13-xlarge' | |
affected-components: ${{ needs.smart_ci.outputs.affected_components }} | |
python-version: '3.11' | |
Pytorch_Layer_Tests: | |
name: Pytorch Layer Tests | |
needs: [ Build, Smart_CI ] | |
uses: ./.github/workflows/job_pytorch_layer_tests.yml | |
with: | |
runner: 'macos-13-xlarge' | |
affected-components: ${{ needs.smart_ci.outputs.affected_components }} | |
python-version: '3.11' | |
CPU_Functional_Tests: | |
name: CPU functional tests | |
if: fromJSON(needs.smart_ci.outputs.affected_components).CPU.test | |
needs: [ Build, Smart_CI ] | |
uses: ./.github/workflows/job_cpu_functional_tests.yml | |
with: | |
runner: 'macos-13-xlarge' | |
python-version: '3.11' |