diff --git a/src/plugins/intel_gna/src/debug_new_pass.cpp b/src/plugins/intel_gna/src/debug_new_pass.cpp index 4bdd50b4e6a9fe..33e3679284a8fb 100644 --- a/src/plugins/intel_gna/src/debug_new_pass.cpp +++ b/src/plugins/intel_gna/src/debug_new_pass.cpp @@ -17,10 +17,13 @@ void DebugVisualize(ov::pass::Manager& manager, const std::string& name) { #ifdef DEBUG_VISUALIZE static unsigned counter = 0; std::stringstream ss; +#ifdef DEBUG_VISUALIZETREE ss << counter << name << ".png"; manager.register_pass(ss.str()); - //ss << counter << name; - //manager.register_pass(ss.str() + ".xml", ss.str() + ".bin"); +#else + ss << counter << name; + manager.register_pass(ss.str() + ".xml", ss.str() + ".bin"); +#endif ++counter; #endif } diff --git a/src/plugins/intel_gna/src/debug_new_pass.hpp b/src/plugins/intel_gna/src/debug_new_pass.hpp index 9bb85cf509c0b0..c75cd4ad566607 100644 --- a/src/plugins/intel_gna/src/debug_new_pass.hpp +++ b/src/plugins/intel_gna/src/debug_new_pass.hpp @@ -11,6 +11,8 @@ #undef DEBUG_VISUALIZE //#define DEBUG_VISUALIZE 1 +#undef DEBUG_VISUALIZETREE +//#define DEBUG_VISUALIZETREE 1 #define EMUTEX_DEBUG_CHECKPOINT std::cout << "[EMUTEX DEBUG] CHECKPOINT " << __FILE__ << ":" << __LINE__ << std::endl; #define EMUTEX_DEBUG_CHECKPOINT_MESSAGE(message) std::cout << "[EMUTEX DEBUG] CHECKPOINT " << __FILE__ << ":" << __LINE__ << \ diff --git a/src/plugins/intel_gna/src/gna_transformations_pipeline.cpp b/src/plugins/intel_gna/src/gna_transformations_pipeline.cpp index 9ec84366eca7c2..8f0b80b253bcf2 100644 --- a/src/plugins/intel_gna/src/gna_transformations_pipeline.cpp +++ b/src/plugins/intel_gna/src/gna_transformations_pipeline.cpp @@ -80,6 +80,7 @@ void TransformationsPipeline::apply(const std::shared_ptr& model, // In OV API 2.0(IRv10) default convertion to fp32 (inputs, outputs and weights) is disabled // and we need to run the ConvertPrecision transformation to support old networks. manager.register_pass(precisions_array{{ngraph::element::f16, ngraph::element::f32}}); + intel_gna_debug::DebugVisualize(manager, "start"); manager.register_pass(); manager.register_pass(); manager.register_pass(); @@ -124,16 +125,17 @@ void TransformationsPipeline::apply(const std::shared_ptr& model, manager.register_pass(); // TODO enable this transformation for networks without convolutions if (ov::op::util::has_op_with_type(model) || ov::op::util::has_op_with_type(model)) { - manager.register_pass(); - manager.register_pass(); - manager.register_pass(); - manager.register_pass(); - manager.register_pass(); - manager.register_pass(); - manager.register_pass(); + manager.register_pass(); + manager.register_pass(); + manager.register_pass(); + manager.register_pass(); + manager.register_pass(); + manager.register_pass(); + manager.register_pass(); } manager.register_pass(subgraph_cpu_map); manager.register_pass(subgraph_cpu_map); + intel_gna_debug::DebugVisualize(manager, "after_our_transformations"); manager.register_pass(); manager.register_pass(); manager.register_pass(); @@ -195,6 +197,8 @@ void TransformationsPipeline::apply(const std::shared_ptr& model, // Operations Max and Min aren't supported pass_config->disable(); + intel_gna_debug::DebugVisualize(manager, "final"); + manager.run_passes(model); is_ngraph_passes_used = true; diff --git a/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp b/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp index 5f13a178cd68aa..bc867f2a75a434 100644 --- a/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp +++ b/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp @@ -142,6 +142,9 @@ bool AreFlattenShapes(const Shape& shape1, const Shape& shape2) { while (shape1[i] == shape2[i]) { ++i; } + // consider only last dimension to be flatten/unflatten + if (shape1.size() - 1 != i && shape2.size() - 1 != i) + return false; // min_shape.back() == MULTIPLY(max_shape.begin() + i, max_shape.end()) const size_t mult1 = std::accumulate(shape1.begin() + i, shape1.end(), 1, std::multiplies()); const size_t mult2 = std::accumulate(shape2.begin() + i, shape2.end(), 1, std::multiplies());