OpenVINO - Basic Test #182
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: 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.8", "3.12"] | |
os: ["ubuntu-22.04", "windows-latest"] | |
transformers-version: ["4.42.*"] | |
include: | |
- transformers-version: "4.36.0" | |
python-version: "3.12" | |
os: "ubuntu-22.04" | |
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: | | |
# Install openvino manually to prevent dependency conflicts when .[openvino] pins | |
# optimum or transformers to a specific version | |
# Install PyTorch CPU to prevent unnecessary downloading/installing of CUDA packages | |
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | |
pip install transformers==${{ matrix.transformers-version }} | |
pip install .[tests] openvino | |
- name: Pip freeze | |
run: pip freeze | |
- name: Test with Pytest | |
run: | | |
pytest tests/openvino/test_modeling_basic.py | |
- name: Slow tests | |
run: | | |
pip install nncf | |
pytest tests/openvino -s -m "run_slow" --durations=0 | |
env: | |
RUN_SLOW: 1 |