forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into an/mvn_refactor_2
- Loading branch information
Showing
76 changed files
with
4,020 additions
and
1,567 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
name: PyTorch Layer Tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
description: 'Machine on which the tests would run' | ||
type: string | ||
required: true | ||
container: | ||
description: 'JSON to be converted to the value of the "container" configuration for the job' | ||
type: string | ||
required: false | ||
default: '{"image": null}' | ||
affected-components: | ||
description: 'Components that are affected by changes in the commit defined by the Smart CI Action' | ||
type: string | ||
required: true | ||
python-version: | ||
description: 'Python version to setup. E.g., "3.11"' | ||
type: string | ||
required: true | ||
|
||
permissions: read-all | ||
|
||
env: | ||
PIP_CACHE_PATH: /mount/caches/pip/linux | ||
|
||
jobs: | ||
PyTorch_Layer_Tests: | ||
name: PyTorch Layer Tests | ||
timeout-minutes: 30 | ||
runs-on: ${{ inputs.runner }} | ||
container: ${{ fromJSON(inputs.container) }} | ||
defaults: | ||
run: | ||
shell: ${{ contains(inputs.runner, 'win') && 'pwsh' || 'bash' }} | ||
env: | ||
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input | ||
OPENVINO_REPO: ${{ github.workspace }}/openvino | ||
INSTALL_DIR: ${{ github.workspace }}/install | ||
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests | ||
LAYER_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/layer_tests | ||
steps: | ||
- name: Download OpenVINO package | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: openvino_package | ||
path: ${{ env.INSTALL_DIR }} | ||
|
||
- name: Download OpenVINO tests package | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: openvino_tests | ||
path: ${{ env.INSTALL_TEST_DIR }} | ||
|
||
# Needed as ${{ github.workspace }} is not working correctly when using Docker | ||
- name: Setup Variables | ||
if: runner.os != 'Windows' | ||
run: | | ||
echo "OPENVINO_REPO=$GITHUB_WORKSPACE/openvino" >> "$GITHUB_ENV" | ||
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV" | ||
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/tests" >> "$GITHUB_ENV" | ||
echo "LAYER_TESTS_INSTALL_DIR=$GITHUB_WORKSPACE/install/tests/layer_tests" >> "$GITHUB_ENV" | ||
- name: Extract OpenVINO packages (Linux, macOS) | ||
if: runner.os != 'Windows' | ||
run: | | ||
pushd $INSTALL_DIR | ||
tar -xzf openvino_package.tar.gz -C $INSTALL_DIR | ||
popd | ||
pushd $INSTALL_TEST_DIR | ||
tar -xzf openvino_tests.tar.gz -C $INSTALL_DIR | ||
popd | ||
- name: Extract OpenVINO packages (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
pushd ${{ env.INSTALL_DIR }} | ||
Expand-Archive openvino_package.zip -DestinationPath ${{ env.INSTALL_DIR }} | ||
popd | ||
pushd ${{ env.INSTALL_TEST_DIR }} | ||
Expand-Archive openvino_tests.zip -DestinationPath ${{ env.INSTALL_DIR }} | ||
popd | ||
- name: Fetch setup_python action | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
with: | ||
sparse-checkout: | | ||
.github/actions/setup_python/action.yml | ||
sparse-checkout-cone-mode: false | ||
path: 'openvino' | ||
|
||
- name: Setup Python ${{ inputs.python-version }} | ||
uses: ./openvino/.github/actions/setup_python | ||
with: | ||
version: ${{ inputs.python-version }} | ||
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }} | ||
should-setup-pip-paths: ${{ runner.os == 'Linux' }} | ||
self-hosted-runner: ${{ runner.os == 'Linux' }} | ||
|
||
- name: Install OpenVINO Python wheels (Linux and macOS) | ||
if: runner.os != 'Windows' | ||
run: | | ||
# Install the core OV wheel | ||
python3 -m pip install ${INSTALL_DIR}/tools/openvino-*.whl | ||
- name: Install OpenVINO Python wheels (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
# Find and install the core OV wheel | ||
$ovCoreWheelPath=Get-ChildItem -Path ${{ env.INSTALL_DIR }}\tools -Filter openvino-*.whl | % { $_.FullName } | ||
python3 -m pip install "$ovCoreWheelPath" | ||
- name: Install Pytorch Layer tests dependencies | ||
run: | | ||
# pytorch test requirements | ||
python3 -m pip install -r ${{ env.INSTALL_TEST_DIR }}/requirements_pytorch | ||
- name: PyTorch Layer Tests | ||
if: ${{ fromJSON(inputs.affected-components).PyTorch_FE.test && runner.arch != 'ARM64' }} # Ticket: 126287, 142196 | ||
# due to CVS-152795, parallel run is not possible on Windows | ||
run: python3 -m pytest ${{ env.LAYER_TESTS_INSTALL_DIR }}/pytorch_tests ${PARALLEL} -m precommit --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-pytorch.xml | ||
env: | ||
TEST_DEVICE: CPU | ||
TEST_PRECISION: FP32 | ||
PARALLEL: ${{ runner.os == 'Windows' && ' ' || '-n logical'}} | ||
|
||
- name: PyTorch torch.export Layer Tests | ||
if: ${{ fromJSON(inputs.affected-components).PyTorch_FE.test && runner.arch != 'ARM64' && runner.os != 'Windows' }} # Ticket: 126287 | ||
run: | | ||
python3 -m pytest ${{ env.LAYER_TESTS_INSTALL_DIR }}/pytorch_tests ${PARALLEL} -m precommit_torch_export --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-pytorch.xml | ||
env: | ||
TEST_DEVICE: CPU | ||
TEST_PRECISION: FP32 | ||
PYTORCH_TRACING_MODE: EXPORT | ||
PARALLEL: ${{ runner.os == 'Windows' && ' ' || '-n logical'}} | ||
|
||
- name: PyTorch torch.compile TORCHFX Layer Tests | ||
if: ${{ fromJSON(inputs.affected-components).PyTorch_FE.test && runner.os != 'macOS' && runner.arch != 'ARM64' && runner.os != 'Windows' }} # Ticket: 126287 | ||
run: | | ||
python3 -m pytest ${{ env.LAYER_TESTS_INSTALL_DIR }}/pytorch_tests -m precommit_fx_backend --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-pytorch.xml | ||
env: | ||
TEST_DEVICE: CPU | ||
TEST_PRECISION: FP32 | ||
PYTORCH_TRACING_MODE: TORCHFX | ||
|
||
- name: Upload Test Results | ||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: test-results-python-pytorch-layers | ||
path: | | ||
${{ env.INSTALL_TEST_DIR }}/TEST*.html | ||
${{ env.INSTALL_TEST_DIR }}/TEST*.xml | ||
if-no-files-found: 'warn' |
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
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
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
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
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
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
Oops, something went wrong.