diff --git a/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp b/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp index c1398d227820da..18104e6d6c16a4 100644 --- a/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp +++ b/src/plugins/intel_npu/src/compiler/src/zero_compiler_in_driver.cpp @@ -627,6 +627,17 @@ ze_result_t LevelZeroCompilerInDriver::seriazlideIRModelAndQuery // Create querynetwork handle ze_result_t result = _graphDdiTableExt.pfnQueryNetworkCreate(_context, _deviceHandle, &desc, &hGraphQueryNetwork); + if (ZE_RESULT_SUCCESS != result) { + OPENVINO_THROW("L0 seriazlideIRModelAndQueryNetworkCreateV1", + " result: ", + ze_result_to_string(result), + ", code 0x", + std::hex, + uint64_t(result), + ". ", + getLatestBuildError()); + } + return result; } @@ -646,7 +657,9 @@ std::unordered_set LevelZeroCompilerInDriver::query ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } ze_graph_query_network_handle_t hGraphQueryNetwork = nullptr; @@ -695,7 +708,9 @@ ze_result_t LevelZeroCompilerInDriver::seriazlideIRModelAndQuery ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } return result; @@ -717,7 +732,9 @@ std::unordered_set LevelZeroCompilerInDriver::query ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } ze_graph_query_network_handle_t hGraphQueryNetwork = nullptr; @@ -736,15 +753,6 @@ template > std::unordered_set LevelZeroCompilerInDriver::getQueryResultFromSupportedLayers( ze_result_t result, ze_graph_query_network_handle_t& hGraphQueryNetwork) const { - if (ZE_RESULT_SUCCESS != result) { - OPENVINO_THROW("L0 getQueryResultFromSupportedLayers", - " result: ", - ze_result_to_string(result), - ", code 0x", - std::hex, - uint64_t(result)); - } - // Get the size of query result size_t size = 0; result = _graphDdiTableExt.pfnQueryNetworkGetSupportedLayers(hGraphQueryNetwork, &size, nullptr); @@ -755,7 +763,9 @@ std::unordered_set LevelZeroCompilerInDriver::getQu ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } // Get the result data of query @@ -768,7 +778,9 @@ std::unordered_set LevelZeroCompilerInDriver::getQu ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } result = _graphDdiTableExt.pfnQueryNetworkDestroy(hGraphQueryNetwork); @@ -778,7 +790,9 @@ std::unordered_set LevelZeroCompilerInDriver::getQu ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } return parseQueryResult(supportedLayers); @@ -821,8 +835,21 @@ ze_result_t LevelZeroCompilerInDriver::createGraph(const ze_grap serializedIR.second.get(), buildFlags.c_str()}; + _logger.debug("createGraph - performing pfnCreate"); // Create querynetwork handle - return _graphDdiTableExt.pfnCreate(_context, _deviceHandle, &desc, graph); + auto result = _graphDdiTableExt.pfnCreate(_context, _deviceHandle, &desc, graph); + if (ZE_RESULT_SUCCESS != result) { + OPENVINO_THROW("L0 pfnCreate", + " result: ", + ze_result_to_string(result), + ", code 0x", + std::hex, + uint64_t(result), + ". ", + getLatestBuildError()); + } + + return result; } // For ext version >= 1.5, calling pfnCreate2 api in _graphDdiTableExt @@ -850,7 +877,9 @@ ze_result_t LevelZeroCompilerInDriver::createGraph(const ze_grap ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } return result; @@ -885,14 +914,6 @@ ze_result_t LevelZeroCompilerInDriver::seriazlideIRModelAndCreat _logger.info("compileIR Using extension version: %s", typeid(TableExtension).name()); ze_result_t result = createGraph(format, serializedIR, buildFlags, flags, &graphHandle); - if (ZE_RESULT_SUCCESS != result) { - OPENVINO_THROW("Failed to create graph. L0 createGraph", - " result: ", - ze_result_to_string(result), - ", code 0x", - std::hex, - uint64_t(result)); - } return result; } @@ -909,7 +930,9 @@ NetworkDescription LevelZeroCompilerInDriver::compile(const std: ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } // Graph handle should be used only in scope of compile / parse functions. @@ -917,16 +940,6 @@ NetworkDescription LevelZeroCompilerInDriver::compile(const std: result = seriazlideIRModelAndCreateGraph(model, config, deviceGraphProperties, graphHandle); - OPENVINO_ASSERT(result == ZE_RESULT_SUCCESS, - "Failed to compile network. L0 createGraph", - " result: ", - ze_result_to_string(result), - ", code 0x", - std::hex, - uint64_t(result), - ". ", - getLatestBuildError()); - auto networkMeta = getNetworkMeta(graphHandle); networkMeta.name = model->get_friendly_name(); @@ -961,7 +974,9 @@ NetworkMetadata LevelZeroCompilerInDriver::parse(const std::vect ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } } else { OPENVINO_THROW("Empty blob"); @@ -989,7 +1004,9 @@ uint32_t LevelZeroCompilerInDriver::getSupportedOpsetVersion() c ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } const auto maxOpsetVersion = graphProperties.maxOVOpsetVersionSupported; _logger.info("getSupportedOpsetVersion Max supported version of opset in CiD: %d", maxOpsetVersion); @@ -1067,7 +1084,9 @@ void LevelZeroCompilerInDriver::getMetadata(ze_graph_dditable_ex ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } switch (arg.type) { @@ -1098,7 +1117,9 @@ void LevelZeroCompilerInDriver::getMetadata(ze_graph_dditable_ex ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } std::optional optionalMetadata = std::nullopt; @@ -1112,7 +1133,9 @@ void LevelZeroCompilerInDriver::getMetadata(ze_graph_dditable_ex ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } optionalMetadata = std::optional(metadata); @@ -1143,7 +1166,9 @@ NetworkMetadata LevelZeroCompilerInDriver::getNetworkMeta(ze_gra ze_result_to_string(result), ", code 0x", std::hex, - uint64_t(result)); + uint64_t(result), + ". ", + getLatestBuildError()); } NetworkMetadata meta;