From 4239108b9fd96b20a148894850e01cf23995012b Mon Sep 17 00:00:00 2001 From: sfatimar Date: Wed, 16 Jul 2025 22:05:07 +0530 Subject: [PATCH] Revert "Cluster Change to avoid Dangling DQLinear (#739)" This reverts commit 89ccd8175408e92679afb95d2c182cc88acbdbe4. --- .../openvino/ov_versions/capability.cc | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/onnxruntime/core/providers/openvino/ov_versions/capability.cc b/onnxruntime/core/providers/openvino/ov_versions/capability.cc index 85c7489fd75d6..88ddde8610c6e 100644 --- a/onnxruntime/core/providers/openvino/ov_versions/capability.cc +++ b/onnxruntime/core/providers/openvino/ov_versions/capability.cc @@ -168,33 +168,17 @@ std::vector> GetCapability::Execute() { auto connected_clusters = GetConnectedClusters(graph_viewer_, ng_clusters); int no_of_clusters = 0; - std::vector prev_cluster; - bool try_next_cluster = false; for (auto this_cluster : connected_clusters) { - bool omit_subgraph = false; - if (try_next_cluster) { - // no need to check previous cluster - for (auto idx : prev_cluster) { - if ((std::find(this_cluster.begin(), this_cluster.end(), idx)) == this_cluster.end()) { - this_cluster.emplace_back(idx); - } - } - try_next_cluster = false; - } - // If subgraph has less then three, graph is considered trivial unless its an epctx cluster - if (!try_next_cluster && this_cluster.size() < 3) { + if (this_cluster.size() < 3) { bool is_epctx_node = false; for (auto node_idx : this_cluster) { if (graph_viewer_.GetNode(node_idx)->OpType() == "EPContext") is_epctx_node = true; } - if (!is_epctx_node) { - omit_subgraph = true; - prev_cluster = this_cluster; - try_next_cluster = true; - } + if (!is_epctx_node) + continue; } std::vector cluster_graph_inputs, cluster_inputs, cluster_outputs; @@ -206,7 +190,7 @@ std::vector> GetCapability::Execute() { cluster_inputs, cluster_outputs); - + bool omit_subgraph = false; // Omitting zero dim subgraphs for (auto index : this_cluster) { const Node* node = graph_viewer_.GetNode(index);