From 8dc70f5438c6e74d20a8e04350266ee173e615b8 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 17 Jan 2025 10:30:47 +0100 Subject: [PATCH] Use manylinux --- .github/workflows/causal_lm_cpp.yml | 4 +++- .github/workflows/genai-tools.yml | 15 ++++++++++++++- .github/workflows/linux.yml | 12 +++++++++--- src/cpp/src/make_tokenizer_stateful.hpp | 4 ++-- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/causal_lm_cpp.yml b/.github/workflows/causal_lm_cpp.yml index 9cca3141b8..58d4d3e0be 100644 --- a/.github/workflows/causal_lm_cpp.yml +++ b/.github/workflows/causal_lm_cpp.yml @@ -20,6 +20,7 @@ env: l_u22_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2025.0.0rc1/l_openvino_toolkit_ubuntu22_2025.0.0.dev20250116_x86_64.tgz m_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2025.0.0rc1/m_openvino_toolkit_macos_12_6_2025.0.0.dev20250116_x86_64.tgz w_ov_link: https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2025.0.0rc1/w_openvino_toolkit_windows_2025.0.0.dev20250116_x86_64.zip + jobs: cpp-multinomial-greedy_causal_lm-ubuntu: runs-on: ubuntu-20.04-8-cores @@ -463,6 +464,7 @@ jobs: env: PYTHONPATH: "./build/:$PYTHONPATH" LD_LIBRARY_PATH: "./build/openvino_genai/:$LD_LIBRARY_PATH" + cpp-prompt_lookup_decoding_lm-ubuntu: runs-on: ubuntu-20.04-16-cores defaults: @@ -520,6 +522,7 @@ jobs: env: PYTHONPATH: "./build/:$PYTHONPATH" LD_LIBRARY_PATH: "./build/openvino_genai/:$LD_LIBRARY_PATH" + cpp-Phi-1_5: runs-on: ubuntu-20.04-16-cores defaults: @@ -697,7 +700,6 @@ jobs: diff pred2.txt ref.txt echo "Chat sample python" passed - visual_language_chat_sample-ubuntu-minicpm_v2_6: runs-on: ubuntu-22.04-16-cores steps: diff --git a/.github/workflows/genai-tools.yml b/.github/workflows/genai-tools.yml index 75ae67efeb..dc88cc8093 100644 --- a/.github/workflows/genai-tools.yml +++ b/.github/workflows/genai-tools.yml @@ -84,6 +84,7 @@ jobs: merge-multiple: true - name: Install dependencies run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh python -m pip install ${{ env.SRC_DIR }}/thirdparty/openvino_tokenizers -v ${{ needs.openvino_download.outputs.ov_wheel_source }} python -m pip install ${{ env.SRC_DIR }} -v ${{ needs.openvino_download.outputs.ov_wheel_source }} python -m pip install -r ${{ env.LLM_BENCH_PYPATH }}/requirements.txt ${{ needs.openvino_download.outputs.ov_wheel_source }} @@ -95,6 +96,7 @@ jobs: rm -rf ./tiny-random-qwen - name: Test katuni4ka/tiny-random-baichuan2 Optimum Intel run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh optimum-cli export openvino --model katuni4ka/tiny-random-baichuan2 --trust-remote-code --weight-format fp16 ./ov_models/tiny-random-baichuan2 python ./tools/llm_bench/benchmark.py -m ./ov_models/tiny-random-baichuan2/ -d cpu -n 1 --optimum -ic 10 rm -rf ./ov_models/ @@ -106,17 +108,22 @@ jobs: jq -n -c --arg steps "4" --arg width "64" --arg height "32" --arg guidance_scale "7.0" --arg prompt "$prompt" "$json_template" >> ./image_generation.jsonl - name: Test echarlaix/tiny-random-latent-consistency Optimum Intel run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh optimum-cli export openvino --model echarlaix/tiny-random-latent-consistency --trust-remote-code --weight-format fp16 ./ov_models/tiny-random-latent-consistency python ./tools/llm_bench/benchmark.py -m ./ov_models/tiny-random-latent-consistency/ -pf ./image_generation.jsonl -d cpu -n 1 --optimum --num_steps 4 - name: Test echarlaix/tiny-random-latent-consistency with GenAI - run: python ./tools/llm_bench/benchmark.py -m ./ov_models/tiny-random-latent-consistency/ -pf ./image_generation.jsonl -d cpu -n 1 --num_steps 4 + run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh + python ./tools/llm_bench/benchmark.py -m ./ov_models/tiny-random-latent-consistency/ -pf ./image_generation.jsonl -d cpu -n 1 --num_steps 4 - name: Test echarlaix/tiny-random-latent-consistency with GenAI and LoRA run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh huggingface-cli download katuni4ka/tiny-random-latent-consistency-lora --local-dir ./lora python ./tools/llm_bench/benchmark.py -m ./ov_models/tiny-random-latent-consistency/ -pf ./image_generation.jsonl -d cpu -n 1 --num_steps 4 --lora ./lora/tiny-random-latent-consistency-lora.safetensors --lora_alphas 0.7 rm -rf ./ov_models/ ./lora ./image_generation.jsonl - name: Test TinyLlama-1.1B-Chat-v1.0 in Speculative Decoding via GenAI run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh optimum-cli export openvino --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --trust-remote-code --weight-format fp16 ov_models/TinyLlama-1.1B-Chat-v1.0/FP16 optimum-cli export openvino --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --trust-remote-code --weight-format int8 ov_models/TinyLlama-1.1B-Chat-v1.0/INT8 python ./tools/llm_bench/benchmark.py -m ./ov_models/TinyLlama-1.1B-Chat-v1.0/FP16/ --draft_model ./ov_models/TinyLlama-1.1B-Chat-v1.0/INT8/ -p "Why is the Sun yellow?" -d cpu --draft_device cpu -n 1 --assistant_confidence_threshold 0.4 -ic 20 @@ -124,6 +131,7 @@ jobs: rm -rf ov_models/TinyLlama-1.1B-Chat-v1.0 - name: Test openai/whisper-tiny via Optimum run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 --branch main --single-branch https://huggingface.co/datasets/facebook/multilingual_librispeech cd multilingual_librispeech git lfs pull -I /data/mls_polish/train/audio/3283_1447_000.tar.gz @@ -134,15 +142,18 @@ jobs: python ./tools/llm_bench/benchmark.py -m ./ov_models/whisper-tiny --media multilingual_librispeech/data/mls_polish/train/audio/3283_1447_000/3283_1447_000000.flac -d cpu -n 1 --optimum - name: Test openai/whisper-tiny via GenAI run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh python ./tools/llm_bench/benchmark.py -m ./ov_models/whisper-tiny --media multilingual_librispeech/data/mls_polish/train/audio/3283_1447_000/3283_1447_000000.flac -d cpu -n 1 rm -rf ./ov_models/whisper-tiny rm -rf multilingual_librispeech - name: Test katuni4ka/tiny-random-llava via Optimum run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh optimum-cli export openvino --model katuni4ka/tiny-random-llava ./ov_models/tiny-random-llava --task image-text-to-text --trust-remote-code python ./tools/llm_bench/benchmark.py -m ./ov_models/tiny-random-llava --media https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11 --prompt "What is unusual on this image?" -ic 20 --optimum - name: Test katuni4ka/tiny-random-llava via GenAI run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh python ./tools/llm_bench/benchmark.py -m ./ov_models/tiny-random-llava --media https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11 --prompt "What is unusual on this image?" -ic 20 rm -rf ./ov_models @@ -184,6 +195,7 @@ jobs: merge-multiple: true - name: Install dependencies run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh python -m pip install ${{ env.SRC_DIR }}/thirdparty/openvino_tokenizers -v ${{ needs.openvino_download.outputs.ov_wheel_source }} python -m pip install ${{ env.SRC_DIR }} -v ${{ needs.openvino_download.outputs.ov_wheel_source }} python -m pip install -r ${{ env.WWB_PATH }}/requirements.txt ${{ needs.openvino_download.outputs.ov_wheel_source }} @@ -191,6 +203,7 @@ jobs: working-directory: ${{ env.OV_INSTALL_DIR }} - name: WWB Tests run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh python -m pip install -v ${{ env.WWB_PATH }} python -m pytest -v ${{ env.WWB_PATH }}/tests diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b9dc591566..52183602b8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -164,6 +164,7 @@ jobs: - name: Build Tokenizers Wheel run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh python -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} \ --config-settings=override=cross.arch="manylinux_2_31_x86_64" \ ${{ needs.openvino_download.outputs.ov_wheel_source }} \ @@ -172,6 +173,7 @@ jobs: - name: Build GenAI Wheel run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh python -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} \ --config-settings=override=cross.arch="manylinux_2_31_x86_64" \ ${{ needs.openvino_download.outputs.ov_wheel_source }} \ @@ -374,18 +376,22 @@ jobs: - name: Test multinomial_causal_lm.py if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only timeout-minutes: 1 - run: ${{ env.INSTALL_DIR }}/samples/python/text_generation/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 + run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh + ${{ env.INSTALL_DIR }}/samples/python/text_generation/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0 working-directory: ${{ env.MODELS_DIR }} - name: Test whisper_speech_recognition.py if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only timeout-minutes: 1 - run: ${{ env.INSTALL_DIR }}/samples/python/whisper_speech_recognition/whisper_speech_recognition.py ./whisper-tiny/ how_are_you_doing_today.wav + run: | + source ${{ env.OV_INSTALL_DIR }}/setupvars.sh + ${{ env.INSTALL_DIR }}/samples/python/whisper_speech_recognition/whisper_speech_recognition.py ./whisper-tiny/ how_are_you_doing_today.wav working-directory: ${{ env.MODELS_DIR }} - name: C++ Tests Prerequisites run: python -m pip uninstall openvino openvino-tokenizers openvino-genai -y - + - name: Test greedy_causal_lm run: | source ${{ env.INSTALL_DIR }}/setupvars.sh diff --git a/src/cpp/src/make_tokenizer_stateful.hpp b/src/cpp/src/make_tokenizer_stateful.hpp index 1f25d2ad21..9ad06ae07a 100644 --- a/src/cpp/src/make_tokenizer_stateful.hpp +++ b/src/cpp/src/make_tokenizer_stateful.hpp @@ -34,7 +34,7 @@ namespace genai { **/ class MakeCombineSegmentsSatateful : public ov::pass::ModelPass { public: - OPENVINO_RTTI("MakeCombineSegmentsSatateful", "0"); + OPENVINO_MODEL_PASS_RTTI("MakeCombineSegmentsSatateful"); bool run_on_model(const std::shared_ptr& model) override; }; @@ -70,7 +70,7 @@ class MakeCombineSegmentsSatateful : public ov::pass::ModelPass { **/ class MakeVocabDecoderSatateful : public ov::pass::ModelPass { public: - OPENVINO_RTTI("MakeVocabDecoderSatateful", "0"); + OPENVINO_MODEL_PASS_RTTI("MakeVocabDecoderSatateful"); bool run_on_model(const std::shared_ptr& model) override; };