Skip to content

Commit a96f2b8

Browse files
committed
Fix DISABLE_VERSION_CHECK condition not taking into account globalConfig (set_property and env vars)
1 parent c8bc377 commit a96f2b8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/plugins/intel_npu/src/plugin/src/plugin.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,9 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& stream, c
894894

895895
try {
896896
const bool skipCompatibility =
897-
npu_plugin_properties.find(DISABLE_VERSION_CHECK::key().data()) != npu_plugin_properties.end() &&
898-
npu_plugin_properties[DISABLE_VERSION_CHECK::key().data()].as<bool>() == true;
897+
(npu_plugin_properties.find(DISABLE_VERSION_CHECK::key().data()) != npu_plugin_properties.end())
898+
? npu_plugin_properties[DISABLE_VERSION_CHECK::key().data()].as<bool>()
899+
: _globalConfig.get<DISABLE_VERSION_CHECK>();
899900
std::unique_ptr<MetadataBase> metadata = nullptr;
900901
size_t blobSize = MetadataBase::getFileSize(stream);
901902
if (!skipCompatibility) {
@@ -949,8 +950,9 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(const ov::Tensor& compi
949950

950951
try {
951952
const bool skipCompatibility =
952-
npu_plugin_properties.find(DISABLE_VERSION_CHECK::key().data()) != npu_plugin_properties.end() &&
953-
npu_plugin_properties[DISABLE_VERSION_CHECK::key().data()].as<bool>() == true;
953+
(npu_plugin_properties.find(DISABLE_VERSION_CHECK::key().data()) != npu_plugin_properties.end())
954+
? npu_plugin_properties[DISABLE_VERSION_CHECK::key().data()].as<bool>()
955+
: _globalConfig.get<DISABLE_VERSION_CHECK>();
954956
std::unique_ptr<MetadataBase> metadata = nullptr;
955957
size_t blobSize = compiled_blob.get_byte_size();
956958
if (!skipCompatibility) {

0 commit comments

Comments
 (0)