[HETERO] Remove WA for Parameters, Results and Constants. (#15020)
* [HETERO] Remove WA for Parameters, Results and Constants. * Update HeteroSyntheticTest
This commit is contained in:
parent
26934332cd
commit
a8a59f3cb4
@ -112,23 +112,6 @@ HeteroExecutableNetwork::HeteroExecutableNetwork(const InferenceEngine::CNNNetwo
|
|||||||
return input.get_source_output().get_node();
|
return input.get_source_output().get_node();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set results, constants and parameters affinity
|
|
||||||
for (auto&& node : clonedFunction->get_ops()) {
|
|
||||||
if (ngraph::op::is_constant(node) || ngraph::op::is_output(node) || ngraph::op::is_parameter(node)) {
|
|
||||||
if (!contains(queryNetworkResult.supportedLayersMap, node->get_friendly_name())) {
|
|
||||||
auto& nodeWithAffinityName =
|
|
||||||
ngraph::op::is_output(node)
|
|
||||||
? node->input_value(0).get_node()->get_friendly_name()
|
|
||||||
: node->output(0).get_target_inputs().begin()->get_node()->get_friendly_name();
|
|
||||||
auto itAffinity = queryNetworkResult.supportedLayersMap.find(nodeWithAffinityName);
|
|
||||||
if (itAffinity == queryNetworkResult.supportedLayersMap.end()) {
|
|
||||||
IE_THROW() << "Node " << nodeWithAffinityName << " was not assigned on any pointed device.";
|
|
||||||
}
|
|
||||||
queryNetworkResult.supportedLayersMap.emplace(node->get_friendly_name(), itAffinity->second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unordered_set<std::string> devices;
|
std::unordered_set<std::string> devices;
|
||||||
NodeMap<std::string> affinities;
|
NodeMap<std::string> affinities;
|
||||||
// Check that all nodes has user or plugin defined affinities
|
// Check that all nodes has user or plugin defined affinities
|
||||||
|
@ -165,19 +165,26 @@ std::string HeteroSyntheticTest::SetUpAffinity() {
|
|||||||
auto& pluginParameters = std::get<Plugin>(param);
|
auto& pluginParameters = std::get<Plugin>(param);
|
||||||
affinities += "\n{\n";
|
affinities += "\n{\n";
|
||||||
for (auto&& node : std::get<Function>(param)._function->get_ordered_ops()) {
|
for (auto&& node : std::get<Function>(param)._function->get_ordered_ops()) {
|
||||||
if (!ngraph::op::is_constant(node) &&
|
std::string affinity;
|
||||||
!(ngraph::op::is_parameter(node)) &&
|
auto get_affinity = [&](const std::string& name) {
|
||||||
!(ngraph::op::is_output(node))) {
|
|
||||||
std::string affinity;
|
|
||||||
if (std::get<Function>(param)._majorPluginNodeIds.end() !=
|
if (std::get<Function>(param)._majorPluginNodeIds.end() !=
|
||||||
std::get<Function>(param)._majorPluginNodeIds.find(node->get_friendly_name())) {
|
std::get<Function>(param)._majorPluginNodeIds.find(name)) {
|
||||||
affinity = pluginParameters.at(0)._name;
|
return pluginParameters.at(0)._name;
|
||||||
} else {
|
} else {
|
||||||
affinity = pluginParameters.at(1)._name;
|
return pluginParameters.at(1)._name;
|
||||||
}
|
}
|
||||||
node->get_rt_info()["affinity"] = affinity;
|
};
|
||||||
affinities += "\t{\"" + node->get_friendly_name() + "\",\t\t\"" + affinity + "\"}\n";
|
if (ngraph::op::is_constant(node) || ngraph::op::is_output(node) || ngraph::op::is_parameter(node)) {
|
||||||
|
auto& node_with_affinity_name =
|
||||||
|
ngraph::op::is_output(node)
|
||||||
|
? node->input_value(0).get_node()->get_friendly_name()
|
||||||
|
: node->output(0).get_target_inputs().begin()->get_node()->get_friendly_name();
|
||||||
|
affinity = get_affinity(node_with_affinity_name);
|
||||||
|
} else {
|
||||||
|
affinity = get_affinity(node->get_friendly_name());
|
||||||
}
|
}
|
||||||
|
node->get_rt_info()["affinity"] = affinity;
|
||||||
|
affinities += "\t{\"" + node->get_friendly_name() + "\",\t\t\"" + affinity + "\"}\n";
|
||||||
}
|
}
|
||||||
affinities += "}";
|
affinities += "}";
|
||||||
affinities += "\nseed = " + std::to_string(std::get<Function>(param)._seed);
|
affinities += "\nseed = " + std::to_string(std::get<Function>(param)._seed);
|
||||||
|
Loading…
Reference in New Issue
Block a user