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
[intel-npu] Publishing properties NPU_TILES (RW) and NPU_MAX_TILES (#26161)
Attila Csok12dfadfe8b00
diff --git a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rst b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rstindex cd05280dab8..f98790dbb87 100644--- a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rst+++ b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rst@@ -140,6 +140,8 @@ offer a limited set of supported OpenVINO features.ov::workload_typeov::intel_npu::compilation_mode_paramsov::intel_npu::turbo+ ov::intel_npu::tiles+ ov::intel_nou::max_tiles.. tab-item:: Read-only propertiesdiff --git a/src/inference/include/openvino/runtime/intel_npu/properties.hpp b/src/inference/include/openvino/runtime/intel_npu/properties.hppindex 2c9d15152b4..39f4ddb211e 100644--- a/src/inference/include/openvino/runtime/intel_npu/properties.hpp+++ b/src/inference/include/openvino/runtime/intel_npu/properties.hpp@@ -72,5 +72,20 @@ static constexpr ov::Property<std::string> compilation_mode_params{"NPU_COMPILAT*/static constexpr ov::Property<bool> turbo{"NPU_TURBO"};+/**+ * @brief [Only for NPU Compiler]+ * Type: integer, default is -1+ * Sets the number of npu tiles to compile the model for.+ */+static constexpr ov::Property<int64_t> tiles{"NPU_TILES"};++/**+ * @brief+ * Type: integer, default is -1+ * Maximum number of tiles supported by the device we compile for. Can be set for offline compilation. If not set, it+ * will be populated by driver.+ */+static constexpr ov::Property<int64_t> max_tiles{"NPU_MAX_TILES"};+} // namespace intel_npu} // namespace ovdiff --git a/src/plugins/intel_npu/README.md b/src/plugins/intel_npu/README.mdindex e30480ecca7..0f64261ff1c 100644--- a/src/plugins/intel_npu/README.md+++ b/src/plugins/intel_npu/README.md@@ -174,6 +174,8 @@ The following properties are supported:| `ov::intel_npu::driver_version`/</br>`NPU_DRIVER_VERSION` | RO | NPU driver version (for both discrete/integrated NPU devices). | `N/A` | `N/A` || `ov::intel_npu::compilation_mode_params`/</br>`NPU_COMPILATION_MODE_PARAMS` | RW | Set various parameters supported by the NPU compiler. (See bellow) | `<std::string>`| `N/A` || `ov::intel_npu::turbo`/</br>`NPU_TURBO` | RW | Set Turbo mode on/off | `YES`/ `NO`| `NO` |+| `ov::intel_npu::tiles`/</br>`NPU_TILES` | RW | Sets the number of npu tiles to compile the model for | `[0-]` | `-1` |+| `ov::intel_npu::max_tiles`/</br>`NPU_MAX_TILES` | RW | Maximum number of tiles supported by the device we compile for. Can be set for offline compilation. If not set, it will be populated by driver.| `[0-]` | `[1-6] depends on npu platform` | ### Performance Hint: Default Number of DPU Groups / DMA Enginesdiff --git a/src/plugins/intel_npu/src/al/include/npu_private_properties.hpp b/src/plugins/intel_npu/src/al/include/npu_private_properties.hppindex adc46825c70..35d03dd6488 100644--- a/src/plugins/intel_npu/src/al/include/npu_private_properties.hpp+++ b/src/plugins/intel_npu/src/al/include/npu_private_properties.hpp@@ -301,20 +301,6 @@ static constexpr ov::Property<std::string> compilation_mode{"NPU_COMPILATION_MOD*/static constexpr ov::Property<int64_t> dpu_groups{"NPU_DPU_GROUPS"};-/**- * @brief [Only for NPU Compiler]- * Type: integer, default is -1- * Sets the number of npu tiles that will be used to execute the model. (Replaces NPU_DPU_GROUPS)- */-static constexpr ov::Property<int64_t> tiles{"NPU_TILES"};--/**- * @brief- * Type: integer, default is -1- * Maximum number of tiles supported by the device. If unset, it will be automatically obtained from driver- */-static constexpr ov::Property<int64_t> max_tiles{"NPU_MAX_TILES"};-/*** @brief [Only for NPU Plugin]* Type: integer, default is -1diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cppindex 79066ca73ca..a27e62818de 100644--- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp+++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp@@ -138,8 +138,11 @@ size_t getFileSize(std::istream& stream) {log.debug("Read blob size: streamStart=%zu, streamEnd=%zu", streamStart, streamEnd);if (streamEnd < streamStart) {- OPENVINO_THROW("Invalid stream size: streamEnd (", streamEnd,- ") is not larger than streamStart (", streamStart, ")!");+ OPENVINO_THROW("Invalid stream size: streamEnd (",+ streamEnd,+ ") is not larger than streamStart (",+ streamStart,+ ")!");}return streamEnd - streamStart;@@ -449,6 +452,22 @@ Plugin::Plugin()[](const Config& config) {return config.get<TURBO>();}}},+ {ov::intel_npu::tiles.name(),+ {true,+ ov::PropertyMutability::RW,+ [](const Config& config) {+ return config.get<TILES>();+ }}},+ {ov::intel_npu::max_tiles.name(),+ {true,+ ov::PropertyMutability::RW,+ [&](const Config& config) {+ if (!config.has<MAX_TILES>()) {+ const auto specifiedDeviceName = get_specified_device_name(config);+ return static_cast<int64_t>(_metrics->GetMaxTiles(specifiedDeviceName));+ }+ return config.get<MAX_TILES>();+ }}},// NPU Private// ========={ov::intel_npu::dma_engines.name(),@@ -457,12 +476,6 @@ Plugin::Plugin()[](const Config& config) {return config.get<DMA_ENGINES>();}}},- {ov::intel_npu::tiles.name(),- {false,- ov::PropertyMutability::RW,- [](const Config& config) {- return config.get<TILES>();- }}},{ov::intel_npu::dpu_groups.name(),{false,ov::PropertyMutability::RW,@@ -480,17 +493,6 @@ Plugin::Plugin()return config.get<STEPPING>();}}}},- {ov::intel_npu::max_tiles.name(),- {false,- ov::PropertyMutability::RW,- [&](const Config& config) {- if (!config.has<MAX_TILES>()) {- const auto specifiedDeviceName = get_specified_device_name(config);- return static_cast<int64_t>(_metrics->GetMaxTiles(specifiedDeviceName));- } else {- return config.get<MAX_TILES>();- }- }}},{ov::intel_npu::compilation_mode.name(),{false,ov::PropertyMutability::RW,