Skip to content

Commit

Permalink
Skip new params for old driver compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
XinWangIntel committed Jul 9, 2024
1 parent 76c00c3 commit 0d9ecb1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,25 @@ std::string LevelZeroCompilerInDriver<TableExtension>::serializeConfig(
ze_graph_compiler_version_info_t& compilerVersion) const {
std::string content = config.toString();

// Remove optimization_level and perf_hint_override for old driver which not support them
if ((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 7)) {
std::ostringstream optLevelStr;
optLevelStr << "optimization-level" << KEY_VALUE_SEPARATOR << "\\d+";
std::ostringstream perfHintStr;
perfHintStr << "performance-hint-override" << KEY_VALUE_SEPARATOR << "\\S+";
_logger.warning(
"optimization-level property is not suppored by this compiler version. Removing from parameters");
content = std::regex_replace(content, std::regex(optLevelStr.str()), "");
_logger.warning("performance-hint-override property is not suppored by this compiler version. Removing "
"from parameters");
content = std::regex_replace(content, std::regex(perfHintStr.str()), "");

std::ostringstream compilationParamsStr;
compilationParamsStr << ov::intel_npu::compilation_mode_params.name() << KEY_VALUE_SEPARATOR << "";
_logger.warning("Clear empty NPU_COMPILATION_MODE_PARAMS. Removing from parameters");
content = std::regex_replace(content, std::regex(compilationParamsStr.str()), "");
}

// As a consequence of complying to the conventions established in the 2.0 OV API, the set of values corresponding
// to the "model priority" key has been modified
// cpu_pinning property is not supported in compilers < v5.2 - need to remove it
Expand Down

0 comments on commit 0d9ecb1

Please sign in to comment.