Skip to content

Commit e80c3dd

Browse files
Fix disk by distributing tests (#1438)
* fix disk by distributing tests * visual causal LM in seq2seq * fix * move TextToSpectrogram * remove tool cache in full tests * add specific nightly tests * test * security * fix * fix * separate nightly and slow * ov release fixes * fix mamba import * test * fix * trigger nightly * fix * remove trigger * add nightly label
1 parent bc13ae5 commit e80c3dd

File tree

9 files changed

+1835
-1739
lines changed

9 files changed

+1835
-1739
lines changed

.github/workflows/test_openvino.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,29 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
1720
env:
21+
UV_TORCH_BACKEND: cpu
22+
UV_SYSTEM_PYTHON: true
1823
TRANSFORMERS_IS_CI: true
24+
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
1925

2026
jobs:
2127
build:
2228
strategy:
2329
fail-fast: false
2430
matrix:
2531
test-pattern:
26-
["*modeling*", "*diffusion*", "*quantization*", "*export*"]
32+
[
33+
"*export*",
34+
"*decoder*",
35+
"*seq2seq*",
36+
"*modeling*",
37+
"*diffusion*",
38+
"*quantization*",
39+
]
2740
transformers-version: ["4.36.0", "latest"]
2841

2942
runs-on: ubuntu-22.04
@@ -39,39 +52,29 @@ jobs:
3952

4053
- name: Install dependencies
4154
run: |
42-
pip install --upgrade pip
43-
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
44-
pip install .[openvino,diffusers,tests]
55+
pip install --upgrade pip uv
56+
uv pip install .[openvino,diffusers,tests]
4557
4658
- if: ${{ matrix.transformers-version != 'latest' }}
4759
name: Install specific dependencies and versions required for older transformers
4860
run: |
49-
pip install transformers==${{ matrix.transformers-version }} accelerate==0.* peft==0.13.* diffusers==0.30.* transformers_stream_generator
61+
uv pip install transformers==${{ matrix.transformers-version }} accelerate==0.* peft==0.13.* diffusers==0.30.* transformers_stream_generator
5062
51-
- if: ${{ matrix.transformers-version == 'latest' && matrix.test-pattern == '*modeling*'}}
63+
- if: ${{ matrix.transformers-version == 'latest' && matrix.test-pattern == '*decoder*'}}
5264
name: Install auto-gptq, autoawq
5365
run: |
54-
pip install auto-gptq "autoawq<0.2.8" --extra-index-url https://download.pytorch.org/whl/cpu
55-
56-
- if: ${{ matrix.test-pattern == '*modeling*' }}
57-
name: Uninstall NNCF
58-
run: |
59-
pip uninstall -y nncf
66+
uv pip install auto-gptq "autoawq<0.2.8"
6067
6168
- name: Test with Pytest
6269
run: |
6370
pytest tests/openvino/${{ matrix.test-pattern }} --durations=0
64-
env:
65-
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
6671
6772
- if: ${{ matrix.test-pattern == '*modeling*' }}
68-
name: Install dependencies (nightly)
73+
name: Install Nightly OpenVINO
6974
run: |
70-
pip install --upgrade --pre openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
75+
uv pip install --upgrade --pre openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
7176
7277
- if: ${{ matrix.test-pattern == '*modeling*' }}
73-
name: Test with Pytest (nightly)
78+
name: Test with Pytest - Nightly OpenVINO
7479
run: |
7580
pytest tests/openvino/test_modeling_basic.py --durations=0
76-
env:
77-
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}

.github/workflows/test_openvino_full.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: OpenVINO - Nightly Test
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# run every day at 4:41
7+
- cron: "41 4 * * *"
8+
push:
9+
branches:
10+
- v*-release
11+
pull_request:
12+
types:
13+
- opened
14+
- labeled
15+
- reopened
16+
- synchronize
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
permissions:
23+
contents: read
24+
25+
env:
26+
RUN_SLOW: true
27+
UV_TORCH_BACKEND: cpu
28+
UV_SYSTEM_PYTHON: true
29+
TRANSFORMERS_IS_CI: true
30+
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
31+
32+
jobs:
33+
build:
34+
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') || (github.event_name == 'push') || contains( github.event.pull_request.labels.*.name, 'openvino-slow') }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
# stable and nightly openvino tests
39+
openvino-version: ["openvino-stable", "openvino-nightly"]
40+
nncf-version: ["nncf-stable"]
41+
test-pattern:
42+
[
43+
"*export*",
44+
"*decoder*",
45+
"*seq2seq*",
46+
"*modeling*",
47+
"*diffusion*",
48+
"*quantization*",
49+
]
50+
51+
include:
52+
# stable openvino + nncf develop tests
53+
- nncf-version: "nncf-develop"
54+
openvino-version: "openvino-stable"
55+
test-pattern: "*{quantization,export}*"
56+
# nightly openvino + nncf develop tests
57+
- nncf-version: "nncf-develop"
58+
openvino-version: "openvino-nightly"
59+
test-pattern: "*{quantization,export}*"
60+
61+
runs-on: ubuntu-22.04
62+
63+
steps:
64+
- name: Checkout code
65+
uses: actions/checkout@v4
66+
67+
- name: Setup Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: 3.9
71+
72+
- name: Install dependencies
73+
run: |
74+
pip install --upgrade pip uv
75+
uv pip install .[openvino,diffusers,tests]
76+
77+
- if: ${{ matrix.openvino-version == 'openvino-nightly' }}
78+
name: Install OpenVINO Nightly
79+
run: |
80+
uv pip install --upgrade --pre openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
81+
82+
- if: ${{ matrix.nncf-version == 'nncf-develop' }}
83+
name: Install NNCF from main
84+
run: |
85+
pip install git+https://github.com/openvinotoolkit/nncf.git
86+
87+
- if: ${{ matrix.test-pattern == '*decoder*'}}
88+
name: Install auto-gptq, autoawq
89+
run: |
90+
uv pip install auto-gptq "autoawq<0.2.8" --extra-index-url https://download.pytorch.org/whl/cpu
91+
92+
- name: Pip freeze
93+
run: |
94+
pip freeze
95+
96+
- name: Test with Pytest
97+
run: |
98+
pytest tests/openvino/${{ matrix.test-pattern }} --durations=0

