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] Do not populate MAX_TILES and NPU_STEPPING (#38869)
Patrik Stepanfa75b1e3e7b4
diff --git a/src/plugins/intel_npu/README.md b/src/plugins/intel_npu/README.mdindex c7a43830974..d3139848391 100644--- a/src/plugins/intel_npu/README.md+++ b/src/plugins/intel_npu/README.md@@ -319,7 +319,7 @@ Supported values:### ov::intel_npu::max_tiles and ov::intel_npu::tiles-For on-device compilation, the plugin queries the driver for the available number of tiles and sets `ov::intel_npu::max_tiles`.+For on-device compilation, the plugin queries the driver for the available number of tiles and reports it through `ov::intel_npu::max_tiles`.`ov::intel_npu::max_tiles` is a read-only property, and it will not be listed as supported in cases where no device is present.Note that `ov::intel_npu::max_tiles` represents the maximum number of tiles available, but the compiler may target a lower number of tiles depending on other properties. Users can set ``ov::intel_npu::tiles`` to override the number of tiles selected by the compiler based on other properties.@@ -345,7 +345,7 @@ Users can set ``ov::intel_npu::compiler_type`` to ``PLUGIN`` to force ``CompilerIf any condition is not met, the plugin automatically falls back to using ``Compiler-In-Driver``.The compiler type used to compile a model can be queried from the resulting ``CompiledModel`` by reading the ``ov::intel_npu::compiler_type`` property.Notes regarding on-device vs offline compilation:-- For on-device compilation with ``Compiler-In-Plugin``, the plugin is responsible for querying the platform information from the driver and for passing the mandatory configs to the compiler (platform ID, available number of tiles, stepping information). Such compiled models are compatible with all the drivers released for that platform.+- For on-device compilation with ``Compiler-In-Plugin``, the plugin queries the platform information from the driver and passes it to the compiler via the device descriptor supplied at compiler creation. With ``Compiler-In-Driver``, the driver provides the same device descriptor to the compiler on the plugin's behalf. Such compiled models are compatible with all the drivers released for that platform.- For offline compilation, users must explicitly set the ``ov::intel_npu::platform`` property to one of the supported values (see table above).Setting extra properties during offline compilation may result in compiled models that cannot be executed on SKUs with fewer resources or on drivers that do not support those features.Example: Setting ``performance-hint-override=latency`` through ``ov::intel_npu::compilation_mode_params`` instructs the compiler to use all available resources for the given platform. If ``ov::intel_npu::max_tiles`` is not provided, the compiler falls back to a fixed lookup table embedded in the library to determine available resources, which might not be representative of all SKUs.diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hppindex d18070a9cb8..c5a5a1e4617 100644--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp@@ -641,24 +641,6 @@ struct STEPPING final : OptionBase<STEPPING, int64_t> {}};-struct MAX_TILES final : OptionBase<MAX_TILES, int64_t> {- static std::string_view key() {- return ov::intel_npu::max_tiles.name();- }-- static std::vector<std::string_view> deprecatedKeys() {- return {};- }-- static int64_t defaultValue() {- return -1;- }-- static OptionMode mode() {- return OptionMode::CompileTime;- }-};-struct DMA_ENGINES final : OptionBase<DMA_ENGINES, int64_t> {static std::string_view key() {return ov::intel_npu::dma_engines.name();diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cppindex 48ca7459a40..735dc6bb43b 100644--- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp+++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp@@ -138,7 +138,6 @@ void register_options(const ov::SoPtr<intel_npu::IEngineBackend>& backend, intelREGISTER_OPTION(ENABLE_STRIDES_FOR);REGISTER_OPTION(SHARED_COMMON_QUEUE);REGISTER_OPTION(CACHE_ENCRYPTION_CALLBACKS);- REGISTER_OPTION(MAX_TILES);REGISTER_OPTION(MODEL_PTR);REGISTER_OPTION(DISABLE_IDLE_MEMORY_PRUNING);@@ -386,30 +385,6 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<}}- // Update stepping w/ information from driver, unless provided by user or we are off-device- // Ignore if compilation was requested for a platform that is different from the current one- if (!localConfig.has<STEPPING>() &&- _compilerOptionSupportHelper->isOptionSupported(compilerType, ov::intel_npu::stepping.name()) &&- device != nullptr && device->getName() == compilationPlatform) {- try {- localConfig.update(ov::intel_npu::stepping.name(), std::to_string(device->getSubDevId()));- } catch (...) {- _logger.warning("Stepping information not implemented by selected backend. Skipping. Please provide "- "NPU_STEPPING if required.");- }- }- // Update max_tiles w/ information from driver, unless provided by user or we are off-device- // Ignore if compilation was requested for a platform that is different from the current one- if (!localConfig.has<MAX_TILES>() &&- _compilerOptionSupportHelper->isOptionSupported(compilerType, ov::intel_npu::max_tiles.name()) &&- device != nullptr && device->getName() == compilationPlatform) {- try {- localConfig.update(ov::intel_npu::max_tiles.name(), std::to_string(device->getMaxNumSlices()));- } catch (...) {- _logger.warning("Max tiles information not implemented by selected backend. Default value will be used.");- }- }-OV_ITT_TASK_NEXT(PLUGIN_COMPILE_MODEL, "compile");const bool isWeightlessSupported = [&]() {diff --git a/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cpp b/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cppindex b4f5c143334..fb771a46c14 100644--- a/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cpp+++ b/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cpp@@ -599,14 +599,12 @@ void PluginPropertyManager::registerProperties() {register_property(ov::intel_npu::max_tiles.name(), true, ov::PropertyMutability::RO,hasBackendAndValidDevice,[this](const ov::AnyMap& arguments) {- if (!_config.has<MAX_TILES>()) {- try {- return static_cast<int64_t>(utils::getMaxTiles(_backend, getDeviceIdOrDefault(arguments)));- } catch (...) {- _logger.warning("GetMaxTiles failed to get value from device.");- }+ try {+ return static_cast<int64_t>(utils::getMaxTiles(_backend, getDeviceIdOrDefault(arguments)));+ } catch (...) {+ _logger.warning("GetMaxTiles failed to get value from device.");}- return _config.get<MAX_TILES>();+ return static_cast<int64_t>(-1);},[](const ov::Any&) {OPENVINO_THROW("READ-ONLY configuration key: ", ov::intel_npu::max_tiles.name());diff --git a/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cpp b/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cppindex 8c54b8d312f..8c04e967c60 100644--- a/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cpp+++ b/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cpp@@ -132,7 +132,6 @@ public:REGISTER_OPTION(ENABLE_STRIDES_FOR);REGISTER_OPTION(SHARED_COMMON_QUEUE);REGISTER_OPTION(CACHE_ENCRYPTION_CALLBACKS);- REGISTER_OPTION(MAX_TILES);REGISTER_OPTION(MODEL_PTR);REGISTER_OPTION(DISABLE_IDLE_MEMORY_PRUNING);