Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CPU][DEBUG_CAPS] Disable .bin file dump on exec graph serialization (#29088)

Arseniy Obolenskiy6b6519bffb16
diff --git a/src/plugins/intel_cpu/src/graph_dumper.cpp b/src/plugins/intel_cpu/src/graph_dumper.cpp
index c3b53f0ebb5..f7a52195c58 100644
--- a/src/plugins/intel_cpu/src/graph_dumper.cpp
+++ b/src/plugins/intel_cpu/src/graph_dumper.cpp
@@ -16,6 +16,7 @@
#include "openvino/pass/serialize.hpp"
#include "openvino/runtime/exec_model_info.hpp"
#include "utils/debug_capabilities.h"
+#include "utils/platform.h"
namespace ov::intel_cpu {
@@ -246,7 +247,7 @@ void serializeToXML(const Graph& graph, const std::string& path) {
std::string binPath;
ov::pass::Manager manager;
- manager.register_pass<ov::pass::Serialize>(path, binPath, ov::pass::Serialize::Version::IR_V10);
+ manager.register_pass<ov::pass::Serialize>(path, NULL_STREAM, ov::pass::Serialize::Version::IR_V10);
manager.run_passes(graph.dump());
}
diff --git a/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp b/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp
index 356ca2f1141..bfd3a1d9830 100644
--- a/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp
+++ b/src/plugins/intel_cpu/src/utils/ngraph_transformation.hpp
@@ -10,6 +10,7 @@
# include "debug_caps_config.h"
# include "openvino/util/file_util.hpp"
+# include "utils/platform.h"
namespace ov {
namespace intel_cpu {
@@ -76,9 +77,8 @@ private:
if (config.dumpIR.format.filter[DebugCapsConfig::IrFormatFilter::Xml]) {
std::string xmlFile(pathAndName + ".xml");
- std::string binFile("/dev/null"); // @todo make it crossplatform using dummy implementation of std::ostream
- serializer.register_pass<ov::pass::Serialize>(xmlFile, binFile);
+ serializer.register_pass<ov::pass::Serialize>(xmlFile, NULL_STREAM);
}
if (config.dumpIR.format.filter[DebugCapsConfig::IrFormatFilter::Svg]) {
diff --git a/src/plugins/intel_cpu/src/utils/platform.h b/src/plugins/intel_cpu/src/utils/platform.h
new file mode 100644
index 00000000000..179229636bc
--- /dev/null
+++ b/src/plugins/intel_cpu/src/utils/platform.h
@@ -0,0 +1,10 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+#pragma once
+
+#ifdef _WIN32
+# define NULL_STREAM "NUL"
+#else
+# define NULL_STREAM "/dev/null"
+#endif