OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
NPU GenAI Docs update (#32357)
Dmitry Matveevaf45397b84b5
diff --git a/docs/articles_en/openvino-workflow-generative/inference-with-genai/inference-with-genai-on-npu.rst b/docs/articles_en/openvino-workflow-generative/inference-with-genai/inference-with-genai-on-npu.rstindex 78ea79d132d..237d403b479 100644--- a/docs/articles_en/openvino-workflow-generative/inference-with-genai/inference-with-genai-on-npu.rst+++ b/docs/articles_en/openvino-workflow-generative/inference-with-genai/inference-with-genai-on-npu.rst@@ -1,8 +1,8 @@-NPU with OpenVINO GenAI+OpenVINO GenAI on NPU===============================================================================================.. meta::- :description: Learn how to use OpenVINO GenAI to execute LLM models on NPU.+ :description: Learn how to use OpenVINO GenAI to execute LLMs and other pipelines on NPU.This guide will give you extra details on how to use NPU with OpenVINO GenAI.@@ -12,7 +12,7 @@ for information on how to start.Prerequisites###############################################################################################-Install required dependencies:+First, install the required dependencies for the model conversion:.. tab-set::@@ -21,8 +21,8 @@ Install required dependencies:.. code-block:: consolepython3 -m venv npu-env- npu-env/bin/activate- pip install nncf==2.14.1 onnx==1.17.0 optimum-intel==1.22.0+ source npu-env/bin/activate+ pip install nncf==2.18.0 onnx==1.18.0 optimum-intel==1.25.2 transformers==4.51.3pip install openvino==2025.3 openvino-tokenizers==2025.3 openvino-genai==2025.3@@ -39,7 +39,7 @@ Install required dependencies:python -m venv npu-envnpu-env\Scripts\activate- pip install nncf==2.14.1 onnx==1.17.0 optimum-intel==1.22.0+ pip install nncf==2.18.0 onnx==1.18.0 optimum-intel==1.25.2 transformers==4.51.3pip install openvino==2025.3 openvino-tokenizers==2025.3 openvino-genai==2025.3@@ -49,124 +49,121 @@ Install required dependencies:pip install --pre openvino openvino-tokenizers openvino-genai --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly+.. note::-Note that for systems based on Intel® Core™ Ultra Processors Series 2, more than 16GB of RAM-may be required to run prompts over 1024 tokens on models exceeding 7B parameters,-such as Llama-2-7B, Mistral-0.2-7B, and Qwen-2-7B.--Make sure your model works with NPU. Some models may not be supported, for example,-**the FLUX.1 pipeline is currently not supported by the device**.+ With OpenVINO 2025.3, it is highly recommended to use ``transformers==4.51.3`` to+ generate models for Intel NPU. Newer Transformers versions will be supported in upcoming releases.-Currently, the Whisper pipeline (using:-`whisper-tiny <https://huggingface.co/openai/whisper-tiny>`__,-`whisper-base <https://huggingface.co/openai/whisper-base>`__,-`whisper-small <https://huggingface.co/openai/whisper-small>`__, or-`whisper-large <https://huggingface.co/openai/whisper-large>`__)-only accepts stateless models. The pipeline will convert stateful models to stateless models automatically or you can manually generate stateless models with the ``--disable-stateful`` flag.-Here is a conversion example:+.. note::-.. code:: console+ For systems based on Intel® Core™ Ultra Processors Series 2, more than 16GB of RAM+ may be required to process prompts longer than 1024 tokens with models exceeding 7B parameters,+ such as Llama-2-7B, Mistral-0.2-7B, and Qwen-2-7B.- optimum-cli export openvino --trust-remote-code --model openai/whisper-tiny whisper-tiny --disable-stateful+LLM Inference on NPU+###############################################################################################+Export LLMs from Hugging Face+***********************************************************************************************+Optimum Intel is the primary way to export Hugging Face models for inference on NPU.+LLMs **must** be exported with the following settings:-Export an LLM model via Hugging Face Optimum-Intel-###############################################################################################+* Symmetric weights compression: ``--sym``;+* 4-bit weight format (INT4 or NF4): ``--weight-format int4`` or ``--weight-format nf4``;+* Channel-wise or group-wise weight quantization: ``--group-size -1`` or ``--group-size 128``;+* Maximize the 4-bit weight ratio in the model: ``--ratio 1.0``.-Since **symmetrically-quantized 4-bit (INT4) models are preferred for inference on NPU**, make-sure to export the model with the proper conversion and optimization settings.+**Group quantization** (GQ) with group size ``128`` is recommended for smaller models, e.g. up to+4B--5B parameters. Larger models may also work with group-quantization, but normally demonstrate+a better performance with channel-wise quantization.-| You may export LLMs via Optimum-Intel, using one of two compression methods:-| **group quantization** - for both smaller and larger models,-| **channel-wise quantization** - remarkably effective but for models exceeding 1 billion parameters.+**Channel-wise quantization** (CW) generally offers the best performance but may reduce model accuracy. OpenVINO+Neural Network Compression Framework (NNCF) provides several methods to compensate for the quality loss,+such as data-aware compression methods or GPTQ.-You select one of the methods by setting the ``--group-size`` parameter to either ``128`` or-``-1``, respectively. See the following examples:+The full ``optimum-cli`` command examples are shown below:.. tab-set::- .. tab-item:: Channel-wise quantization+ .. tab-item:: INT4-CW- .. tab-set::+ INT4 Symmetric channel-wise data-free compression:++ .. code-block:: console+ :name: channel-wise-data-free-quant- .. tab-item:: Data-free quantization+ optimum-cli export openvino -m meta-llama/Meta-Llama-3.1-8B-Instruct --weight-format int4 --sym --ratio 1.0 --group-size -1 Meta-Llama-3.1-8B-Instruct+ .. tab-item:: INT4-CW, data-aware- .. code-block:: console- :name: channel-wise-data-free-quant+ INT4 Symmetric data-aware channel-wise compression:- optimum-cli export openvino -m meta-llama/Llama-2-7b-chat-hf --weight-format int4 --sym --ratio 1.0 --group-size -1 Llama-2-7b-chat-hf+ Use Scale Estimation (``--scale_estimation``) and/or AWQ (``--awq``) to improve accuracy+ for the channel-wise quantized models. Note that these options require a dataset+ (``--dataset <dataset_name>``). Refer to ``optimum-cli`` and NNCF documentation for more details.- .. tab-item:: Data-aware quantization+ .. code-block:: console+ :name: channel-wise-data-aware-quant- If you want to improve accuracy, make sure you:+ optimum-cli export openvino -m meta-llama/Meta-Llama-3.1-8B-Instruct --weight-format int4 --sym --group-size -1 --ratio 1.0 --awq --scale-estimation --dataset wikitext2 Meta-Llama-3.1-8B-Instruct- 1. Update NNCF: ``pip install nncf==2.13``- 2. Use ``--scale_estimation --dataset <dataset_name>`` and accuracy aware quantization ``--awq``:+ .. tab-item:: NF4-CW- .. code-block:: console- :name: channel-wise-data-aware-quant+ NF4 Symmetric data-free channel-wise compression:- optimum-cli export openvino -m meta-llama/Llama-2-7b-chat-hf --weight-format int4 --sym --group-size -1 --ratio 1.0 --awq --scale-estimation --dataset wikitext2 Llama-2-7b-chat-hf+ .. code-block:: console+ :name: channel-wise-data-free-quant-nf4+ optimum-cli export openvino -m meta-llama/Meta-Llama-3.1-8B-Instruct --weight-format nf4 --sym --group-size -1 --ratio 1.0 Meta-Llama-3.1-8B-Instruct- .. important::+ Usually, NF4-CW provides a better accuracy compared to INT4-CW even with data-free compression. Data-aware methods are also available and can further improve the compressed model accuracy.- Remember that the negative value of ``-1`` is required here, not ``1``.+ .. tab-item:: INT4-GQ- .. tab-item:: Group quantization+ INT4 Symmetric data-free group quantization:.. code-block:: console:name: group-quant- optimum-cli export openvino -m TinyLlama/TinyLlama-1.1B-Chat-v1.0 --weight-format int4 --sym --ratio 1.0 --group-size 128 TinyLlama-1.1B-Chat-v1.0-+ optimum-cli export openvino -m microsoft/Phi-3.5-mini-instruct --weight-format int4 --sym --ratio 1.0 --group-size 128 Phi-3.5-mini-instruct+ Data-aware methods are also available for the group-quantized models and can further improve the compressed model accuracy.-You can also try using 4-bit (INT4)-`GPTQ models <https://huggingface.co/models?other=gptq,4-bit&sort=trending>`__,-which do not require specifying quantization parameters:+.. note::-.. code-block:: console+ The NF4 data type is only supported on Intel® Core Ultra Processors Series 2 NPUs (formerly+ codenamed Lunar Lake) and beyond. Use channel-wise quantization with NF4.- optimum-cli export openvino -m TheBloke/Llama-2-7B-Chat-GPTQ+.. important::+ For the channel-wise quantization, the group size argument must be ``-1`` ("minus one"), not ``1``.-| Remember, NPU supports GenAI models quantized symmetrically to INT4.-| Below is a list of such models:+There are pre-compressed models on Hugging Face that can be exported as-is, for example:-* meta-llama/Meta-Llama-3-8B-Instruct-* meta-llama/Llama-3.1-8B-* microsoft/Phi-3-mini-4k-instruct-* Qwen/Qwen2-7B-* mistralai/Mistral-7B-Instruct-v0.2-* openbmb/MiniCPM-1B-sft-bf16-* TinyLlama/TinyLlama-1.1B-Chat-v1.0-* TheBloke/Llama-2-7B-Chat-GPTQ-* Qwen/Qwen2-7B-Instruct-GPTQ-Int4+* 4-bit (INT4) `GPTQ models <https://huggingface.co/models?other=gptq,4-bit&sort=trending>`__,+* `LLMs optimized for NPU <https://huggingface.co/collections/OpenVINO/llms-optimized-for-npu-686e7f0bf7bc184bd71f8ba0>`__, hosted and maintained by OpenVINO.-.. note::+In this case, the commands are as simple as:- Pre-converted models optimized for NPU are available on `Hugging Face <https://huggingface.co/collections/OpenVINO/llms-optimized-for-npu-686e7f0bf7bc184bd71f8ba0>`__-+.. code-block:: console-Run generation using OpenVINO GenAI-###############################################################################################+ optimum-cli export openvino -m TheBloke/Llama-2-7B-Chat-GPTQ+ optimum-cli export openvino -m OpenVINO/Mistral-7B-Instruct-v0.2-int4-cw-ov-It is typically recommended to install the latest available-`driver <https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html>`__.+Run text generation+***********************************************************************************************+It is recommended to install the latest available+`NPU driver <https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html>`__.Use the following code snippet to perform generation with OpenVINO GenAI API.-.. tab-set::.. tab-item:: Python:sync: py.. code-block:: python- :emphasize-lines: 4import openvino_genai as ov_genaimodel_path = "TinyLlama"@@ -177,7 +174,6 @@ Use the following code snippet to perform generation with OpenVINO GenAI API.:sync: cpp.. code-block:: cpp- :emphasize-lines: 7, 9#include "openvino/genai/llm_pipeline.hpp"#include <iostream>@@ -192,7 +188,12 @@ Use the following code snippet to perform generation with OpenVINO GenAI API.Additional configuration options-###############################################################################################+***********************************************************************************************++.. important::++ The options described in this article are specific to the NPU device and+ may not work with other devices.Prompt and response length options+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@@ -200,16 +201,28 @@ Prompt and response length optionsThe LLM pipeline for NPUs leverages the static shape approach, optimizing execution performance,while potentially introducing certain usage limitations. By default, the LLM pipeline supportsinput prompts up to 1024 tokens in length. It also ensures that the generated response contains-at least 150 tokens, unless the generation encounters the end-of-sequence (EOS) token or the+at least 128 tokens, unless the generation encounters the end-of-sequence (EOS) token or theuser explicitly sets a lower length limit for the response.You may configure both the 'maximum input prompt length' and 'minimum response length' usingthe following parameters:-* ``MAX_PROMPT_LEN`` - defines the maximum number of tokens that the LLM pipeline can process+* ``MAX_PROMPT_LEN`` -- defines the maximum number of tokens that the LLM pipeline can processfor the input prompt (default: 1024),-* ``MIN_RESPONSE_LEN`` - defines the minimum number of tokens that the LLM pipeline will generate- in its response (default: 150).+* ``MIN_RESPONSE_LEN`` -- defines the minimum number of tokens that the LLM pipeline can generate+ in its response (default: 128).++The maximum context size for an LLM on NPU is defined as the sum of these two values. By default,+if the input prompt is shorter than ``MAX_PROMPT_LEN`` tokens, time to first+token (TTFT) remains the same as if a full-length prompt was passed. However, a shorter prompt+allows the model to generate more tokens within the available context. For example, if the input+prompt is just 30 tokens, the model can generate up to :math:`1024 + 128 - 30 = 1122` tokens.++OpenVINO 2025.3 has introduced dynamic input prompt support for NPU. The dynamism granularity is+controlled by the new property ``NPUW_LLM_PREFILL_CHUNK_SIZE`` (default: 1024).++If the ``MAX_PROMPT_LEN`` property is set to a value greater than the chunk size, the mechanism+is activated automatically. Set ``PREFILL_HINT`` to ``STATIC`` to disable this feature.Use the following code snippet to change the default settings:@@ -231,31 +244,68 @@ Use the following code snippet to change the default settings:ov::AnyMap pipeline_config = { { "MAX_PROMPT_LEN", 1024 }, { "MIN_RESPONSE_LEN", 512 } };ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);+In the GenAI LLM chat scenarios, the conversation history is accumulated in the context and may require+a larger ``MAX_PROMPT_LEN`` to handle the history properly.-Cache compiled models+Performance hints+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-By caching compiled models, you may shorten the initialization time of the future pipeline-runs. To do so, specify one of the following options in ``pipeline_config`` for NPU pipeline.+You can configure the NPU LLM pipeline using the ``PREFILL_HINT`` and ``GENERATE_HINT`` options+to fine-tune performance. These options impact prompt processing (first token)+and text generation (subsequent tokens) behavior, respectively.-NPUW_CACHE_DIR------------------------------------------------------------------------------------------------+``PREFILL_HINT`` -- fine-tunes the prompt processing stage:++* ``DYNAMIC`` (default since OpenVINO 2025.3) -- enables dynamic prompt execution, supports longer prompts.+* ``STATIC`` -- disables dynamic prompt execution, may provide better performance for specific prompt sizes.+ Default behavior before OpenVINO 2025.3.++``GENERATE_HINT`` -- fine-tunes the text generation stage:++* ``FAST_COMPILE`` (default) -- enables fast compilation at the expense of performance,+* ``BEST_PERF`` -- ensures the best possible performance at lower compilation speed.++Use the following code snippet:++.. tab-set::-``NPUW_CACHE_DIR`` is the most basic option of caching compiled subgraphs without weights and-reusing them for future pipeline runs.+ .. tab-item:: Python+ :sync: py++ .. code-block:: python+ pipeline_config = { "GENERATE_HINT": "BEST_PERF" }+ pipe = ov_genai.LLMPipeline(model_path, "NPU", pipeline_config)++ .. tab-item:: C+++ :sync: cpp++ .. code-block:: cpp++ ov::AnyMap pipeline_config = { { "GENERATE_HINT", "BEST_PERF" } };+ ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);+++Caching and ahead-of-time compilation+***********************************************************************************************++LLM compilation for NPU happens on-the-fly and may take substantial time. To+improve user experience, the following options are available: OpenVINO Caching and Ahead-of-time+(AoT) compilation.++OpenVINO Caching++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++By caching compiled models, you can reduce the initialization time for subsequent pipeline+runs. To do so, specify one of the following options in ``pipeline_config`` for the NPU pipeline.CACHE_DIR------------------------------------------------------------------------------------------------``CACHE_DIR`` operates similarly to the older ``NPUW_CACHE_DIR``, except for the differences below:--* It creates a single ".blob" file and loads it faster.-* Blob type is defined by ``"CACHE_MODE"``. By default it's ``"OPTIMIZE_SIZE"``, in which case NPUW- produces weightless blob, so either original weights file or ``ov::Model`` object is required- to load such a blob.-* Optionally, you can cache a blob with weights inside making it much bigger than the default- weightless blob. To do so, you need to pass ``"CACHE_MODE" : "OPTIMIZE_SPEED"`` in the config.+``CACHE_DIR`` is the default OpenVINO caching mechanism. The ``CACHE_MODE``+hint defines how the cached blob stores weights. ``OPTIMIZE_SPEED`` includes the weights+and allows faster loading for group-quantized models. ``OPTIMIZE_SIZE`` excludes the weights,+producing a weightless blob, and requires the original model to be present on disk... tab-set::@@ -275,25 +325,34 @@ CACHE_DIRov::AnyMap pipeline_config = { { "CACHE_DIR", ".npucache" } };ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);--'Ahead of time' compilation+NPUW_CACHE_DIR-----------------------------------------------------------------------------------------------+``NPUW_CACHE_DIR`` is a legacy NPU-specific weightless caching option. Since OpenVINO 2025.1,+the preferred device-neutral caching mechanism is the OpenVINO caching (``CACHE_DIR``).+++Ahead-of-time compilation+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Specifying ``EXPORT_BLOB`` and ``BLOB_PATH`` parameters works similarly to ``CACHE_DIR`` but:* It allows to explicitly specify where to **store** the compiled model.* For subsequent runs, it requires the same ``BLOB_PATH`` to **import** the compiled model.-* Blob type is defined by ``"CACHE_MODE"``. By default it's ``"OPTIMIZE_SIZE"``, in which case NPUW- produces weightless blob, so either original weights file or ``ov::Model`` object is required- to load such a blob.-* To export a blob with weights you need to pass ``"CACHE_MODE" : "OPTIMIZE_SPEED"`` in the config.+* Blob type is also defined by ``CACHE_MODE``.++ * By default, ``OPTIMIZE_SIZE`` is used, producing a weightless blob. To load this blob, either the original weights file or an ``ov::Model`` object is required.+ * Pass ``OPTIMIZE_SPEED`` to export a blob with full weights.+* If the blob is exported as weightless you also need to either provide- ``"WEIGHTS_PATH" : "path\\to\\original\\model.bin"`` or ``"MODEL_PTR" : original ov::Model object``.+ ``"WEIGHTS_PATH" : "path\\to\\original\\model.bin"`` or ``"MODEL_PTR" : original ov::Model object`` in the config.* Ahead-of-time import in weightless mode has been optimized to consume less memory than during regular compilation or using ``CACHE_DIR``.+The following snippets demonstrate the functionality:+.. tab-set::- .. tab-item:: Export weightless example+ .. tab-item:: Weightless export.. tab-set::@@ -313,8 +372,8 @@ Specifying ``EXPORT_BLOB`` and ``BLOB_PATH`` parameters works similarly to ``CACov::AnyMap pipeline_config = { { "EXPORT_BLOB", "YES" }, { "BLOB_PATH", ".npucache\\compiled_model.blob" } };ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);-- .. tab-item:: Import weightless example++ .. tab-item:: Weightless import.. tab-set::@@ -334,8 +393,8 @@ Specifying ``EXPORT_BLOB`` and ``BLOB_PATH`` parameters works similarly to ``CACov::AnyMap pipeline_config = { { "BLOB_PATH", ".npucache\\compiled_model.blob" }, { "WEIGHTS_PATH", "path\\to\\original\\model.bin" } };ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);-- .. tab-item:: Export with weights example++ .. tab-item:: Full-weight export.. tab-set::@@ -355,8 +414,8 @@ Specifying ``EXPORT_BLOB`` and ``BLOB_PATH`` parameters works similarly to ``CACov::AnyMap pipeline_config = { { "EXPORT_BLOB", "YES" }, { "BLOB_PATH", ".npucache\\compiled_model.blob" }, { "CACHE_MODE", "OPTIMIZE_SPEED" } };ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);-- .. tab-item:: Import with weights example++ .. tab-item:: Full-weight import.. tab-set::@@ -379,9 +438,9 @@ Specifying ``EXPORT_BLOB`` and ``BLOB_PATH`` parameters works similarly to ``CACBlob encryption------------------------------------------------------------------------------------------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-When exporting NPUW blobs you can also specify encryption and decryption functions for the blob.+When exporting NPU LLM blobs, you can also specify encryption and decryption functions for the blob.In case of weightless blob the whole blob is encrypted, in case of blob with weights everything butmodel weights is encrypted.@@ -400,7 +459,7 @@ model weights is encrypted.encryption_callbacks.encrypt = [](const std::string& s) { return s; };ov::AnyMap pipeline_config = { { "EXPORT_BLOB", "YES" }, { "BLOB_PATH", ".npucache\\compiled_model.blob" }, { "CACHE_ENCRYPTION_CALLBACKS", encryption_callbacks } };ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);-+.. tab-item:: Import example.. tab-set::@@ -416,66 +475,63 @@ model weights is encrypted.ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);-Disable memory allocation-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-In case of execution failures, either silent or with errors, try to update the NPU driver to-`32.0.100.3104 or newer <https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html>`__.-If the update is not possible, set the ``DISABLE_OPENVINO_GENAI_NPU_L0``-environment variable to disable NPU memory allocation, which might be supported-only on newer drivers for Intel Core Ultra 200V processors.+Whisper Inference on NPU+###############################################################################################-Set the environment variable in a terminal:+OpenAI Whisper support (for+`whisper-tiny <https://huggingface.co/openai/whisper-tiny>`__,+`whisper-base <https://huggingface.co/openai/whisper-base>`__,+`whisper-small <https://huggingface.co/openai/whisper-small>`__, or+`whisper-large <https://huggingface.co/openai/whisper-large>`__ models) was first introduced in+OpenVINO 2024.5. There are no NPU-specific requirements when running the Whisper GenAI pipeline on NPU,+so a standard OpenVINO GenAI sample works without any limitations.-.. tab-set::- .. tab-item:: Linux- :sync: linux+Export Whisper models from Hugging Face+***********************************************************************************************- .. code-block:: console+Prior to OpenVINO 2025.1 the Whisper pipeline+only accepted stateless Whisper models, exported with ``--disable-stateful`` flag:- export DISABLE_OPENVINO_GENAI_NPU_L0=1+.. code:: console- .. tab-item:: Windows- :sync: win+ optimum-cli export openvino --trust-remote-code --model openai/whisper-tiny whisper-tiny --disable-stateful- .. code-block:: console+Since OpenVINO 2025.1, this is no longer required. Weights can remain in FP16 or be compressed in INT8:- set DISABLE_OPENVINO_GENAI_NPU_L0=1+.. code:: console+ optimum-cli export openvino --trust-remote-code --model openai/whisper-base whisper-base-int8 --weight-format int8-Performance modes-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Troubleshooting+###############################################################################################-You can configure the NPU pipeline with the ``GENERATE_HINT`` option to switch-between two different performance modes:+Disabling L0 memory allocation++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-* ``FAST_COMPILE`` (default) - enables fast compilation at the expense of performance,-* ``BEST_PERF`` - ensures best possible performance at lower compilation speed.+In case of execution failures, either silent or with errors, try to update the NPU driver to+`32.0.100.3104 or newer <https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html>`__.+If the update is not possible and you get "out of memory" errors, try setting the+``DISABLE_OPENVINO_GENAI_NPU_L0`` environment variable to disable Level0 memory allocation.-Use the following code snippet:+Set the environment variable in a terminal:.. tab-set::- .. tab-item:: Python- :sync: py-- .. code-block:: python-- pipeline_config = { "GENERATE_HINT": "BEST_PERF" }- pipe = ov_genai.LLMPipeline(model_path, "NPU", pipeline_config)-- .. tab-item:: C++- :sync: cpp-- .. code-block:: cpp+ .. tab-item:: Linux+ :sync: linux- ov::AnyMap pipeline_config = { { "GENERATE_HINT", "BEST_PERF" } };- ov::genai::LLMPipeline pipe(model_path, "NPU", pipeline_config);+ .. code-block:: console+ export DISABLE_OPENVINO_GENAI_NPU_L0=1+ .. tab-item:: Windows+ :sync: win+ .. code-block:: console+ set DISABLE_OPENVINO_GENAI_NPU_L0=1@@ -485,3 +541,4 @@ Additional Resources* :doc:`NPU Device <../../openvino-workflow/running-inference/inference-devices-and-modes/npu-device>`* `OpenVINO GenAI Repo <https://github.com/openvinotoolkit/openvino.genai>`__* `Neural Network Compression Framework <https://github.com/openvinotoolkit/nncf>`__+* `Optimum Intel <https://github.com/huggingface/optimum-intel>`__