Skip to content

Commit

Permalink
remove dead code in openvino EP (#18457)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->
Remove dead code in openvino EP


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Remove dead code in openvino EP
  • Loading branch information
jslhcl authored Nov 27, 2023
1 parent dd355e3 commit b9fd9c5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
13 changes: 1 addition & 12 deletions onnxruntime/core/providers/openvino/ov_versions/capability.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,15 @@ std::vector<std::unique_ptr<ComputeCapability>> GetCapability::Execute() {
// If subgraph has less then three, graph is considered trivial
if (this_cluster.size() < 3) {
continue;
} else {
// If subgraph only has Identity node, EyeLike or Dropout, OpenVINO EP doesn't support it.
if (this_cluster.size() == 1) {
const auto& node = graph_viewer_.GetNode(this_cluster[0]);
if (IsOpSupportedOnlyInModel(node->OpType()))
continue;
// If reshape is not an intermediate node, shape needs to be an initializer
if (data_ops_->SpecialConditionForClusterSizeOne(ng_required_initializers, node))
continue;
}
}

std::vector<std::string> cluster_graph_inputs, cluster_inputs, const_inputs, cluster_outputs;
std::vector<std::string> cluster_graph_inputs, cluster_inputs, cluster_outputs;

GetInputsOutputsOfCluster(graph_viewer_,
this_cluster,
ng_required_initializers,
cluster_graph_inputs,
cluster_inputs,
const_inputs,
cluster_outputs);

bool omit_subgraph = false;
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/openvino/ov_versions/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ void GetInputsOutputsOfCluster(const GraphViewer& graph_viewer,
const std::unordered_set<std::string>& ng_required_initializers,
/*out*/ std::vector<std::string>& cluster_graph_inputs,
/*out*/ std::vector<std::string>& cluster_inputs,
/*out*/ std::vector<std::string>& constant_inputs,
/*out*/ std::vector<std::string>& cluster_outputs) {
std::unordered_set<std::string> input_args;
std::vector<std::string> ordered_input_args;
std::unordered_set<std::string> output_args;
std::unordered_set<std::string> external_output_args;
std::vector<std::string> constant_inputs;

for (const auto& node_idx : cluster) {
const auto& node = graph_viewer.GetNode(node_idx);
Expand Down
1 change: 0 additions & 1 deletion onnxruntime/core/providers/openvino/ov_versions/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ void GetInputsOutputsOfCluster(const GraphViewer& graph_viewer,
const std::unordered_set<std::string>& ng_required_initializers,
/*out*/ std::vector<std::string>& cluster_graph_inputs,
/*out*/ std::vector<std::string>& cluster_inputs,
/*out*/ std::vector<std::string>& constant_inputs,
/*out*/ std::vector<std::string>& cluster_outputs);

} // namespace openvino_ep
Expand Down

0 comments on commit b9fd9c5

Please sign in to comment.