Skip to content

Commit e0d98b1

Browse files
authored
Upgrade optimum-intel and transformers (#2611)
1 parent 744c69f commit e0d98b1

File tree

12 files changed

+35
-25
lines changed

12 files changed

+35
-25
lines changed

.github/workflows/linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525
SCCACHE_CACHE_SIZE: 30G
2626
SCCACHE_AZURE_KEY_PREFIX: genai/ubuntu/22_04/x64
2727
HF_HOME: /mount/caches/huggingface/lin
28-
OV_CACHE: /mount/caches/huggingface/.ov_cache/lin
28+
OV_CACHE: /mount/caches/huggingface/.ov_cache/lin/
2929
OPENVINO_LOG_LEVEL: 4
3030
GENAI_ARCHIVE_NAME: genai.tar.gz
3131
GENAI_SAMPLES_NAME: genai_samples.tar.gz
@@ -520,7 +520,7 @@ jobs:
520520
- name: 'Cacheopt E2E (Part 2)'
521521
cmd: 'python -m pytest -v ./tests/python_tests/test_kv_cache_eviction/test_kv_cache_eviction_2.py'
522522
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test }}
523-
timeout: 240
523+
timeout: 360
524524
- name: 'LLM & VLM'
525525
cmd: 'python -m pytest -v ./tests/python_tests/test_llm_pipeline.py tests/python_tests/test_llm_pipeline_static.py ./tests/python_tests/test_vlm_pipeline.py tests/python_tests/test_structured_output.py --override-ini cache_dir=/mount/caches/pytest/'
526526
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test || fromJSON(needs.smart_ci.outputs.affected_components).LLM.test }}
@@ -544,7 +544,7 @@ jobs:
544544
- name: 'WWB tests'
545545
cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava"'
546546
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
547-
timeout: 90
547+
timeout: 120
548548
- name: 'WWB tests (nanollava)'
549549
cmd: |
550550
python -m pip install transformers==4.48.0

.github/workflows/mac.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
BASE_PRODUCT_TYPE: public_macos_arm64
2323
CCACHE_MAXSIZE: 500Mi
2424
HF_HOME: ~/.cache/hf
25-
OV_CACHE: ~/.cache/ov_cache/194c936
25+
OV_CACHE: ~/.cache/ov_cache/
2626
CLEANUP_CACHE: 1
2727
OPENVINO_LOG_LEVEL: 4
2828

@@ -470,7 +470,7 @@ jobs:
470470
- name: 'WWB tests'
471471
cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava"'
472472
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
473-
timeout: 180
473+
timeout: 120
474474
- name: 'WWB tests (nanollava)'
475475
cmd: |
476476
python -m pip install transformers==4.48.0
@@ -518,13 +518,6 @@ jobs:
518518
requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt"
519519
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
520520

521-
# transformers >= 4.52 require torch >= 2.6 and raise an error otherwise:
522-
# ValueError: Due to a serious vulnerability issue in `torch.load`, even with `weights_only=True`, we now require users to upgrade torch to at least v2.6 in order to use the function. This version restriction does not apply when loading files with safetensors.
523-
# See the vulnerability report here https://nvd.nist.gov/vuln/detail/CVE-2025-32434
524-
525-
# x86_64 macOS does not (and will not) support newer versions of torch > 2.2 which are used in the newer transformers versions. It's not possible to lower transformer version in requirements.txt because that triggers vulnerability alert: https://github.com/openvinotoolkit/openvino_tokenizers/security/dependabot/11
526-
- run: python -m pip install "transformers<4.52"
527-
528521
- name: Tests
529522
if: ${{ matrix.test.run_condition }}
530523
run: ${{ matrix.test.cmd }}

