diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 63d525069..db99106d1 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true jobs: - build: + quality: strategy: fail-fast: false matrix: diff --git a/.github/workflows/test_openvino.yml b/.github/workflows/test_openvino.yml index aa4d04da5..b8e1dd46f 100644 --- a/.github/workflows/test_openvino.yml +++ b/.github/workflows/test_openvino.yml @@ -20,10 +20,13 @@ jobs: matrix: test_pattern: [ - "test_export*", - "test_modeling*", + "test_modeling.py", + "test_modeling_basic.py", + "test_modeling_diffusion.py", + "test_modeling_sentence_transformers.py", "test_quantization*", "test_training*", + "test_export*", ] transformers-version: ["4.36.0", "4.45.*"] python-version: ["3.9"] @@ -56,15 +59,15 @@ jobs: - name: Test with Pytest run: | - pytest tests/openvino/${{ matrix.test_pattern }}.py + pytest tests/openvino/${{ matrix.test_pattern }} --duration=0 env: HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }} - - name: Install nightly OpenVINO + - name: Install dependencies (nightly) run: | pip install --upgrade --pre openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly - - name: Test with Pytest - if: ${{ matrix.test_pattern == 'test_modeling*' }} + - name: Test with Pytest (nightly) + if: ${{ matrix.test_pattern == 'test_modeling_basic.py' }} run: | pytest tests/openvino/modeling_basic.py diff --git a/.github/workflows/test_openvino_examples.yml b/.github/workflows/test_openvino_examples.yml index 0826f1613..a00f3f017 100644 --- a/.github/workflows/test_openvino_examples.yml +++ b/.github/workflows/test_openvino_examples.yml @@ -37,11 +37,11 @@ jobs: - name: Install dependencies run: | - pip install .[openvino] jstyleson pytest pip install -r examples/openvino/audio-classification/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu pip install -r examples/openvino/image-classification/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu pip install -r examples/openvino/question-answering/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu pip install -r examples/openvino/text-classification/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu + pip install .[openvino] jstyleson pytest - name: Test examples run: | diff --git a/.github/workflows/test_openvino_notebooks.yml b/.github/workflows/test_openvino_notebooks.yml index 2d0f79ffd..d024ad46a 100644 --- a/.github/workflows/test_openvino_notebooks.yml +++ b/.github/workflows/test_openvino_notebooks.yml @@ -37,17 +37,12 @@ jobs: - name: Install dependencies run: | - # Install PyTorch CPU to prevent unnecessary downloading/installing of CUDA packages - # ffmpeg, torchaudio and pillow are required for image classification and audio classification pipelines + # ffmpeg is required for image classification and audio classification pipelines sudo apt-get install ffmpeg pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu pip install -r notebooks/openvino/requirements.txt pip install .[tests,openvino] nbval - - run: free -h - - run: lscpu - - run: pip freeze - - name: Test with Pytest run: | sed -i 's/NUM_TRAIN_ITEMS = 600/NUM_TRAIN_ITEMS = 10/' notebooks/openvino/question_answering_quantization.ipynb diff --git a/.github/workflows/test_openvino_slow.yml b/.github/workflows/test_openvino_slow.yml index 49ffe8d67..bb193b353 100644 --- a/.github/workflows/test_openvino_slow.yml +++ b/.github/workflows/test_openvino_slow.yml @@ -8,7 +8,11 @@ on: branches: - v*-release pull_request: - types: [opened, synchronize, reopened, labeled] + types: + - opened + - labeled + - reopened + - synchronize concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -20,6 +24,7 @@ jobs: strategy: fail-fast: false matrix: + # TODO: testong python upper bound seems unnecessary # 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"] @@ -47,7 +52,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -55,25 +62,26 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip - # Install PyTorch CPU to prevent unnecessary downloading/installing of CUDA packages + pip install --upgrade pip 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 .[tests] transformers[testing]==${{ matrix.transformers-version }} - - name: Pip freeze - run: pip freeze + - name: Assert versions + run: | + python -c "import transformers; print(transformers.__version__); assert transformers.__version__.startswith('${{ matrix.transformers-version }}'.replace('.*', ''))" - name: Test with Pytest run: | pytest tests/openvino/test_modeling_basic.py - - name: Slow tests + - name: Install dependencies (slow) run: | pip install ${{ matrix.nncf }} - pytest tests/openvino -s -m "run_slow" --durations=0 + + - name: Test with Pytest (slow) + run: | + pytest tests/openvino -m "run_slow" --durations=0 env: RUN_SLOW: 1 HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}