Skip to content

Commit 43fdc96

Browse files
Wovchenailya-lavrenoveaidovaas-suvorovyatarkan
authored
Merge releases/2024/2 into master (openvinotoolkit#533)
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com> Co-authored-by: Alexander Suvorov <alexander.suvorov@intel.com> Co-authored-by: Yaroslav Tarkan <yaroslav.tarkan@intel.com> Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> Co-authored-by: Pavel Esir <pavel.esir@gmail.com> Co-authored-by: guozhong wang <guozhong.wang@intel.com>
1 parent 1ee58c4 commit 43fdc96

File tree

29 files changed

+440
-160
lines changed

29 files changed

+440
-160
lines changed

.github/workflows/causal_lm_cpp.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Download, convert and build
3030
run: |
3131
source ./ov/setupvars.sh
32-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
32+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
3333
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
3434
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model openlm-research/open_llama_3b_v2 open_llama_3b_v2
3535
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -68,7 +68,7 @@ jobs:
6868
- name: Download, convert and build
6969
run: |
7070
source ./ov/setupvars.sh
71-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
71+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
7272
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
7373
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
7474
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -201,7 +201,7 @@ jobs:
201201
- name: Download, convert and build
202202
run: |
203203
call .\ov\setupvars.bat
204-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
204+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
205205
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
206206
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
207207
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -246,7 +246,7 @@ jobs:
246246
- name: Download, convert and build
247247
run: |
248248
source ./ov/setupvars.sh
249-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
249+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
250250
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
251251
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model Qwen/Qwen-7B-Chat Qwen-7B-Chat
252252
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -273,7 +273,7 @@ jobs:
273273
- name: Download, convert and build
274274
run: |
275275
source ./ov/setupvars.sh
276-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
276+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
277277
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
278278
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model Qwen/Qwen1.5-7B-Chat Qwen1.5-7B-Chat
279279
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -301,7 +301,7 @@ jobs:
301301
- name: Download, convert and build
302302
run: |
303303
source ./ov/setupvars.sh
304-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
304+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
305305
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
306306
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model microsoft/phi-2 phi-2
307307
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -329,7 +329,7 @@ jobs:
329329
- name: Download, convert and build
330330
run: |
331331
source ./ov/setupvars.sh
332-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
332+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
333333
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
334334
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model argilla/notus-7b-v1 notus-7b-v1
335335
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -357,7 +357,7 @@ jobs:
357357
- name: Download, convert and build
358358
run: |
359359
source ./ov/setupvars.sh
360-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
360+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
361361
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
362362
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model databricks/dolly-v2-3b dolly-v2-3b
363363
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model databricks/dolly-v2-7b dolly-v2-7b
@@ -395,7 +395,7 @@ jobs:
395395
- name: Download, convert and build
396396
run: |
397397
source ./ov/setupvars.sh
398-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
398+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
399399
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
400400
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
401401
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -439,7 +439,7 @@ jobs:
439439
- name: Download, convert and build
440440
run: |
441441
source ./ov/setupvars.sh
442-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
442+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
443443
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
444444
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model microsoft/phi-1_5 phi-1_5
445445
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
@@ -487,7 +487,7 @@ jobs:
487487
- name: Download, convert and build
488488
run: |
489489
source ./ov/setupvars.sh
490-
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
490+
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
491491
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
492492
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model ikala/redpajama-3b-chat redpajama-3b-chat
493493
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/

.github/workflows/genai_package.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/
2525
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j
2626
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
27-
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
27+
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
2828
- run: source ./ov/setupvars.sh && optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
2929
- run: source ./ov/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov
3030
- run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace
@@ -53,7 +53,7 @@ jobs:
5353
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/
5454
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j
5555
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
56-
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
56+
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
5757
- run: source ./ov/setupvars.sh && optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
5858
- run: source ./ov/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov
5959
- run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace
@@ -93,7 +93,7 @@ jobs:
9393
- run: call ov\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/
9494
- run: call ov\setupvars.bat && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j
9595
- run: call ov\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
96-
- run: call ov\setupvars.bat && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt
96+
- run: call ov\setupvars.bat && python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
9797
- run: call ov\setupvars.bat && optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
9898
- run: call ov\setupvars.bat && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov
9999
- run: call ov\samples\cpp\build_samples_msvc.bat -i "${{ github.workspace }}/samples_install"

CMakeLists.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ add_subdirectory(samples)
3838

3939
install(FILES LICENSE DESTINATION licensing COMPONENT licensing_genai RENAME LICENSE-GENAI)
4040
install(FILES third-party-programs.txt DESTINATION licensing COMPONENT licensing_genai RENAME third-party-programs-genai.txt)
41-
41+
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
4242
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
43-
if(WIN32 AND NOT DEFINED CPACK_GENERATOR)
44-
set(CPACK_GENERATOR "ZIP")
45-
endif()
4643
include(CPack)

README.md

+37-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1-
## GenAI Pipeline Repository
1+
# OpenVINO™ GenAI
22

3-
The GenAI repository contains pipelines that implement image and text generation tasks.
4-
The implementation uses OpenVINO capabilities to optimize the pipelines. Each sample covers
5-
a family of models and suggests certain modifications to adapt the code to specific needs.
6-
It includes the following pipelines:
3+
The OpenVINO™ GenAI repository consists of the GenAI library and additional GenAI samples.
74

8-
1. [Benchmarking script for large language models](./llm_bench/python/)
9-
2. [Text generation C++ samples that support most popular models like LLaMA 2](./text_generation/causal_lm/cpp/)
10-
3. [Stable Diffuison (with LoRA) C++ image generation pipeline](./image_generation/stable_diffusion_1_5/cpp/)
11-
4. [Latent Consistency Model (with LoRA) C++ image generation pipeline](./image_generation/lcm_dreamshaper_v7/cpp/)
5+
## OpenVINO™ GenAI Library
126

13-
### License
7+
OpenVINO™ GenAI is a flavor of OpenVINO, aiming to simplify running inference of generative AI models.
8+
It hides the complexity of the generation process and minimizes the amount of code required.
149

15-
The GenAI repository is licensed under [Apache License Version 2.0](LICENSE).
16-
By contributing to the project, you agree to the license and copyright terms therein and release
17-
your contribution under these terms.
10+
For installation and usage instructions, refer to the [GenAI Library README](./src/README.md).
11+
12+
## OpenVINO™ GenAI Samples
13+
14+
The OpenVINO™ GenAI repository contains pipelines that implement image and text generation tasks.
15+
The implementation uses OpenVINO capabilities to optimize the pipelines. Each sample covers
16+
a family of models and suggests certain modifications to adapt the code to specific needs.
17+
It includes the following pipelines:
1818

19-
## Requirements
19+
1. [Benchmarking script for large language models](./llm_bench/python/README.md)
20+
2. Text generation samples that support most popular models like LLaMA 2:
21+
- Python:
22+
1. [beam_search_causal_lm](./samples/python/beam_search_causal_lm/README.md)
23+
2. [chat_sample](./samples/python/chat_sample/README.md)
24+
3. [greedy_causal_lm](./samples/python/greedy_causal_lm/README.md)
25+
4. [multinomial_causal_lm](./samples/python/multinomial_causal_lm/README.md)
26+
- C++:
27+
1. [beam_search_causal_lm](./samples/cpp/beam_search_causal_lm/README.md)
28+
2. [chat_sample](./samples/cpp/chat_sample/README.md)
29+
3. [greedy_causal_lm](./samples/cpp/greedy_causal_lm/README.md)
30+
4. [multinomial_causal_lm](./samples/cpp/multinomial_causal_lm/README.md)
31+
5. [prompt_lookup_decoding_lm](./samples/cpp/prompt_lookup_decoding_lm/README.md)
32+
6. [speculative_decoding_lm](./samples/cpp/speculative_decoding_lm/README.md)
33+
3. [Stable Diffuison (with LoRA) C++ image generation pipeline](./image_generation/stable_diffusion_1_5/cpp/README.md)
34+
4. [Latent Consistency Model (with LoRA) C++ image generation pipeline](./image_generation/lcm_dreamshaper_v7/cpp/README.md)
35+
36+
### Requirements
2037

2138
Requirements may vary for different samples. See respective readme files for more details,
2239
and make sure to install the OpenVINO version listed there. Refer to documentation to see
@@ -25,3 +42,9 @@ and make sure to install the OpenVINO version listed there. Refer to documentati
2542
The supported devices are CPU and GPU including Intel discrete GPU.
2643

2744
See also: https://docs.openvino.ai/2023.3/gen_ai_guide.html.
45+
46+
## License
47+
48+
The OpenVINO™ GenAI repository is licensed under [Apache License Version 2.0](LICENSE).
49+
By contributing to the project, you agree to the license and copyright terms therein and release
50+
your contribution under these terms.

image_generation/lcm_dreamshaper_v7/cpp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OpenVINO Latent Consistency Model C++ image generation pipeline
2-
The pure C++ text-to-image pipeline, driven by the OpenVINO native API for SD v1.5 Latent Consistency Model with LCM Scheduler. It includes advanced features like LoRA integration with safetensors and [OpenVINO Tokenizers](https://github.com/openvinotoolkit/openvino_tokenizers). Loading `openvino_tokenizers` to `ov::Core` enables tokenization. [The common folder](../../common/) contains schedulers for image generation and `imwrite()` for saving `bmp` images. This demo has been tested for Linux platform only. There is also a Jupyter [notebook](https://github.com/openvinotoolkit/openvino_notebooks/blob/main/notebooks/263-latent-consistency-models-image-generation/263-lcm-lora-controlnet.ipynb) which provides an example of image generaztion in Python.
2+
The pure C++ text-to-image pipeline, driven by the OpenVINO native API for SD v1.5 Latent Consistency Model with LCM Scheduler. It includes advanced features like LoRA integration with safetensors and [OpenVINO Tokenizers](https://github.com/openvinotoolkit/openvino_tokenizers). Loading `openvino_tokenizers` to `ov::Core` enables tokenization. [The common folder](../../common/) contains schedulers for image generation and `imwrite()` for saving `bmp` images. This demo has been tested for Linux platform only. There is also a Jupyter [notebook](https://github.com/openvinotoolkit/openvino_notebooks/blob/latest/notebooks/latent-consistency-models-image-generation/lcm-lora-controlnet.ipynb) which provides an example of image generaztion in Python.
33

44
> [!NOTE]
55
> This tutorial assumes that the current working directory is `<openvino.genai repo>/image_generation/lcm_dreamshaper_v7/cpp/` and all paths are relative to this folder.

image_generation/stable_diffusion_1_5/cpp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OpenVINO Stable Diffusion (with LoRA) C++ image generation pipeline
2-
The pure C++ text-to-image pipeline, driven by the OpenVINO native C++ API for Stable Diffusion v1.5 with LMS Discrete Scheduler, supports both static and dynamic model inference. It includes advanced features like [LoRA](https://huggingface.co/docs/peft/conceptual_guides/lora) integration with [safetensors](https://huggingface.co/docs/safetensors/index#format) and [OpenVINO Tokenizers](https://github.com/openvinotoolkit/openvino_tokenizers). Loading `openvino_tokenizers` to `ov::Core` enables tokenization. The sample uses [diffusers](../../common/diffusers) for image generation and [imwrite](../../common/imwrite) for saving `.bmp` images. This demo has been tested on Windows and Unix platforms. There is also a Jupyter [notebook](https://github.com/openvinotoolkit/openvino_notebooks/blob/main/notebooks/225-stable-diffusion-text-to-image/225-stable-diffusion-text-to-image.ipynb) which provides an example of image generation in Python.
2+
The pure C++ text-to-image pipeline, driven by the OpenVINO native C++ API for Stable Diffusion v1.5 with LMS Discrete Scheduler, supports both static and dynamic model inference. It includes advanced features like [LoRA](https://huggingface.co/docs/peft/conceptual_guides/lora) integration with [safetensors](https://huggingface.co/docs/safetensors/index#format) and [OpenVINO Tokenizers](https://github.com/openvinotoolkit/openvino_tokenizers). Loading `openvino_tokenizers` to `ov::Core` enables tokenization. The sample uses [diffusers](../../common/diffusers) for image generation and [imwrite](../../common/imwrite) for saving `.bmp` images. This demo has been tested on Windows and Unix platforms. There is also a Jupyter [notebook](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/stable-diffusion-text-to-image) which provides an example of image generation in Python.
33

44
> [!NOTE]
55
>This tutorial assumes that the current working directory is `<openvino.genai repo>/image_generation/stable_diffusion_1_5/cpp/` and all paths are relative to this folder.

0 commit comments

Comments
 (0)