.github/workflows/manylinux_2_28.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525
SCCACHE_CACHE_SIZE: 30G
2626
SCCACHE_AZURE_KEY_PREFIX: genai/manylinux_2_28
2727
HF_HOME: /mount/caches/huggingface/lin
28-
OV_CACHE: /mount/caches/huggingface/.ov_cache/lin
28+
OV_CACHE: /mount/caches/huggingface/.ov_cache/lin/
2929
OPENVINO_LOG_LEVEL: 4
3030
GENAI_ARCHIVE_NAME: genai.tar.gz
3131
GENAI_SAMPLES_NAME: genai_samples.tar.gz
@@ -458,7 +458,7 @@ jobs:
458458
- name: 'Cacheopt E2E (Part 2)'
459459
cmd: 'python -m pytest -v ./tests/python_tests/test_kv_cache_eviction/test_kv_cache_eviction_2.py'
460460
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test }}
461-
timeout: 240
461+
timeout: 360
462462
- name: 'LLM & VLM'
463463
cmd: 'python -m pytest -v ./tests/python_tests/test_llm_pipeline.py ./tests/python_tests/test_llm_pipeline_static.py ./tests/python_tests/test_vlm_pipeline.py ./tests/python_tests/test_structured_output.py --override-ini cache_dir=/mount/caches/pytest/'
464464
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test || fromJSON(needs.smart_ci.outputs.affected_components).LLM.test }}
@@ -482,7 +482,7 @@ jobs:
482482
- name: 'WWB tests'
483483
cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava"'
484484
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
485-
timeout: 180
485+
timeout: 120
486486
- name: 'WWB tests (nanollava)'
487487
cmd: |
488488
python -m pip install transformers==4.48.0

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ jobs:
621621
- name: 'Cacheopt E2E (Part 2)'
622622
cmd: 'python -m pytest -s -v tests/python_tests/test_kv_cache_eviction/test_kv_cache_eviction_2.py'
623623
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test }}
624-
timeout: 240
624+
timeout: 360
625625
- name: 'LLM & VLM'
626626
cmd: 'python -m pytest -s -v tests/python_tests/test_llm_pipeline.py tests/python_tests/test_llm_pipeline_static.py tests/python_tests/test_vlm_pipeline.py tests/python_tests/test_structured_output.py --override-ini cache_dir=/mount/caches/pytest/'
627627
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test || fromJSON(needs.smart_ci.outputs.affected_components).LLM.test }}
@@ -645,7 +645,7 @@ jobs:
645645
- name: 'WWB tests'
646646
cmd: 'python -m pytest -s -v tools/who_what_benchmark/tests -m "not nanollava"'
647647
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
648-
timeout: 180
648+
timeout: 120
649649
- name: 'WWB tests (nanollava)'
650650
cmd: |
651651
python -m pip install transformers==4.48.0

samples/export-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--extra-index-url https://download.pytorch.org/whl/cpu
22
--extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
33
openvino-tokenizers[transformers]~=2025.4.0.0.dev
4-
optimum-intel[nncf]==1.25.2
4+
optimum-intel[nncf]==1.26.0
55
numpy==1.26.4; platform_system == "Darwin" and platform_machine == "x86_64"
66
safetensors==0.6.2; platform_system == "Darwin" and platform_machine == "x86_64"
77
einops==0.8.1 # For Qwen
@@ -12,7 +12,7 @@ timm==1.0.20 # For exporting InternVL2
1212
torch==2.8.0
1313
torchvision==0.17.2; platform_system == "Darwin" and platform_machine == "x86_64"
1414
torchvision==0.23.0; platform_system != "Darwin" or platform_machine != "x86_64"
15-
transformers==4.53.3 # For Whisper
15+
transformers==4.55.4 # For Whisper
1616
hf_transfer==0.1.9 # for faster models download, should used with env var HF_HUB_ENABLE_HF_TRANSFER=1
1717
backoff==2.2.1 # for microsoft/Phi-3.5-vision-instruct
1818
peft==0.17.1 # For microsoft/Phi-4-multimodal-instruct

