-
Notifications
You must be signed in to change notification settings - Fork 112
80 lines (71 loc) · 2.9 KB
/
test_openvino_basic.yml
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
name: OpenVINO - Basic Test
on:
workflow_dispatch:
schedule:
- cron: "41 1 * * *" # run every day at 1:41
push:
branches:
- v*-release
pull_request:
types: [opened, synchronize, reopened, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') || (github.event_name == 'push') || contains( github.event.pull_request.labels.*.name, 'openvino-test') }}
strategy:
fail-fast: false
matrix:
# Testing lower and upper bound of supported Python versions
# This also ensures that the test fails if dependencies break for Python 3.7
python-version: ["3.9", "3.12"]
os: ["ubuntu-22.04", "windows-latest"]
transformers-version: ["4.45.*"]
openvino: ["openvino openvino-tokenizers"]
nncf: ["nncf"]
include:
- python-version: "3.12"
os: "ubuntu-22.04"
transformers-version: "4.36.0"
openvino: "openvino openvino-tokenizers"
nncf: "nncf"
- python-version: "3.12"
os: "ubuntu-22.04"
transformers-version: "4.45.*"
openvino: "--pre -U openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly"
nncf: "nncf"
- python-version: "3.12"
os: "ubuntu-22.04"
transformers-version: "4.45.*"
openvino: "--pre -U openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly"
nncf: "git+https://github.com/openvinotoolkit/nncf.git"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install PyTorch CPU to prevent unnecessary downloading/installing of CUDA packages
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
# Install openvino manually to prevent dependency conflicts when .[openvino] pins
# optimum or transformers to a specific version
pip install ${{ matrix.openvino }}
pip install transformers==${{ matrix.transformers-version }}
pip install .[tests]
- name: Pip freeze
run: pip freeze
- name: Test with Pytest
run: |
pytest tests/openvino/test_modeling_basic.py
- name: Slow tests
run: |
pip install ${{ matrix.nncf }}
pytest tests/openvino -s -m "run_slow" --durations=0
env:
RUN_SLOW: 1
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}