Skip to content

ggml-openvino: forward NPU compilation mode parameters - #292

Open
zhaixuejun1993 wants to merge 2 commits into
ravi9:dev_backend_openvinofrom
zhaixuejun1993:xuejun/enable_npu_compilation_mode_params
Open

ggml-openvino: forward NPU compilation mode parameters#292
zhaixuejun1993 wants to merge 2 commits into
ravi9:dev_backend_openvinofrom
zhaixuejun1993:xuejun/enable_npu_compilation_mode_params

Conversation

@zhaixuejun1993

Copy link
Copy Markdown
Collaborator

This pull request adds support for passing custom NPU compilation mode parameters to OpenVINO via a new environment variable. This enables advanced users to fine-tune NPU compilation behavior by specifying parameters such as optimization level.

New NPU compilation mode parameter support:

  • ggml/src/ggml-openvino/ggml-openvino-extra.cpp: Added support for the GGML_OPENVINO_NPU_COMPILATION_MODE_PARAMS environment variable, which forwards custom NPU compiler parameters to OpenVINO. [1] [2]
  • docs/backend/OPENVINO.md: Documented the new GGML_OPENVINO_NPU_COMPILATION_MODE_PARAMS variable, including its purpose and usage example.Add GGML_OPENVINO_NPU_COMPILATION_MODE_PARAMS to the backend's cached environment so callers can configure the NPU compiler without using the generic property escape hatch.

When the value is non-empty, pass it to OpenVINO as NPU_COMPILATION_MODE_PARAMS. This enables settings such as optimization-level=3 for NPU compilation while preserving the existing behavior when the variable is unset and leaving CPU and GPU configuration unchanged.

Document the variable, its NPU-only scope, and the optimization-level=3 example in the OpenVINO backend runtime configuration table.

Overview

Additional information

Requirements

@ravi9

ravi9 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

@zhaixuejun1993 GGML_OPENVINO_NPU_COMPILATION_MODE_PARAMS var name seems very long. Instead, maybe update to GGML_OPENVINO_NPU_COMPILE_PARAMS ?

@ravi9
ravi9 force-pushed the dev_backend_openvino branch from 8ba9348 to d691121 Compare August 24, 2026 16:49
@zhaixuejun1993
zhaixuejun1993 force-pushed the xuejun/enable_npu_compilation_mode_params branch 2 times, most recently from 09d8c7c to 27ec9b1 Compare August 25, 2026 02:11
Add GGML_OPENVINO_NPU_COMPILE_PARAMS to the backend's cached environment so callers can configure the NPU compiler without using the generic property escape hatch.

When the value is non-empty, pass it to OpenVINO as NPU_COMPILATION_MODE_PARAMS. This enables settings such as optimization-level=3 for NPU compilation while preserving the existing behavior when the variable is unset and leaving CPU and GPU configuration unchanged.

Document the variable, its NPU-only scope, and the optimization-level=3 example in the OpenVINO backend runtime configuration table.
@ravi9
ravi9 force-pushed the dev_backend_openvino branch from d691121 to 407e209 Compare August 25, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants