Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,9 @@ struct COMPILER_TYPE final : OptionBase<COMPILER_TYPE, ov::intel_npu::CompilerTy
}

static ov::intel_npu::CompilerType parse(std::string_view val) {
if (val == "MLIR") {
if (val == "PLUGIN") {
return ov::intel_npu::CompilerType::PLUGIN;
} else if (val == "MLIR") {
return ov::intel_npu::CompilerType::MLIR;
} else if (val == "DRIVER") {
return ov::intel_npu::CompilerType::DRIVER;
Expand All @@ -856,7 +858,9 @@ struct COMPILER_TYPE final : OptionBase<COMPILER_TYPE, ov::intel_npu::CompilerTy

static std::string toString(const ov::intel_npu::CompilerType& val) {
std::stringstream strStream;
if (val == ov::intel_npu::CompilerType::MLIR) {
if (val == ov::intel_npu::CompilerType::PLUGIN) {
strStream << "PLUGIN";
} else if (val == ov::intel_npu::CompilerType::MLIR) {
strStream << "MLIR";
} else if (val == ov::intel_npu::CompilerType::DRIVER) {
strStream << "DRIVER";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ inline std::ostream& operator<<(std::ostream& out, const ColorFormat& fmt) {

/**
* @brief [Only for NPU Plugin]
* Type: string, default is MLIR.
* Type: string, default is MLIR / PLUGIN.
* Type of NPU compiler to be used for compilation of a network
* @note Configuration API v 2.0
*/
enum class CompilerType { MLIR, DRIVER };
enum class CompilerType { PLUGIN, MLIR, DRIVER };

/**
* @brief Prints a string representation of ov::intel_npu::CompilerType to a stream
Expand All @@ -100,6 +100,9 @@ enum class CompilerType { MLIR, DRIVER };
*/
inline std::ostream& operator<<(std::ostream& out, const CompilerType& fmt) {
switch (fmt) {
case CompilerType::PLUGIN: {
out << "PLUGIN";
} break;
case CompilerType::MLIR: {
out << "MLIR";
} break;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ std::vector<ov::ProfilingInfo> Pipeline::get_profiling_info() const {
return _npu_profiling->getNpuInferStatistics();
}
/// PROFILING_TYPE = MODEL or undefined = fallback to model profiling
if (_config.get<COMPILER_TYPE>() == ov::intel_npu::CompilerType::MLIR) {
if (_config.get<COMPILER_TYPE>() == ov::intel_npu::CompilerType::MLIR ||
_config.get<COMPILER_TYPE>() == ov::intel_npu::CompilerType::PLUGIN) {
// For plugin compiler retreive raw profiling data from backend and delegate
// processing to the compiler
_logger.debug("InferRequest::get_profiling_info complete with compiler->process_profiling_output().");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class CompilerAdapterFactory final {
std::unique_ptr<ICompilerAdapter> getCompiler(const ov::SoPtr<IEngineBackend>& engineBackend,
const ov::intel_npu::CompilerType type) const {
switch (type) {
case ov::intel_npu::CompilerType::MLIR: {
case ov::intel_npu::CompilerType::MLIR:
case ov::intel_npu::CompilerType::PLUGIN: {
if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") {
return std::make_unique<PluginCompilerAdapter>(nullptr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ PluginCompilerAdapter::PluginCompilerAdapter(const std::shared_ptr<ZeroInitStruc
_logger("PluginCompilerAdapter", Logger::global().level()) {
_logger.debug("initialize PluginCompilerAdapter start");

_logger.info("MLIR compiler will be used.");
_logger.info("PLUGIN (MLIR) compiler will be used.");
std::string baseName = "npu_mlir_compiler";
auto libPath = ov::util::make_plugin_library_name(ov::util::get_ov_lib_path(), baseName + OV_BUILD_POSTFIX);
_compiler = load_compiler(libPath);
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_npu/src/plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
const auto set_cache_dir = localConfig.get<CACHE_DIR>();
if (!set_cache_dir.empty()) {
const auto compilerType = localConfig.get<COMPILER_TYPE>();
if (compilerType == ov::intel_npu::CompilerType::MLIR) {
OPENVINO_THROW("Option 'CACHE_DIR' is not supported with MLIR compiler type");
if (compilerType == ov::intel_npu::CompilerType::MLIR || compilerType == ov::intel_npu::CompilerType::PLUGIN) {
OPENVINO_THROW("Option 'CACHE_DIR' is not supported with PLUGIN (MLIR) compiler type");
}
}

Expand Down
Loading