OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[core] Migrate VisualizeTree to std path (#33324)
Pawel Raasz8a88c7915150
diff --git a/src/bindings/python/src/pyopenvino/graph/passes/transformations.cpp b/src/bindings/python/src/pyopenvino/graph/passes/transformations.cppindex 8ccd8f64b77..c6b346e6071 100644--- a/src/bindings/python/src/pyopenvino/graph/passes/transformations.cpp+++ b/src/bindings/python/src/pyopenvino/graph/passes/transformations.cpp@@ -84,21 +84,24 @@ void regclass_transformations(py::module m) {ov::pass::PassBase>visualize(m, "VisualizeTree");visualize.doc() = "openvino.passes.VisualizeTree transformation";- visualize.def(py::init<const std::string&, ov::pass::VisualizeTree::node_modifiers_t, bool>(),- py::arg("file_name"),- py::arg("nm") = nullptr,- py::arg("don_only") = false,- R"(+ visualize.def(+ py::init([](const py::object& file_name, ov::pass::VisualizeTree::node_modifiers_t nm, bool dot_only) {+ return std::make_shared<ov::pass::VisualizeTree>(Common::utils::to_fs_path(file_name), nm, dot_only);+ }),+ py::arg("file_name"),+ py::arg("nm") = nullptr,+ py::arg("dot_only") = false,+ R"(Create VisualizeTree pass which is used for Model to dot serialization.:param file_name: Path where serialized model will be saved. For example: /tmp/out.svg- :type file_name: str+ :type file_name: Union[str, bytes, pathlib.Path]:param nm: Node modifier function.:type nm: function- :param don_only: Enable only dot file generation.- :type don_only: bool+ :param dot_only: Enable only dot file generation.+ :type dot_only: bool)");visualize.def("__repr__", [](const ov::pass::VisualizeTree& self) {return Common::get_simple_repr(self);@@ -111,7 +114,7 @@ void regclass_transformations(py::module m) {py::init<const ov::pass::MakeStateful::ParamResPairs&>(),py::arg("pairs_to_replace"),R"( The transformation replaces the provided pairs Parameter and Result with openvino Memory operations ReadValue and Assign.-+:param pairs_to_replace::type pairs_to_replace: list[tuple[op.Parameter, op.Result])");@@ -119,7 +122,7 @@ void regclass_transformations(py::module m) {py::arg("pairs_to_replace"),R"(The transformation replaces the provided pairs Parameter and Result with openvino Memory operations ReadValue and Assign.-+:param pairs_to_replace: a dictionary of names of the provided Parameter and Result operations.:type pairs_to_replace: dict[str, str])");@@ -136,8 +139,8 @@ void regclass_transformations(py::module m) {R"(Create LowLatency2 pass which is used for changing the structure of the model,which contains TensorIterator/Loop operations.- The transformation finds all TensorIterator/Loop layers in the network,- processes all back edges that describe a connection between Result and Parameter of the TensorIterator/Loop bodies,+ The transformation finds all TensorIterator/Loop layers in the network,+ processes all back edges that describe a connection between Result and Parameter of the TensorIterator/Loop bodies,and inserts ReadValue and Assign layers at the input and output corresponding to this back edge.:param use_const_initializer: Changes the type of the initializing subgraph for ReadValue operations.diff --git a/src/common/transformations/tests/offline_transformations/pruning_test.cpp b/src/common/transformations/tests/offline_transformations/pruning_test.cppindex 062676f3e88..735f3e771cb 100644--- a/src/common/transformations/tests/offline_transformations/pruning_test.cpp+++ b/src/common/transformations/tests/offline_transformations/pruning_test.cpp@@ -227,7 +227,7 @@ TEST_F(TransformationTestsF, PropagateMasksBasic) {model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksBasic.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksBasic.svg").run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -311,7 +311,7 @@ TEST_F(TransformationTestsF, PropagateMasksDynamicConvolution) {model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksDynamicConvolution.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksDynamicConvolution.svg").run_on_model(model);{@@ -362,7 +362,8 @@ TEST(TransformationTests, PropagateMasksDynamicReshape) {auto model = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksDynamicReshape.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksDynamicReshape.svg")+ .run_on_model(model);pass::Manager m;m.register_pass<ov::pass::Pruning>();@@ -406,7 +407,7 @@ TEST(TransformationTests, PropagateMasksDynamicGroupConvolution) {auto f = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksDynamicGroupConvolution.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksDynamicGroupConvolution.svg").run_on_model(f);pass::Manager m;@@ -445,7 +446,7 @@ TEST(TransformationTests, PropagateMasksEmpty) {auto f = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksEmpty.svg").run_on_model(f);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksEmpty.svg").run_on_model(f);pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -541,7 +542,8 @@ TEST_F(TransformationTestsF, PropagateMaskPassThrough) {model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMaskPassThrough.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMaskPassThrough.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -632,7 +634,8 @@ TEST_F(TransformationTestsF, NegativePad12PropagateMaskPassThrough) {model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMaskPassThrough.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMaskPassThrough.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -783,7 +786,7 @@ TEST_F(TransformationTestsF, PropagateMasksHardDependencies) {}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksHardDependencies.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksHardDependencies.svg").run_on_model(model);{pass::Manager m;@@ -934,7 +937,7 @@ TEST_F(TransformationTestsF, PropagateMasksQuantizedGroupConvolution) {model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksQuantizedGroupConvolution.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksQuantizedGroupConvolution.svg").run_on_model(model);{pass::Manager m;@@ -1100,7 +1103,8 @@ TEST_F(TransformationTestsF, PropagateMasksQuantizedGroupConvolutionWithShapeOf)model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksQuantizedGroupConvolutionWithShapeOf.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /+ "PropagateMasksQuantizedGroupConvolutionWithShapeOf.svg").run_on_model(model);{pass::Manager m;@@ -1232,7 +1236,7 @@ TEST_F(TransformationTestsF, PropagateMasksFakeQuantizePerTensor) {model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksFakeQuantizePerTensor.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksFakeQuantizePerTensor.svg").run_on_model(model);{@@ -1316,7 +1320,8 @@ TEST(TransformationTests, PropagateMasksFakeQuantizePerTensor1DScale) {Strides(2, 1));auto model = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksFakeQuantizePerTensor1DScale.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /+ "PropagateMasksFakeQuantizePerTensor1DScale.svg").run_on_model(model);{@@ -1434,7 +1439,7 @@ TEST_F(TransformationTestsF, PropagateMasksFakeQuantizePerChannel) {model_ref = std::make_shared<Model>(OutputVector{conv2}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksFakeQuantizePerChannel.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksFakeQuantizePerChannel.svg").run_on_model(model);{pass::Manager m;@@ -1577,7 +1582,8 @@ TEST_F(TransformationTestsF, TestConcatMaskPropagation) {}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "TestConcatMaskPropagation.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "TestConcatMaskPropagation.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -1719,7 +1725,8 @@ TEST_F(TransformationTestsF, TestConcatMaskPropagationUp) {model_ref = std::make_shared<Model>(OutputVector{conv_out}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "TestConcatMaskPropagationUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "TestConcatMaskPropagationUp.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -1789,7 +1796,8 @@ TEST(TransformationTests, TestConcatMaskPropagationUpEmpty) {auto f = std::make_shared<Model>(OutputVector{add}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "TestConcatMaskPropagationUpEmpty.svg").run_on_model(f);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "TestConcatMaskPropagationUpEmpty.svg")+ .run_on_model(f);pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -1850,7 +1858,8 @@ TEST_F(TransformationTestsF, PruneConvIsClosingAndInGroup) {model = std::make_shared<ov::Model>(OutputVector{end_conv}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneConvIsClosingAndInGroup.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneConvIsClosingAndInGroup.svg")+ .run_on_model(model);{auto input = std::make_shared<opset10::Parameter>(element::f32, inputShapes);auto weights = create_constant_with_zeros(@@ -1964,7 +1973,8 @@ TEST(TransformationTests, PruneBranchingStopOp) {std::make_shared<ov::Model>(OutputVector{end_conv}, ParameterVector{input}, "RestrictedReduceMeanBranching");if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneBranchingStopOp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneBranchingStopOp.svg")+ .run_on_model(model);pass::Manager m;m.register_pass<ov::pass::Pruning>();@@ -2019,7 +2029,7 @@ TEST(TransformationTests, PruneStopOpUp) {auto model = std::make_shared<ov::Model>(OutputVector{end_conv}, ParameterVector{input}, "StopOpUp");if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneStopOpUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneStopOpUp.svg").run_on_model(model);pass::Manager m;m.register_pass<ov::pass::Pruning>();@@ -2086,7 +2096,7 @@ TEST_F(TransformationTestsF, PruneReducelayerUp) {model_ref = std::make_shared<ov::Model>(OutputVector{conv_1}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneReducelayerUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneReducelayerUp.svg").run_on_model(model);pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -2182,7 +2192,8 @@ TEST_F(TransformationTestsF, PruneReduceLayerDown) {model_ref = std::make_shared<ov::Model>(OutputVector{end_conv}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneReduceLayerDown.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneReduceLayerDown.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -2233,7 +2244,8 @@ TEST(TransformationTests, PruneStopReducelayerUp) {auto model = std::make_shared<ov::Model>(OutputVector{conv_1}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneStopReducelayerUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneStopReducelayerUp.svg")+ .run_on_model(model);pass::Manager m;m.register_pass<ov::pass::Pruning>();@@ -2289,7 +2301,8 @@ TEST(TransformationTests, PruneStopReduceLayerDown) {std::make_shared<ov::Model>(OutputVector{end_conv}, ParameterVector{input}, "RestrictedReduceMeanBranching");if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneStopReduceLayerDown.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneStopReduceLayerDown.svg")+ .run_on_model(model);pass::Manager m;m.register_pass<ov::pass::Pruning>();@@ -2363,7 +2376,8 @@ TEST_F(TransformationTestsF, MaskPropagationReshapeUp) {model_ref = std::make_shared<ov::Model>(OutputVector{conv_1}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationReshapeUp.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -2472,7 +2486,8 @@ TEST_P(TransformationTestsBoolParamF, MaskPropagationReshapeUpWithShapeOf) {}if (VISUALIZE_TESTS_TREE) {const auto postfix = use_shape_of ? "True" : "False";- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeUpWithShapeOf" + postfix + ".svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /+ (std::string("MaskPropagationReshapeUpWithShapeOf") + postfix + ".svg")).run_on_model(model);}{@@ -2584,7 +2599,7 @@ TEST_F(TransformationTestsF, MaskPropagationReshapeUpShapeSubGraph) {}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeUpShapeSubGraph.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationReshapeUpShapeSubGraph.svg").run_on_model(model);{pass::Manager m;@@ -2676,7 +2691,8 @@ TEST_F(TransformationTestsF, MaskPropagationReshapeExtend) {}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeExtend.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationReshapeExtend.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -2782,7 +2798,8 @@ TEST_F(DISABLED_TransformationTestsF, MaskPropagationReshapeDownMul) {model_ref = std::make_shared<ov::Model>(OutputVector{last_conv}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeDownMul.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationReshapeDownMul.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -2885,7 +2902,8 @@ TEST_F(TransformationTestsF, MaskPropagationReshapeDownAdd) {model_ref = std::make_shared<ov::Model>(OutputVector{last_conv}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeDownAdd.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationReshapeDownAdd.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -2933,7 +2951,8 @@ TEST(TransformationTests, MaskPropagationStopReshapeUp) {auto model = std::make_shared<ov::Model>(OutputVector{conv_1}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationStopReshapeUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationStopReshapeUp.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -2989,7 +3008,7 @@ TEST(TransformationTests, MaskPropagationStopReshapeDown) {auto model = std::make_shared<ov::Model>(OutputVector{last_conv}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationStopReshapeDown.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationStopReshapeDown.svg").run_on_model(model);{pass::Manager m;@@ -3047,7 +3066,7 @@ TEST_F(TransformationTestsF, MaskPropagationReshapeUnsqueezeUp) {model_ref = std::make_shared<ov::Model>(OutputVector{mul_left}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeUnsqueezeUp.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationReshapeUnsqueezeUp.svg").run_on_model(model);{pass::Manager m;@@ -3109,7 +3128,7 @@ TEST_F(TransformationTestsF, MaskPropagationReshapeUnsqueezeDown) {model_ref = std::make_shared<ov::Model>(OutputVector{mul_left}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapeUnsqueezeDown.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationReshapeUnsqueezeDown.svg").run_on_model(model);{pass::Manager m;@@ -3170,7 +3189,7 @@ TEST(TransformationTests, MaskPropagationWrongDimsElementwise) {auto model = std::make_shared<ov::Model>(OutputVector{last_conv}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationWrongDimsElementwise.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationWrongDimsElementwise.svg").run_on_model(model);pass::Manager m;@@ -3282,7 +3301,7 @@ TEST_F(TransformationTestsF, PruneSEBlock) {model_ref = std::make_shared<ov::Model>(OutputVector{end_conv}, ParameterVector{input}, "SEBlock");}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneSEBlock.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneSEBlock.svg").run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -3373,7 +3392,8 @@ TEST_F(TransformationTestsF, PropagateMasksLinear) {model_ref = std::make_shared<Model>(OutputVector{last_linear}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksLinear.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksLinear.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -3424,7 +3444,7 @@ TEST(TransformationTests, MaskPropagationMatMulStopEmptyABranch) {auto model = std::make_shared<ov::Model>(OutputVector{mul_left}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationMatMulStopEmptyABranch.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationMatMulStopEmptyABranch.svg").run_on_model(model);{pass::Manager m;@@ -3492,7 +3512,7 @@ TEST(TransformationTests, PruneLinearUp) {auto model = std::make_shared<ov::Model>(OutputVector{last_linear}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneLinearUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneLinearUp.svg").run_on_model(model);pass::Manager m;m.register_pass<ov::pass::Pruning>();@@ -3549,7 +3569,7 @@ TEST(TransformationTests, PruneConvUpShort) {auto model = std::make_shared<ov::Model>(OutputVector{last_conv}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneConvUpShort.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneConvUpShort.svg").run_on_model(model);pass::Manager m;m.register_pass<ov::pass::Pruning>();@@ -3623,7 +3643,7 @@ TEST_F(TransformationTestsF, MaskPropagationLinearOuterDims) {model_ref = std::make_shared<ov::Model>(OutputVector{last_mul}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationLinearOuterDims.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationLinearOuterDims.svg").run_on_model(model);{pass::Manager m;@@ -3702,7 +3722,7 @@ TEST(TransformationTests, MaskPropagationStopLinearOuterDims) {auto model = std::make_shared<ov::Model>(OutputVector{last_mul}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationStopLinearOuterDims.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationStopLinearOuterDims.svg").run_on_model(model);{pass::Manager m;@@ -3793,7 +3813,7 @@ TEST_F(TransformationTestsF, PruneMasksMatMulColsStopRowsUp) {model_ref = std::make_shared<Model>(OutputVector{last_linear}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneMasksMatMulColsStopRowsUp.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneMasksMatMulColsStopRowsUp.svg").run_on_model(model);{pass::Manager m;@@ -3882,7 +3902,7 @@ TEST_F(TransformationTestsF, PruneMasksMatMulRowsStopColsUp) {model_ref = std::make_shared<Model>(OutputVector{last_linear}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PruneMasksMatMulRowsStopColsUp.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PruneMasksMatMulRowsStopColsUp.svg").run_on_model(model);{pass::Manager m;@@ -3978,7 +3998,7 @@ TEST_F(TransformationTestsF, PropagateFlattenUp) {model_ref = std::make_shared<Model>(OutputVector{linear}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateFlattenUp.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateFlattenUp.svg").run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -4052,7 +4072,8 @@ TEST_F(TransformationTestsF, PropagateFlattenDown) {model_ref = std::make_shared<ov::Model>(OutputVector{linear}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateFlattenDown.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateFlattenDown.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -4110,7 +4131,8 @@ TEST_F(TransformationTestsF, PropagateMasksTranspose) {model_ref = std::make_shared<Model>(OutputVector{last_mul}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksTranspose.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksTranspose.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -4182,7 +4204,7 @@ TEST_F(TransformationTestsF, PropagateMasksTransposeComplex) {model_ref = std::make_shared<Model>(OutputVector{last_mul}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksTransposeComplex.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksTransposeComplex.svg").run_on_model(model);{pass::Manager m;@@ -4222,7 +4244,8 @@ TEST(TransformationTests, PropagateMasksTransposeStop) {auto model = std::make_shared<Model>(OutputVector{last_mul}, ParameterVector{input});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksTransposeStop.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksTransposeStop.svg")+ .run_on_model(model);{pass::Manager m;m.register_pass<ov::pass::InitMasks>();@@ -4346,7 +4369,8 @@ TEST_F(DISABLED_TransformationTestsF, PropagateMasksBroadcastedEltwiseWithInputsParameterVector{input, dummy_eltwise_inputs, dummy_eltwise_weights});}if (VISUALIZE_TESTS_TREE) {- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksBroadcastedEltwiseWithInputs.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /+ "PropagateMasksBroadcastedEltwiseWithInputs.svg").run_on_model(model);}{@@ -4523,7 +4547,7 @@ TEST_F(TransformationTestsF, PropagateMasksBroadcastedEltwise) {model_ref = std::make_shared<ov::Model>(OutputVector{last_mul}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE) {- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "PropagateMasksBroadcastedEltwise.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "PropagateMasksBroadcastedEltwise.svg").run_on_model(model);}{@@ -4686,7 +4710,8 @@ TEST_F(TransformationTestsF, MaskPropagationComplexReshape) {model_ref = std::make_shared<ov::Model>(OutputVector{mul_last}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE) {- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationComplexReshape.svg").run_on_model(model);+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationComplexReshape.svg")+ .run_on_model(model);}{pass::Manager m;@@ -4762,7 +4787,7 @@ TEST_F(TransformationTestsF, MaskPropagationComplexReshape) {manager.register_pass<ov::pass::ShrinkWeights>();if (VISUALIZE_TESTS_TREE) {manager.register_pass<pass::VisualizeTree>(- std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationComplexReshapeWithMasks.svg",+ std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationComplexReshapeWithMasks.svg",modifier);}}@@ -4879,7 +4904,8 @@ TEST_P(TransformationTestsBoolParamF, MaskPropagationReshapedPassThroughP) {}if (VISUALIZE_TESTS_TREE) {auto postfix = (add_shape_of) ? "True" : "False";- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReshapedPassThroughP" + postfix + ".svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /+ (std::string("MaskPropagationReshapedPassThroughP") + postfix + ".svg")).run_on_model(model);}{@@ -4956,7 +4982,8 @@ TEST_P(TransformationTestsBoolParamF, MaskPropagationReshapedPassThroughP) {if (VISUALIZE_TESTS_TREE) {auto postfix = (add_shape_of) ? "True" : "False";manager.register_pass<pass::VisualizeTree>(- std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationReverseFlattenWithMasks" + postfix + ".svg",+ std::filesystem::path(VISUALIZE_TREE_ROOT) /+ (std::string("MaskPropagationReverseFlattenWithMasks") + postfix + ".svg"),modifier);}comparator.enable(FunctionsComparator::CmpValues::ACCURACY);@@ -5005,8 +5032,8 @@ TEST_P(TransformationTestsBoolParamF, MaskPropagationBroadcastedSameRankEltwiseS}if (VISUALIZE_TESTS_TREE) {auto postfix = (reverse_mul) ? "True" : "False";- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) +- "MaskPropagationBroadcastedSameRankEltwiseSwappedLayoutP" + postfix + ".svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /+ (std::string("MaskPropagationBroadcastedSameRankEltwiseSwappedLayoutP") + postfix + ".svg")).run_on_model(model);}{@@ -5052,8 +5079,8 @@ TEST(TransformationTests, MaskPropagationBroadcastedEltwiseInputAndWeightsBroadcauto model = std::make_shared<ov::Model>(OutputVector{mul_last}, ParameterVector{input});if (VISUALIZE_TESTS_TREE) {- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) +- "MaskPropagationBroadcastedEltwiseInputAndWeightsBroadcasted.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /+ (std::string("MaskPropagationBroadcastedEltwiseInputAndWeightsBroadcasted") + ".svg")).run_on_model(model);}{@@ -5102,7 +5129,7 @@ TEST(TransformationTests, MaskPropagationBroadcastedEltwiseWrongBroadcastingModeauto model = std::make_shared<ov::Model>(OutputVector{mul_last}, ParameterVector{input});if (VISUALIZE_TESTS_TREE) {- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) ++ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) /"MaskPropagationBroadcastedEltwiseWrongBroadcastingMode.svg").run_on_model(model);}@@ -5167,7 +5194,7 @@ TEST_F(TransformationTestsF, MaskPropagationMatMulWithSeveralOutputs) {model_ref = std::make_shared<ov::Model>(OutputVector{left_matmul, right_matmul}, ParameterVector{input});}if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "MaskPropagationMatMulWithSeveralOutputs.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "MaskPropagationMatMulWithSeveralOutputs.svg").run_on_model(model);{pass::Manager m;@@ -5198,7 +5225,7 @@ TEST(TransformationTests, CheckReshapeWithNoConstInShape) {auto model = std::make_shared<Model>(OutputVector{reshape}, ParameterVector{input, input_shape});if (VISUALIZE_TESTS_TREE)- pass::VisualizeTree(std::string(VISUALIZE_TREE_ROOT) + "CheckReshapeWithNoConstInShape.svg")+ pass::VisualizeTree(std::filesystem::path(VISUALIZE_TREE_ROOT) / "CheckReshapeWithNoConstInShape.svg").run_on_model(model);pass::Manager m;diff --git a/src/core/include/openvino/pass/visualize_tree.hpp b/src/core/include/openvino/pass/visualize_tree.hppindex fce787a8470..907f4475b77 100644--- a/src/core/include/openvino/pass/visualize_tree.hpp+++ b/src/core/include/openvino/pass/visualize_tree.hpp@@ -4,6 +4,7 @@#pragma once+#include <filesystem>#include <functional>#include <set>#include <sstream>@@ -20,8 +21,7 @@ class HeightMap;using visualize_tree_ops_map_t =std::unordered_map<ov::Node::type_info_t, std::function<void(const ov::Node&, std::ostream& ss)>>;-namespace ov {-namespace pass {+namespace ov::pass {/*** @brief VisualizeTree pass allows to serialize ov::Model to xDot format* @ingroup ov_pass_cpp_api@@ -31,7 +31,21 @@ public:OPENVINO_MODEL_PASS_RTTI("ov::pass::VisualizeTree");using node_modifiers_t = std::function<void(const Node& node, std::vector<std::string>& attributes)>;+VisualizeTree(const std::string& file_name, node_modifiers_t nm = nullptr, bool dot_only = false);+ VisualizeTree(std::filesystem::path file_name, node_modifiers_t nm = nullptr, bool dot_only = false);++ template <class TPath>+ VisualizeTree(const TPath& file_name, node_modifiers_t nm = nullptr, bool dot_only = false)+ : VisualizeTree(+ [&] {+ static_assert(std::is_constructible_v<std::filesystem::path, std::decay_t<TPath>>,+ "file_name type is not supported");+ return std::string(file_name);+ }(),+ nm,+ dot_only) {}+bool run_on_model(const std::shared_ptr<ov::Model>&) override;void set_ops_to_details(const visualize_tree_ops_map_t& ops_map) {@@ -50,7 +64,7 @@ protected:void render() const;std::stringstream m_ss;- std::string m_name;+ std::filesystem::path m_name;std::set<std::shared_ptr<Node>> m_nodes_with_attributes;visualize_tree_ops_map_t m_ops_to_details;node_modifiers_t m_node_modifiers = nullptr;@@ -58,5 +72,4 @@ protected:static constexpr int max_jump_distance = 20;std::unordered_map<std::shared_ptr<ov::Symbol>, size_t> m_symbol_to_name;};-} // namespace pass-} // namespace ov+} // namespace ov::passdiff --git a/src/core/src/pass/manager.cpp b/src/core/src/pass/manager.cppindex 7d9b8e33456..7ae0e87997f 100644--- a/src/core/src/pass/manager.cpp+++ b/src/core/src/pass/manager.cpp@@ -248,8 +248,8 @@ public:static size_t viz_index = 0;if (m_visualize.is_enabled()) {const auto& _visualize = [&]() {- const auto& file_name = gen_file_name(model->get_name(), pass_name, viz_index++);- ov::pass::VisualizeTree vt(file_name + ".svg");+ auto file_name = gen_file_name(model->get_name(), pass_name, viz_index++);+ ov::pass::VisualizeTree vt(file_name.concat(".svg"));vt.run_on_model(model);};@@ -271,8 +271,8 @@ public:static size_t serialize_index = 0;if (m_serialize.is_enabled()) {const auto& _serialize = [&]() {- const auto& file_name = gen_file_name(model->get_name(), pass_name, serialize_index++);- ov::pass::Serialize serialize(file_name + ".xml", file_name + ".bin");+ auto file_name = gen_file_name(model->get_name(), pass_name, serialize_index++);+ ov::pass::Serialize serialize(file_name.concat(".xml"), {});serialize.run_on_model(model);};@@ -291,15 +291,17 @@ public:}private:- static std::string gen_file_name(const std::string& model_name, const std::string& pass_name, const size_t idx) {- std::stringstream name;+ static std::filesystem::path gen_file_name(const std::string& model_name,+ const std::string& pass_name,+ const size_t idx) {// visualizations and serializations will be named after the outermost functionstd::string index_str = std::to_string(idx);const size_t num_digits_in_pass_index = index_str.length() > 2LU ? 0LU : (3LU - index_str.length());index_str = std::string(num_digits_in_pass_index, '0') + index_str;- name << model_name << std::string("_") << index_str << std::string("_") << pass_name;- return name.str();+ std::filesystem::path file_name{model_name};+ file_name += "_" + index_str + "_" + pass_name;+ return file_name;}std::unordered_map<std::string, stopwatch> stopwatches;diff --git a/src/core/src/pass/visualize_tree.cpp b/src/core/src/pass/visualize_tree.cppindex 066d1571836..9b6605c56fc 100644--- a/src/core/src/pass/visualize_tree.cpp+++ b/src/core/src/pass/visualize_tree.cpp@@ -167,16 +167,15 @@ static std::string get_attribute_values(const std::map<std::string, ov::Any>& atreturn ss.str();}-static std::string name_of_subgraph_file(const std::shared_ptr<ov::Node> op,- const std::string& current_file_name,- const size_t& i) {+static std::filesystem::path name_of_subgraph_file(const std::shared_ptr<ov::Node> op,+ const std::filesystem::path& current_file_name,+ const size_t i) {// friendly is never empty it is either friendly (set by user) or unique (auto-generated) nameauto node_name = op->get_friendly_name();std::replace(node_name.begin(), node_name.end(), '/', '-');- auto postfix = "_node_" + node_name + "_subgraph_#" + std::to_string(i);+auto file_name = current_file_name;- auto insert_pos = file_name.find_last_of('.');- file_name.insert(insert_pos, postfix);+ file_name.replace_extension("._node_" + node_name + "_subgraph_#" + std::to_string(i));return file_name;}@@ -279,7 +278,10 @@ bool ov::pass::VisualizeTree::run_on_model(const std::shared_ptr<ov::Model>& f)}ov::pass::VisualizeTree::VisualizeTree(const std::string& file_name, node_modifiers_t nm, bool dot_only)- : m_name{file_name},+ : VisualizeTree(ov::util::make_path(file_name), std::move(nm), dot_only) {}++ov::pass::VisualizeTree::VisualizeTree(std::filesystem::path file_name, node_modifiers_t nm, bool dot_only)+ : m_name{std::move(file_name)},m_node_modifiers{std::move(nm)},m_dot_only{dot_only} {}@@ -674,26 +676,27 @@ std::string ov::pass::VisualizeTree::get_node_name(std::shared_ptr<Node> node) {}void ov::pass::VisualizeTree::render() const {- std::string ext = ov::util::get_file_ext(m_name);- std::string output_format = ext.substr(1);- std::string dot_file = m_name;- if (ov::util::to_lower(ext) != ".dot") {- dot_file += ".dot";+ constexpr auto dot_ext = ".dot";+ const auto ext = m_name.extension();+ auto dot_file = m_name;+ if (ext != dot_ext) {+ dot_file += dot_ext;}- std::ofstream out(dot_file);- if (out) {++ if (std::ofstream out(dot_file); out) {out << "digraph \n{\n";out << m_ss.str();out << "}\n";out.close();- if (!m_dot_only && ov::util::to_lower(ext) != ".dot") {+ if (!m_dot_only && ext != dot_ext) {#if defined(ENABLE_OPENVINO_DEBUG) && !defined(_WIN32)std::stringstream ss;if (system("command -v dot > /dev/null 2>&1") != 0) {OPENVINO_THROW("Graphviz 'dot' command not found in PATH");}- ss << "dot -T" << output_format << " " << dot_file << " -o" << m_name;+ ss << "dot -T" << ext.string().substr(1) << " " << ov::util::path_to_string(dot_file) << " -o"+ << ov::util::path_to_string(m_name);auto cmd = ss.str();auto stream = popen(cmd.c_str(), "r");if (stream) {diff --git a/src/core/tests/pass/visualize_tree.cpp b/src/core/tests/pass/visualize_tree.cppindex ff43f292d4e..bfa0afdbd2d 100644--- a/src/core/tests/pass/visualize_tree.cpp+++ b/src/core/tests/pass/visualize_tree.cpp@@ -10,8 +10,7 @@#include "openvino/op/add.hpp"#include "openvino/op/constant.hpp"-namespace ov {-namespace test {+namespace ov::test {using ov::op::v0::Constant;using ov::op::v0::Parameter;@@ -22,11 +21,11 @@ class VisualizeTreeTest : public testing::Test {protected:void TearDown() override {if (util::file_exists(vt_svg_file_path)) {- std::remove(vt_svg_file_path.c_str());+ std::filesystem::remove(vt_svg_file_path);}if (util::file_exists(dot_file_path)) {- std::remove(dot_file_path.c_str());+ std::filesystem::remove(dot_file_path);}}@@ -38,9 +37,9 @@ protected:return std::make_shared<Model>(ResultVector{output}, ParameterVector{input});}- const std::string vt_svg_file_path =- util::path_join({utils::getExecutableDirectory(), utils::generateTestFilePrefix() + "_tree.svg"}).string();- const std::string dot_file_path = vt_svg_file_path + ".dot";+ const std::filesystem::path vt_svg_file_path =+ ov::util::make_path(utils::getExecutableDirectory()) / (utils::generateTestFilePrefix() + "_tree.svg");+ const std::filesystem::path dot_file_path = vt_svg_file_path.string() + ".dot";};TEST_F(VisualizeTreeTest, model_has_constant_with_inf) {@@ -62,5 +61,4 @@ TEST_F(VisualizeTreeTest, model_has_constant_with_no_inf) {OV_ASSERT_NO_THROW(vt.run_on_model(model));ASSERT_TRUE(util::file_exists(dot_file_path)) << dot_file_path;}-} // namespace test-} // namespace ov+} // namespace ov::testdiff --git a/src/plugins/intel_gpu/src/plugin/plugin.cpp b/src/plugins/intel_gpu/src/plugin/plugin.cppindex 4e3f9f14273..14a2a08f63d 100644--- a/src/plugins/intel_gpu/src/plugin/plugin.cpp+++ b/src/plugins/intel_gpu/src/plugin/plugin.cpp@@ -39,6 +39,7 @@#include "openvino/runtime/properties.hpp"#include "openvino/runtime/shared_buffer.hpp"#include "openvino/runtime/weightless_properties_utils.hpp"+#include "openvino/util/file_util.hpp"#include "openvino/util/weights_path.hpp"#include "transformations/common_optimizations/dimension_tracking.hpp"#include "transformations/init_node_info.hpp"@@ -164,8 +165,8 @@ std::shared_ptr<ov::Model> Plugin::clone_and_transform_model(const std::shared_pstd::string dump_path = GPU_DEBUG_VALUE_OR(config_copy.get_dump_graphs_path(), "");GPU_DEBUG_IF(!dump_path.empty()) {- auto path_base = dump_path + "/" + cloned_model->get_name();- ov::pass::VisualizeTree(path_base + ".svg").run_on_model(cloned_model);+ auto path_base = ov::util::make_path(dump_path) / (cloned_model->get_name() + ".svg");+ ov::pass::VisualizeTree(path_base).run_on_model(cloned_model);}// Set weightless cache attribute only for non IR (e.g. onnxruntime) models@@ -193,8 +194,8 @@ std::shared_ptr<ov::Model> Plugin::clone_and_transform_model(const std::shared_p}GPU_DEBUG_IF(!dump_path.empty()) {- auto path_base = dump_path + "/" + cloned_model->get_name() + "_" + "transformed_func";- ov::pass::VisualizeTree(path_base + ".svg").run_on_model(cloned_model);+ auto path_base = std::filesystem::path(dump_path) / (cloned_model->get_name() + "_" + "transformed_func.svg");+ ov::pass::VisualizeTree(path_base).run_on_model(cloned_model);}return cloned_model;}