forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (114 loc) · 4.83 KB
/
Copy pathjob_pytorch_fx_layer_tests.yml
File metadata and controls
129 lines (114 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: PyTorch FX Layer Tests
on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
image:
description: 'Docker image to use for the job'
type: string
required: false
default: 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_LINUX: /mount/caches/pip/linux
PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"
jobs:
PyTorch_FX_Layer_Tests:
name: PyTorch FX Layer Tests
timeout-minutes: 60
runs-on: ${{ inputs.runner }}
container:
image: ${{ inputs.image }}
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }} # Needed as ${{ github.workspace }} is not working correctly when using Docker
options: "-e HF_TOKEN" # Needed for HuggingFace cache authentication
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
USE_SYSTEM_CACHE: False # Using remote HuggingFace cache
steps:
- name: Fetch setup_python and install wheels actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
.github/actions
sparse-checkout-cone-mode: false
submodules: 'false'
- name: Download OpenVINO artifacts (wheels)
uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415
with:
name: openvino_wheels
path: ${{ env.INSTALL_DIR }}
- name: Download OpenVINO artifacts (tests)
uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415
with:
name: openvino_tests
path: ${{ env.INSTALL_DIR }}
- name: Setup HuggingFace Cache Directory (Windows)
if: runner.os == 'Windows'
run: |
Add-Content -Path $env:GITHUB_ENV -Value "HF_HUB_CACHE=C:\\mount\\caches\\huggingface"
Add-Content -Path $env:GITHUB_ENV -Value "HUGGINGFACE_HUB_CACHE=C:\\mount\\caches\\huggingface"
Add-Content -Path $env:GITHUB_ENV -Value "HF_HUB_OFFLINE=1"
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
run: brew install pigz
- name: Extract OpenVINO packages (Linux, macOS)
if: runner.os != 'Windows'
run: pigz -dc openvino_tests.tar.gz | tar -xf - -v
working-directory: ${{ env.INSTALL_DIR }}
- name: Extract OpenVINO artifacts (Windows)
if: runner.os == 'Windows'
run: Expand-Archive openvino_tests.zip -DestinationPath . -Verbose
working-directory: ${{ env.INSTALL_DIR }}
- name: Setup Python ${{ inputs.python-version }}
uses: ./.github/actions/setup_python
with:
version: ${{ inputs.python-version }}
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH_LINUX || env.PIP_CACHE_PATH_WIN }}
should-setup-pip-paths: ${{ runner.os != 'macOS' }}
self-hosted-runner: ${{ runner.os != 'macOS' }}
- name: Install OpenVINO Python wheels
uses: ./.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_DIR }}
wheels-to-install: 'openvino'
- name: Install Pytorch FX Layer tests dependencies
run: |
# pytorch test requirements
python3 -m pip install -r ${{ env.INSTALL_TEST_DIR }}/requirements_pytorch
- 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.INSTALL_TEST_DIR }}/layer_tests/pytorch_tests -m precommit_fx_backend -v --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-pytorch_compile.xml
env:
TEST_DEVICE: CPU
TEST_PRECISION: FP32
PYTORCH_TRACING_MODE: TORCHFX
- name: Upload Test Results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ !cancelled() }}
with:
name: test-results-python-pytorch-fx-layers
path: |
${{ env.INSTALL_TEST_DIR }}/TEST*.html
${{ env.INSTALL_TEST_DIR }}/TEST*.xml
if-no-files-found: 'warn'