Skip to content

Commit e75c6fa

Browse files
authored
[test] Move some to transformers v5 (openvinotoolkit#3763)
## Description GenAI tests are moved to transformers 5.0 Some tests remain on transformers 4.55.4 - `mark.transformers_lower_v5 ` Some tests were divided depending on the cases by models or by sampling(there are fails with goup beam search) - `mark.transformers_dependent` model for tests/python_tests/samples/test_benchmark_vlm.py, tests/python_tests/samples/test_scheduler_config.py was changed from tiny-random-minicpmv-2_6 to tiny-random-phi3-vision since support of minicpmv are deprecating in transformers v.5 (huggingface/optimum-intel#1589) Test schema example with new marks: VLM: transformers_dependent(scope for transformers==5.0) + **not** transformers_lower_v5 + all other tests VLM with transformers under 5.0: transformers_dependent(scope for transformers<5.0) + transformers_lower_v5 + **not** all other tests Problems for transformers_lower_v5 (not all required tasks): - CVS-185784 whisper tests, error: KeyError: 'num_frames' - CVS-185787 whisper tests, error: Check '!self_attn_nodes.empty()' fails - CVS-185791 accuracy drop llama - CVS-185790 - group beam search win/lin - CVS-185788 accuracy drop for tests with Qwen/Qwen2-0.5B-Instruct - CVS-186071 test_image_generation_cpu_vs_npuw_cpu_with_blob_model fails - CVS-186059 (CVS-185793 also, need to close) gemma3, llava-next, llava, error - Add node with name '__module.model.model.vision_tower.vision_model.embeddings/aten::add/Add' Check 'input_shape[j] == 1' failed - llava-next-video hasn't supported by optimum-intel 423b423 with transformers>=5.0 yet - version of the speechbrain module compatible with transformers v5.0 causes an import error with k2 module on Windows Problems for transformers_dependent(the same +): - CVS-185559 - samples llm tests, conversion of microsoft/phi-1_5 , error - AttributeError: 'PhiConfig' object has no attribute 'pad_token_id'. Did you mean: 'bos_token_id'? - CVS-185605 - "Tokenizers for draft and main models are different" with optimum-intel 423b423 and transformers>=5.0 - qwen3_next is not supported by optimum-intel 423b423 with transformers>=5.0 - minicpmv, internvl_chat, minicpmo, llava_next_video is not supported by transformers>=v5 Task: [CVS-185024](https://jira.devtools.intel.com/browse/CVS-185024) ## Checklist: - [ ] This PR follows [GenAI Contributing guidelines](https://github.com/openvinotoolkit/openvino.genai?tab=contributing-ov-file#contributing). <!-- Always follow them. If there are deviations, explain what and why. --> - [ ] Tests have been updated or added to cover the new code. <!-- Specify exactly which tests were added or updated. If the change isn't maintenance related, update the tests at https://github.com/openvinotoolkit/openvino.genai/tree/master/tests or explain in the description why the tests don't need an update. --> - [ ] This PR fully addresses the ticket. <!--- If not, explain clearly what is covered and what is not. If follow-up pull requests are needed, specify in the description. --> - [ ] I have made corresponding changes to the documentation. <!-- Run github.com/\<username>/openvino.genai/actions/workflows/deploy_gh_pages.yml on your fork with your branch as a parameter to deploy a test version with the updated content. Replace this comment with the link to the built docs. If the documentation is updated in a separate PR, clearly specify it. -->
1 parent eeb30a7 commit e75c6fa

51 files changed

Lines changed: 858 additions & 254 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/linux.yml

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,13 @@ jobs:
574574
test:
575575
- name: 'Whisper'
576576
# TODO: skip some tests temporary untill https://github.com/huggingface/datasets/issues/7647 dataset is fixed
577-
cmd: 'python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py ./tests/python_tests/test_whisper_pipeline_static.py -k "not test_smoke[sample_from_dataset0 and not test_whisper_constructors[sample_from_dataset0 and not test_max_new_tokens[sample_from_dataset0 and not test_language_mode[language and not test_task_mode[sample_from_dataset0 and not test_language_autodetect[sample_from_dataset0 and not test_whisper_config_constructor and not test_language_autodetect[sample_from_dataset1 and not test_language_autodetect[sample_from_dataset2 and not test_initial_prompt_hotwords[sample_from_dataset0 and not test_random_sampling[sample_from_dataset0"'
577+
cmd: 'python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py ./tests/python_tests/test_whisper_pipeline_static.py -m "not transformers_lower_v5" -k "not test_smoke[sample_from_dataset0 and not test_whisper_constructors[sample_from_dataset0 and not test_max_new_tokens[sample_from_dataset0 and not test_language_mode[language and not test_task_mode[sample_from_dataset0 and not test_language_autodetect[sample_from_dataset0 and not test_whisper_config_constructor and not test_language_autodetect[sample_from_dataset1 and not test_language_autodetect[sample_from_dataset2 and not test_initial_prompt_hotwords[sample_from_dataset0 and not test_random_sampling[sample_from_dataset0"'
578+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).whisper.test }}
579+
timeout: 45
580+
- name: 'Whisper Transformers under 5.0'
581+
cmd: |
582+
python -m pip install transformers==4.55.4
583+
python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py ./tests/python_tests/test_whisper_pipeline_static.py -m "transformers_lower_v5"
578584
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).whisper.test }}
579585
timeout: 45
580586
- name: 'Cacheopt E2E (Part 1)'
@@ -586,15 +592,29 @@ jobs:
586592
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test }}
587593
timeout: 360
588594
- name: 'LLM'
589-
cmd: 'python -m pytest -v ./tests/python_tests/test_llm_pipeline.py tests/python_tests/test_llm_pipeline_static.py tests/python_tests/test_structured_output.py tests/python_tests/test_image_generation.py tests/python_tests/test_image_generation_multi_call.py --override-ini cache_dir=/mount/caches/pytest/'
595+
cmd: 'python -m pytest -v ./tests/python_tests/test_llm_pipeline.py tests/python_tests/test_llm_pipeline_static.py tests/python_tests/test_structured_output.py tests/python_tests/test_image_generation.py tests/python_tests/test_image_generation_multi_call.py -m "not transformers_lower_v5" --override-ini cache_dir=/mount/caches/pytest/'
596+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).LLM.test || fromJSON(needs.smart_ci.outputs.affected_components).Image_generation.test }}
597+
timeout: 90
598+
- name: 'LLM with transformers under 5.0'
599+
cmd: |
600+
python -m pip install transformers==4.55.4
601+
python -m pip install --no-deps git+https://github.com/huggingface/optimum-intel.git@2c48d6430c265ac259c1b264f3e2c4025cdd7b76
602+
python -m pytest -v ./tests/python_tests/test_llm_pipeline.py tests/python_tests/test_llm_pipeline_static.py tests/python_tests/test_structured_output.py tests/python_tests/test_image_generation.py tests/python_tests/test_image_generation_multi_call.py -m "transformers_lower_v5 or transformers_dependent" --override-ini cache_dir=/mount/caches/pytest/
590603
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).LLM.test || fromJSON(needs.smart_ci.outputs.affected_components).Image_generation.test }}
591604
timeout: 90
592605
- name: 'VLM (match_optimum_with_resolutions)'
593606
cmd: 'python -m pytest -v ./tests/python_tests/test_vlm_pipeline.py -k "test_vlm_pipeline_match_optimum_with_resolutions" --override-ini cache_dir=/mount/caches/pytest/'
594607
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test }}
595608
timeout: 90
596609
- name: 'VLM'
597-
cmd: 'python -m pytest -v ./tests/python_tests/test_vlm_pipeline.py -k "not test_vlm_pipeline_match_optimum_with_resolutions" --override-ini cache_dir=/mount/caches/pytest/'
610+
cmd: 'python -m pytest -v ./tests/python_tests/test_vlm_pipeline.py -k "not test_vlm_pipeline_match_optimum_with_resolutions" -m "not transformers_lower_v5" --override-ini cache_dir=/mount/caches/pytest/'
611+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test }}
612+
timeout: 90
613+
- name: 'VLM with transformers under 5.0'
614+
cmd: |
615+
python -m pip install transformers==4.55.4
616+
python -m pip install --no-deps git+https://github.com/huggingface/optimum-intel.git@2c48d6430c265ac259c1b264f3e2c4025cdd7b76
617+
python -m pytest -v ./tests/python_tests/test_vlm_pipeline.py -m "transformers_lower_v5 or transformers_dependent" --override-ini cache_dir=/mount/caches/pytest/
598618
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test }}
599619
timeout: 90
600620
- name: 'Video Generation'
@@ -610,19 +630,34 @@ jobs:
610630
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).tokenizers.test }}
611631
timeout: 60
612632
- name: 'API tests'
613-
cmd: 'python -m pytest -v ./tests/python_tests/test_continuous_batching.py -k "not eagle3" ./tests/python_tests/test_generation_config.py ./tests/python_tests/test_sampling.py ./tests/python_tests/test_text_streamer.py'
633+
cmd: 'python -m pytest -v ./tests/python_tests/test_continuous_batching.py -k "not eagle3 and not transformers_lower_v5" ./tests/python_tests/test_generation_config.py ./tests/python_tests/test_sampling.py ./tests/python_tests/test_text_streamer.py'
634+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test || fromJSON(needs.smart_ci.outputs.affected_components).sampling.test || fromJSON(needs.smart_ci.outputs.affected_components).text_streamer.test }}
635+
timeout: 60
636+
- name: 'API tests transformers under 5.0'
637+
cmd: |
638+
python -m pip install transformers==4.55.4
639+
python -m pip install --no-deps git+https://github.com/huggingface/optimum-intel.git@2c48d6430c265ac259c1b264f3e2c4025cdd7b76
640+
python -m pytest -v ./tests/python_tests/test_continuous_batching.py -m "transformers_lower_v5 or transformers_dependent" ./tests/python_tests/test_generation_config.py ./tests/python_tests/test_sampling.py ./tests/python_tests/test_text_streamer.py
614641
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching.test || fromJSON(needs.smart_ci.outputs.affected_components).sampling.test || fromJSON(needs.smart_ci.outputs.affected_components).text_streamer.test }}
615642
timeout: 60
616643
- name: 'Rag tests'
617644
cmd: 'python -m pytest -v ./tests/python_tests/test_rag.py'
618645
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).RAG.test }}
619646
timeout: 30
620647
- name: 'WWB tests'
621-
cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava"'
648+
cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava and not transformers_lower_v5"'
649+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
650+
timeout: 120
651+
- name: 'WWB tests with transformers under 5.0'
652+
cmd: |
653+
python -m pip install transformers==4.57.0
654+
python -m pytest -v ./tools/who_what_benchmark/tests -m "transformers_dependent or transformers_lower_v5"
622655
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
623656
timeout: 120
624657
- name: 'EAGLE3 speculative decoding tests'
625658
cmd: |
659+
python -m pip install transformers==4.55.4
660+
python -m pip install --no-deps git+https://github.com/huggingface/optimum-intel.git@2c48d6430c265ac259c1b264f3e2c4025cdd7b76
626661
python -m pytest -v ./tests/python_tests/test_continuous_batching.py -k "eagle3"
627662
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).speculative_decoding.test }}
628663
timeout: 90
@@ -642,6 +677,7 @@ jobs:
642677
cmd: |
643678
# Temporary pin: depends on upstream PR #1637 (not merged yet).
644679
# TODO: replace with official release once available.
680+
python -m pip install transformers==4.57.0
645681
python -m pip install --no-deps git+https://github.com/huggingface/optimum-intel.git@cba3f3157d18f309f87e3f50f47741582ee645d3
646682
python -m pytest -s -v tests/python_tests/test_vlm_pipeline.py --override-ini cache_dir=/mount/caches/pytest/ -k "videochat"
647683
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).visual_language.test }}
@@ -723,7 +759,13 @@ jobs:
723759
build-type: [Release]
724760
test:
725761
- name: 'LLM'
726-
marker: 'llm'
762+
marker: 'llm and not transformers_lower_v5'
763+
cmd: 'tests/python_tests/samples'
764+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).LLM_samples.test }}
765+
runner: 'aks-linux-4-cores-16gb'
766+
- name: 'LLM with transformers under 5.0'
767+
extra_cmd: 'python -m pip install transformers==4.55.4 && python -m pip install --no-deps git+https://github.com/huggingface/optimum-intel.git@2c48d6430c265ac259c1b264f3e2c4025cdd7b76'
768+
marker: 'llm and (transformers_dependent or transformers_lower_v5)'
727769
cmd: 'tests/python_tests/samples'
728770
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).LLM_samples.test }}
729771
runner: 'aks-linux-4-cores-16gb'
@@ -846,7 +888,9 @@ jobs:
846888
847889
- name: Test Samples (Python and C++)
848890
if: ${{ matrix.test.run_condition }}
849-
run: python -m pytest -vvs ${{ env.SRC_DIR }}/${{ matrix.test.cmd }} -m "${{ matrix.test.marker }}"
891+
run: |
892+
${{ matrix.test.extra_cmd }}
893+
python -m pytest -vvs ${{ env.SRC_DIR }}/${{ matrix.test.cmd }} -m "${{ matrix.test.marker }}"
850894
env:
851895
LD_LIBRARY_PATH: "${{ env.INSTALL_DIR }}/runtime/lib/intel64:${{ env.INSTALL_DIR }}/runtime/3rdparty/tbb/lib:$LD_LIBRARY_PATH" # Required for C++ samples
852896
SAMPLES_PY_DIR: "${{ env.INSTALL_DIR }}/samples/python"
@@ -942,7 +986,15 @@ jobs:
942986
if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).llm_bench }}
943987
run: |
944988
source ${{ env.INSTALL_DIR }}/setupvars.sh
945-
python -m pytest -vs ${{ env.SRC_DIR }}/tests/python_tests/samples/test_tools_llm_benchmark.py -m "samples"
989+
python -m pytest -vs ${{ env.SRC_DIR }}/tests/python_tests/samples/test_tools_llm_benchmark.py -m "samples and not transformers_lower_v5"
990+
env:
991+
SAMPLES_PY_DIR: "${{ env.SRC_DIR }}/tools"
992+
- name: Test LLM Benchmark Tools transformers under 5.0
993+
if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).llm_bench }}
994+
run: |
995+
source ${{ env.INSTALL_DIR }}/setupvars.sh
996+
python -m pip install transformers==4.57.0
997+
python -m pytest -vs ${{ env.SRC_DIR }}/tests/python_tests/samples/test_tools_llm_benchmark.py -m "samples and transformers_lower_v5"
946998
env:
947999
SAMPLES_PY_DIR: "${{ env.SRC_DIR }}/tools"
9481000

