Skip to content

Commit 75c404d

Browse files
committed
update WS config
1 parent e653477 commit 75c404d

File tree

2 files changed

+22
-77
lines changed

2 files changed

+22
-77
lines changed

src/plugins/intel_npu/src/compiler_adapter/src/vcl_api.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,8 @@ std::vector<std::shared_ptr<NetworkDescription>> VCLCompilerImpl::compileWsOneSh
382382
compilerVersion,
383383
maxOpsetVersion,
384384
updatedConfig.isAvailable(ov::intel_npu::use_base_model_serializer.name())
385-
? updatedConfig.get<USE_BASE_MODEL_SERIALIZER>()
386-
: true,
387-
updatedConfig.get<SERIALIZATION_WEIGHTS_SIZE_THRESHOLD>());
385+
? config.get<USE_BASE_MODEL_SERIALIZER>()
386+
: true);
388387

389388
std::string buildFlags;
390389
const bool useIndices = !((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 9));

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

Lines changed: 20 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ std::string getDeviceFromProperties(const ov::AnyMap& propertiesMap) {
160160

161161
platformStr = utils::getPlatformByDeviceName(platformStr);
162162
platformStr = ov::intel_npu::Platform::standardize(platformStr);
163-
std::cout << "S====tandardized platform is: " << platformStr << std::endl;
164163
return platformStr;
165164
}
166165
return defaultDevice;
@@ -175,14 +174,18 @@ void checkUpdateforSpecialPlatform(const FilteredConfig& base_conf,
175174
// 3720 -> DRIVER
176175
// 4000 and later -> default
177176

178-
// const ov::AnyMap localProperties = propertiesMap;
177+
// If user set compilerType in config, will not update by device
178+
auto it = propertiesMap.find(std::string(COMPILER_TYPE::key()));
179+
if (it != propertiesMap.end()) {
180+
return;
181+
}
182+
179183
std::string getdevice = getDeviceFromProperties(propertiesMap);
180-
std::cout << "The device from properties '" << getdevice << "' VS actual device from backend'" << deviceName << "'"
181-
<< std::endl;
184+
182185
if (deviceName.empty() && getdevice.empty()) {
183186
OPENVINO_THROW("Device name is empty!");
184187
}
185-
std::cout << " ==checkUpdateforSpecialPlatform==1==" << std::endl;
188+
186189
std::string usedDevice = deviceName;
187190
if (deviceName != getdevice) {
188191
log.info("The device from properties '%s' is different from the actual device '%s', use device '%s' to check "
@@ -192,28 +195,22 @@ void checkUpdateforSpecialPlatform(const FilteredConfig& base_conf,
192195
deviceName.c_str());
193196

194197
usedDevice = deviceName.empty() ? getdevice : deviceName;
195-
std::cout << " ==checkUpdateforSpecialPlatform==2==" << std::endl;
196198
}
197-
std::cout << " ==checkUpdateforSpecialPlatform==3==" << std::endl;
198-
// If the platform is not 3720 or user set compilerType, will not update by device
199-
auto it = propertiesMap.find(std::string(COMPILER_TYPE::key()));
200-
if (usedDevice != std::string(ov::intel_npu::Platform::NPU3720) || it != propertiesMap.end()) {
201-
std::cout << " ==checkUpdateforSpecialPlatform==3==" << std::endl;
199+
200+
// If the platform is not 3720, will not update by device
201+
if (usedDevice != std::string(ov::intel_npu::Platform::NPU3720)) {
202202
return;
203203
}
204-
std::cout << " ==checkUpdateforSpecialPlatform==4==" << std::endl;
204+
205205
if (it == propertiesMap.end()) {
206-
std::cout << " ==checkUpdateforSpecialPlatform==5==" << std::endl;
207206
if (base_conf.get<COMPILER_TYPE>() != ov::intel_npu::CompilerType::DRIVER) {
208-
std::cout << " ==checkUpdateforSpecialPlatform==6==" << std::endl;
209207
log.warning(
210208
"Platform '3720' is selected, but the used compiler_type is not set to 'DRIVER'. Forcely use the "
211209
"compiler_type to 'DRIVER'. Maybe cause the compilerType inconsistency issues.");
212210
}
213-
std::cout << " ==checkUpdateforSpecialPlatform==7==" << std::endl;
211+
214212
// To avoid compilerType inconsistency issues, only set DRIVER if compiler_type is not set by user
215213
propertiesMap[std::string(COMPILER_TYPE::key())] = COMPILER_TYPE::toString(ov::intel_npu::CompilerType::DRIVER);
216-
std::cout << " ==checkUpdateforSpecialPlatform==8==" << std::endl;
217214
}
218215
}
219216

@@ -718,9 +715,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
718715
// activate the NPUW path
719716
auto useNpuwKey = ov::intel_npu::use_npuw.name();
720717
ov::AnyMap localProperties = properties;
721-
for (auto it : localProperties) {
722-
std::cout << "Compile_model: Local property: " << it.first << "=" << it.second.as<std::string>() << std::endl;
723-
}
718+
724719
if (localProperties.count(useNpuwKey)) {
725720
if (localProperties.at(useNpuwKey).as<bool>() == true) {
726721
return ov::npuw::ICompiledModel::create(model->clone(), shared_from_this(), localProperties);
@@ -740,31 +735,21 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
740735
auto deviceTmp = _backend == nullptr ? nullptr : _backend->getDevice();
741736
std::string deviceName = deviceTmp != nullptr ? deviceTmp->getName() : "";
742737
checkUpdateforSpecialPlatform(_globalConfig, localProperties, deviceName, _logger);
743-
std::cout << " ==compile_model=========2====" << std::endl;
744738
const std::map<std::string, std::string> localPropertiesMap = any_copy(localProperties);
745-
for (auto it : localPropertiesMap) {
746-
std::cout << "Compile_model2: Local property: " << it.first << "=" << it.second << std::endl;
747-
}
748-
749739
update_log_level(localPropertiesMap);
750740

751741
// create compiler
752-
std::cout << " ==compile_model=== compile create ==========1====" << std::endl;
753742
CompilerAdapterFactory compilerAdapterFactory;
754743
auto compiler =
755744
compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, localProperties, deviceName));
756-
std::cout << " ==compile_model=== compile create ==========2====" << std::endl;
757745

758746
OV_ITT_TASK_CHAIN(PLUGIN_COMPILE_MODEL, itt::domains::NPUPlugin, "Plugin::compile_model", "fork_local_config");
759747
auto localConfig = fork_local_config(localPropertiesMap, compiler);
760-
std::cout << " ===== the final config is: " << localConfig.toString() << std::endl;
761748

762749
const auto set_cache_dir = localConfig.get<CACHE_DIR>();
763750
if (!set_cache_dir.empty()) {
764751
const auto compilerType = localConfig.get<COMPILER_TYPE>();
765-
std::cout << "----call set_cache_dir and compilertype is mlir---" << std::endl;
766752
if (compilerType == ov::intel_npu::CompilerType::PLUGIN) {
767-
std::cout << "----throw ov::cache dir excpetion--" << std::endl;
768753
OPENVINO_THROW("Option 'CACHE_DIR' is not supported with PLUGIN compiler type");
769754
}
770755
}
@@ -773,31 +758,9 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
773758
utils::getCompilationPlatform(localConfig.get<PLATFORM>(),
774759
localConfig.get<DEVICE_ID>(),
775760
_backend == nullptr ? std::vector<std::string>() : _backend->getDeviceNames());
776-
std::string getPlatfrom1 = getDeviceFromProperties(localProperties);
777-
std::cout << "The platform from properties is: '" << getPlatfrom1 << "'" << std::endl;
778-
std::cout << "The platform from getCompilationPlatform is: '" << platform << "'" << std::endl;
779761

780762
auto device = _backend == nullptr ? nullptr : _backend->getDevice(localConfig.get<DEVICE_ID>());
781763

782-
if (deviceTmp == device) {
783-
if (deviceTmp != nullptr) {
784-
std::cout << "The selected device is: " << device->getName() << std::endl;
785-
} else {
786-
if (deviceTmp == nullptr) {
787-
std::cout << "The selected device from driver is: nullptr" << std::endl;
788-
} else {
789-
std::cout << "The selected device from driver is: " << deviceTmp->getName() << std::endl;
790-
}
791-
if (device == nullptr) {
792-
std::cout << "The selected device from config and driver is: nullptr" << std::endl;
793-
} else {
794-
std::cout << "The selected device from config and driver is: " << device->getName() << std::endl;
795-
}
796-
}
797-
} else {
798-
std::cout << "The selected device is NOT EQUAL, deviceTmp is " << deviceTmp->getName() << ", device is "
799-
<< device->getName() << std::endl;
800-
}
801764
localConfig.update({{ov::intel_npu::platform.name(), platform}});
802765

803766
auto updateBatchMode = [&](ov::intel_npu::BatchMode mode) {
@@ -1075,23 +1038,17 @@ ov::SupportedOpsMap Plugin::query_model(const std::shared_ptr<const ov::Model>&
10751038
CompilerAdapterFactory compilerAdapterFactory;
10761039
auto npu_plugin_properties = properties;
10771040
exclude_model_ptr_from_map(npu_plugin_properties);
1078-
for (auto it : npu_plugin_properties) {
1079-
std::cout << "Query_model: Local property: " << it.first << "=" << it.second.as<std::string>() << std::endl;
1080-
}
1081-
10821041
auto device = _backend == nullptr ? nullptr : _backend->getDevice();
10831042
std::string deviceName = device != nullptr ? device->getName() : "";
10841043
checkUpdateforSpecialPlatform(_globalConfig, npu_plugin_properties, deviceName, _logger);
1085-
for (auto it : npu_plugin_properties) {
1086-
std::cout << "Query_model2: Local property: " << it.first << "=" << it.second.as<std::string>() << std::endl;
1087-
}
1044+
10881045
const std::map<std::string, std::string> propertiesMap = any_copy(npu_plugin_properties);
10891046
update_log_level(propertiesMap);
1090-
std::cout << " ==query_model=== compile create ==========1====" << std::endl;
1047+
10911048
auto compiler =
10921049
compilerAdapterFactory.getCompiler(_backend,
10931050
resolveCompilerType(_globalConfig, npu_plugin_properties, deviceName));
1094-
std::cout << " ==query_model=== compile create ==========1====" << std::endl;
1051+
10951052
auto localConfig = fork_local_config(propertiesMap, compiler, OptionMode::CompileTime);
10961053
_logger.setLevel(localConfig.get<LOG_LEVEL>());
10971054
const auto platform =
@@ -1122,24 +1079,19 @@ std::shared_ptr<ov::ICompiledModel> Plugin::parse(const ov::Tensor& tensorBig,
11221079
// ov::hint::model has no corresponding "Config" implementation thus we need to remove it from the
11231080
// list of properties
11241081
auto originalModel = exclude_model_ptr_from_map(npu_plugin_properties);
1125-
for (auto it : npu_plugin_properties) {
1126-
std::cout << "Parse: Local property1: " << it.first << "=" << it.second.as<std::string>() << std::endl;
1127-
}
1082+
11281083
auto deviceTmp = _backend == nullptr ? nullptr : _backend->getDevice();
11291084
std::string deviceName = deviceTmp != nullptr ? deviceTmp->getName() : "";
11301085
checkUpdateforSpecialPlatform(_globalConfig, npu_plugin_properties, deviceName, _logger);
1131-
for (auto it : npu_plugin_properties) {
1132-
std::cout << "Parse2: Local property: " << it.first << "=" << it.second.as<std::string>() << std::endl;
1133-
}
11341086

11351087
CompilerAdapterFactory compilerAdapterFactory;
11361088
const auto propertiesMap = any_copy(npu_plugin_properties);
11371089
update_log_level(propertiesMap);
1138-
std::cout << " ==parse=== compile create ==========1====" << std::endl;
1090+
11391091
auto compiler =
11401092
compilerAdapterFactory.getCompiler(_backend,
11411093
resolveCompilerType(_globalConfig, npu_plugin_properties, deviceName));
1142-
std::cout << " ==parse=== compile create ==========2====" << std::endl;
1094+
11431095
OV_ITT_TASK_CHAIN(PLUGIN_PARSE_MODEL, itt::domains::NPUPlugin, "Plugin::parse", "fork_local_config");
11441096
auto localConfig = fork_local_config(propertiesMap, compiler, OptionMode::RunTime);
11451097
_logger.setLevel(localConfig.get<LOG_LEVEL>());
@@ -1149,12 +1101,6 @@ std::shared_ptr<ov::ICompiledModel> Plugin::parse(const ov::Tensor& tensorBig,
11491101
_backend == nullptr ? std::vector<std::string>() : _backend->getDeviceNames());
11501102
localConfig.update({{ov::intel_npu::platform.name(), platform}});
11511103
auto device = _backend == nullptr ? nullptr : _backend->getDevice(localConfig.get<DEVICE_ID>());
1152-
if (deviceTmp == device) {
1153-
std::cout << "2The selected device is: " << device->getName() << std::endl;
1154-
} else {
1155-
std::cout << "2The selected device is NOT EQUAL, deviceTmp is " << deviceTmp->getName() << ", device is "
1156-
<< device->getName() << std::endl;
1157-
}
11581104

11591105
const auto loadedFromCache = localConfig.get<LOADED_FROM_CACHE>();
11601106
if (!loadedFromCache) {

0 commit comments

Comments
 (0)