Skip to content

Commit 04d31b1

Browse files
committed
Add more logs
1 parent 645a43b commit 04d31b1

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

samples/cpp/benchmark_app/main.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,16 @@ int main(int argc, char* argv[]) {
775775
if (!modelStream.is_open()) {
776776
throw std::runtime_error("Cannot open model file " + FLAGS_m);
777777
}
778+
779+
auto importModelBegin = std::chrono::steady_clock::now();
780+
778781
compiledModel = core.import_model(modelStream, device_name, device_config);
782+
783+
auto importModelEnd = std::chrono::steady_clock::now();
784+
std::cout << "Import model time: "
785+
<< std::chrono::duration_cast<std::chrono::milliseconds>(importModelEnd - importModelBegin).count() << " ms"
786+
<< std::endl;
787+
779788
modelStream.close();
780789

781790
auto duration_ms = get_duration_ms_till_now(startTime);

src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ std::vector<std::shared_ptr<IGraph>> PluginCompilerAdapter::compileWS(const std:
110110
const Config& config) const {
111111
OV_ITT_TASK_CHAIN(COMPILE_BLOB, itt::domains::NPUPlugin, "PluginCompilerAdapter", "compileWS");
112112

113+
auto compileNetBegin = std::chrono::steady_clock::now();
114+
113115
std::shared_ptr<NetworkDescription> initNetworkDescription;
114116
std::shared_ptr<NetworkDescription> mainNetworkDescription;
115117

@@ -188,6 +190,11 @@ std::vector<std::shared_ptr<IGraph>> PluginCompilerAdapter::compileWS(const std:
188190

189191
_logger.debug("compile end");
190192

193+
auto compileNetEnd = std::chrono::steady_clock::now();
194+
std::cout << "Compile net time: "
195+
<< std::chrono::duration_cast<std::chrono::milliseconds>(compileNetEnd - compileNetBegin).count() << " ms"
196+
<< std::endl;
197+
191198
ze_graph_handle_t initGraphHandle = nullptr;
192199
ze_graph_handle_t mainGraphHandle = nullptr;
193200

src/plugins/intel_npu/src/compiler_adapter/src/plugin_graph.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ void PluginGraph::custom_export(std::ostream& stream,
6767
} else {
6868
if (_logger.level() >= ov::log::Level::INFO) {
6969
std::stringstream str;
70-
str << "Blob size: " << _blob.size() + initBlob.size() + 4 * sizeof(size_t) + xmlSize + binSize
70+
str << "Blob size: " << _blob.size() + initBlob.size()
71+
<< std::endl;
72+
str << "Blob size with weights: " << _blob.size() + initBlob.size() + 4 * sizeof(size_t) + xmlSize + binSize
7173
<< std::endl;
7274
_logger.info(str.str().c_str());
7375
}

0 commit comments

Comments
 (0)