.github/workflows/test_openvino_slow.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: OpenVINO - Slow Test
22

33
on:
44
workflow_dispatch:
5-
schedule:
6-
- cron: "41 1 * * *" # run every day at 1:41
75
push:
86
branches:
97
- v*-release
@@ -18,12 +16,19 @@ concurrency:
1816
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1917
cancel-in-progress: true
2018

19+
permissions:
20+
contents: read
21+
2122
env:
23+
RUN_SLOW: true
24+
UV_TORCH_BACKEND: cpu
25+
UV_SYSTEM_PYTHON: true
2226
TRANSFORMERS_IS_CI: true
27+
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
2328

2429
jobs:
2530
build:
26-
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') || (github.event_name == 'push') || contains( github.event.pull_request.labels.*.name, 'openvino-test') }}
31+
if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') || (github.event_name == 'push') || contains( github.event.pull_request.labels.*.name, 'openvino-slow') }}
2732
strategy:
2833
fail-fast: false
2934
matrix:
@@ -54,23 +59,23 @@ jobs:
5459

5560
- name: Install dependencies
5661
run: |
57-
pip install --upgrade pip
58-
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
59-
pip install .[openvino,tests,diffusers] transformers[testing]
60-
pip uninstall -y nncf
62+
pip install --upgrade pip uv
63+
uv pip install .[openvino,tests,diffusers] transformers[testing]
6164
6265
- if: ${{ matrix.transformers-version != 'latest' && matrix.transformers-version != 'main' }}
6366
name: Install specific dependencies and versions required for older transformers
64-
run: pip install transformers==${{ matrix.transformers-version }} accelerate==0.* peft==0.13.*, diffusers==0.30.* transformers_stream_generator
65-
66-
- if: ${{ matrix.transformers-version == 'latest' && matrix.os != 'windows-2022' || matrix.transformers-version == 'main' }}
67-
name: Install auto-gptq, autoawq
6867
run: |
69-
pip install auto-gptq "autoawq<0.2.8" --extra-index-url https://download.pytorch.org/whl/cpu
68+
uv pip install transformers==${{ matrix.transformers-version }} accelerate==0.* peft==0.13.* diffusers==0.30.* transformers_stream_generator
7069
7170
- if: ${{ matrix.transformers-version == 'main' }}
7271
name: Install transformers from repository
73-
run: pip install git+https://github.com/huggingface/transformers.git
72+
run: |
73+
uv pip install git+https://github.com/huggingface/transformers.git
74+
75+
- if: ${{ matrix.transformers-version == 'latest' && matrix.os != 'windows-2022' || matrix.transformers-version == 'main' }}
76+
name: Install auto-gptq, autoawq
77+
run: |
78+
uv pip install auto-gptq "autoawq<0.2.8"
7479
7580
- name: Pip freeze
7681
run: pip freeze
@@ -79,13 +84,6 @@ jobs:
7984
run: |
8085
pytest tests/openvino/test_modeling_basic.py
8186
82-
- name: Install dependencies (slow)
83-
run: |
84-
pip install .[nncf]
85-
8687
- name: Test with Pytest (slow)
8788
run: |
8889
pytest tests/openvino -m "run_slow" --durations=0
89-
env:
90-
RUN_SLOW: 1
91-
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}

optimum/exporters/openvino/model_patcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6670,7 +6670,7 @@ def __init__(
66706670
model_kwargs: Optional[Dict[str, Any]] = None,
66716671
):
66726672
from transformers import PretrainedConfig
6673-
from transformers.cache_utils import MambaCache
6673+
from transformers.models.mamba.modeling_mamba import MambaCache
66746674

66756675
super().__init__(config, model, model_kwargs)
66766676

optimum/intel/openvino/modeling_decoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060

6161
if is_transformers_version(">=", "4.43"):
62-
from transformers.cache_utils import MambaCache
62+
from transformers.models.mamba.modeling_mamba import MambaCache
6363
else:
6464
MambaCache = object
6565

0 commit comments

Comments
 (0)