tests/python_tests/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
--extra-index-url https://download.pytorch.org/whl/cpu
22
diffusers==0.35.2
3-
optimum-intel @ git+https://github.com/huggingface/optimum-intel.git@04db016571d1a19c14918553365ee4c05c8b4697
3+
optimum-intel==1.26.0
44
numpy==1.26.4; platform_system == "Darwin" and platform_machine == "x86_64"
55
safetensors==0.6.2; platform_system == "Darwin" and platform_machine == "x86_64"
66
pytest==8.4.2
7-
transformers==4.53.3
7+
transformers==4.55.4
88
hf_transfer==0.1.9
99
gguf==0.17.1
1010
torch==2.8.0

tests/python_tests/samples/test_text2speech.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import os
5+
import subprocess # nosec B404
56
import sys
67
import tempfile
78

tests/python_tests/test_vlm_pipeline.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ def _setup_generation_config(
178178

179179

180180
def _get_ov_model(model_id: str) -> str:
181+
if model_id in {"katuni4ka/tiny-random-phi-4-multimodal", "qnguyen3/nanoLLaVA"}:
182+
pytest.skip("ValueError: The current version of Transformers does not allow for the export of the model. Maximum required is 4.53.3, got: 4.55.4")
183+
if "katuni4ka/tiny-random-phi3-vision" == model_id:
184+
pytest.xfail("AttributeError: 'DynamicCache' object has no attribute 'get_usable_length'. Ticket CVS-175110")
181185
ov_cache_models_dir = get_ov_cache_models_dir()
182186
dir_name = str(model_id).replace(os.sep, "_")
183187
model_dir = ov_cache_models_dir / dir_name
@@ -198,7 +202,13 @@ def _get_ov_model(model_id: str) -> str:
198202
device="CPU",
199203
export=True,
200204
load_in_8bit=False,
201-
trust_remote_code=True,
205+
trust_remote_code=model_id in {
206+
"katuni4ka/tiny-random-minicpmv-2_6",
207+
"katuni4ka/tiny-random-internvl2",
208+
"katuni4ka/tiny-random-phi3-vision",
209+
"katuni4ka/tiny-random-phi-4-multimodal",
210+
"qnguyen3/nanoLLaVA",
211+
},
202212
)
203213
)
204214
if model.config.model_type == "llava-qwen2":

tests/python_tests/utils/hugging_face.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ def run_hugging_face(
166166

167167
# download HF model or read converted model
168168
def get_huggingface_models(model_id: str | Path, model_class: Type[OVModel], local_files_only=False):
169-
hf_tokenizer = retry_request(lambda: AutoTokenizer.from_pretrained(model_id, trust_remote_code=True, local_files_only=local_files_only))
170-
opt_model = retry_request(lambda: model_class.from_pretrained(model_id, export=isinstance(model_id, str), compile=False, load_in_8bit=False, trust_remote_code=isinstance(model_id, str), ov_config=get_default_llm_properties(), local_files_only=local_files_only))
169+
hf_tokenizer = retry_request(lambda: AutoTokenizer.from_pretrained(model_id, local_files_only=local_files_only))
170+
opt_model = retry_request(lambda: model_class.from_pretrained(model_id, export=isinstance(model_id, str), compile=False, load_in_8bit=False, ov_config=get_default_llm_properties(), local_files_only=local_files_only))
171171
return opt_model, hf_tokenizer
172172

173173

tools/who_what_benchmark/tests/test_cli_embeddings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import subprocess # nosec B404
2+
import sys
23
import pytest
34
import logging
45
from test_cli_image import run_wwb
@@ -11,7 +12,9 @@
1112
@pytest.mark.parametrize(
1213
("model_id", "model_type"),
1314
[
14-
("BAAI/bge-small-en-v1.5", "text-embedding"),
15+
pytest.param("BAAI/bge-small-en-v1.5", "text-embedding", marks=pytest.mark.xfail(
16+
sys.platform == 'darwin', reason="Hangs. Ticket 175534", run=False
17+
)),
1518
("Qwen/Qwen3-Embedding-0.6B", "text-embedding"),
1619
],
1720
)

0 commit comments

Comments
 (0)