@@ -1090,7 +1142,14 @@ jobs:
10901142
PYTHONPATH: "${{ env.BUILD_DIR }}:"
10911143
run: |
10921144
source ${{ env.INSTALL_DIR }}/setupvars.sh
1093-
python3 -m pytest -v ${{ env.SRC_DIR }}/tests/python_tests/test_llm_pipeline.py -k "not test_perf_metrics_with_structured_output"
1145+
python3 -m pytest -v ${{ env.SRC_DIR }}/tests/python_tests/test_llm_pipeline.py -k "not test_perf_metrics_with_structured_output" -m "not transformers_lower_v5"
1146+
- name: Run test_llm_pipeline.py when -DENABLE_XGRAMMAR=OFF and transformers under 5.0
1147+
env:
1148+
PYTHONPATH: "${{ env.BUILD_DIR }}:"
1149+
run: |
1150+
source ${{ env.INSTALL_DIR }}/setupvars.sh
1151+
python -m pip install transformers==4.55.4
1152+
python3 -m pytest -v ${{ env.SRC_DIR }}/tests/python_tests/test_llm_pipeline.py -m "transformers_lower_v5 or transformers_dependent"
10941153
10951154
Overall_Status:
10961155
name: ci/gha_overall_status_linux

.github/workflows/mac.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,14 @@ jobs:
432432
test:
433433
- name: 'Whisper'
434434
# TODO: skip some tests temporary until https://github.com/huggingface/datasets/issues/7647 dataset is fixed
435-
cmd: 'python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py -k "not test_smoke[sample_from_dataset0 and not test_whisper_constructors[sample_from_dataset0 and not test_max_new_tokens[sample_from_dataset0 and not test_language_mode[language and not test_task_mode[sample_from_dataset0 and not test_language_autodetect[sample_from_dataset0 and not test_whisper_config_constructor and not test_language_autodetect[sample_from_dataset1 and not test_language_autodetect[sample_from_dataset2 and not test_initial_prompt_hotwords[sample_from_dataset0 and not test_random_sampling[sample_from_dataset0"'
435+
cmd: 'python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py -m "not transformers_lower_v5" -k "not test_smoke[sample_from_dataset0 and not test_whisper_constructors[sample_from_dataset0 and not test_max_new_tokens[sample_from_dataset0 and not test_language_mode[language and not test_task_mode[sample_from_dataset0 and not test_language_autodetect[sample_from_dataset0 and not test_whisper_config_constructor and not test_language_autodetect[sample_from_dataset1 and not test_language_autodetect[sample_from_dataset2 and not test_initial_prompt_hotwords[sample_from_dataset0 and not test_random_sampling[sample_from_dataset0"'
436+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).whisper.test }}
437+
timeout: 120
438+
- name: 'Whisper Transformers under 5.0'
439+
cmd: |
440+
python -m pip install transformers==4.55.4
441+
python -m pip install --no-deps git+https://github.com/huggingface/optimum-intel.git@2c48d6430c265ac259c1b264f3e2c4025cdd7b76
442+
python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py -m "transformers_lower_v5" -k "not test_smoke[sample_from_dataset0 and not test_whisper_constructors[sample_from_dataset0 and not test_max_new_tokens[sample_from_dataset0 and not test_language_mode[language and not test_task_mode[sample_from_dataset0 and not test_language_autodetect[sample_from_dataset0 and not test_whisper_config_constructor and not test_language_autodetect[sample_from_dataset1 and not test_language_autodetect[sample_from_dataset2 and not test_initial_prompt_hotwords[sample_from_dataset0 and not test_random_sampling[sample_from_dataset0"
436443
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).whisper.test }}
437444
timeout: 120
438445
# Only supported on X64 or ARM with SVE support
@@ -463,7 +470,13 @@ jobs:
463470
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).RAG.test }}
464471
timeout: 30
465472
- name: 'WWB tests'
466-
cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava"'
473+
cmd: 'python -m pytest -v ./tools/who_what_benchmark/tests -m "not nanollava and not transformers_lower_v5"'
474+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
475+
timeout: 120
476+
- name: 'WWB tests with transformers under 5.0'
477+
cmd: |
478+
python -m pip install transformers==4.57.0
479+
python -m pytest -v ./tools/who_what_benchmark/tests -m "transformers_dependent or transformers_lower_v5"
467480
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).WWB.test }}
468481
timeout: 120
469482
- name: 'WWB tests (nanollava)'
@@ -526,9 +539,15 @@ jobs:
526539
build-type: [Release]
527540
test:
528541
- name: 'LLM'
529-
marker: 'llm'
542+
marker: 'llm and not transformers_lower_v5'
543+
cmd: 'tests/python_tests/samples'
544+
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).LLM_samples.test }}
545+
- name: 'LLM with transformers under 5.0'
546+
extra_cmd: 'python -m pip install transformers==4.55.4'
547+
marker: 'llm and (transformers_dependent or transformers_lower_v5)'
530548
cmd: 'tests/python_tests/samples'
531549
run_condition: ${{ fromJSON(needs.smart_ci.outputs.affected_components).LLM_samples.test }}
550+
runner: 'aks-linux-4-cores-16gb'
532551
- name: 'Whisper'
533552
marker: 'whisper'
534553
cmd: 'tests/python_tests/samples'
@@ -625,6 +644,7 @@ jobs:
625644
if: ${{ matrix.test.run_condition }}
626645
run: |
627646
source ${{ env.INSTALL_DIR }}/setupvars.sh
647+
${{ matrix.test.extra_cmd }}
628648
python -m pytest -vs ${{ env.SRC_DIR }}/${{ matrix.test.cmd }} -m "${{ matrix.test.marker }}"
629649
env:
630650
SAMPLES_PY_DIR: "${{ env.INSTALL_DIR }}/samples/python"

0 commit comments

Comments
 (0)