Skip to content

Commit

Permalink
[IE][VPU]: Execution graph via ngraph for VPU plugin (#1572)
Browse files Browse the repository at this point in the history
* Execution graph via ngraph for VPU plugin
* Enable ExecGraphTests
* Assert throw for multi device in tests
* Assert throw for gna device in tests
  • Loading branch information
Anton Dudchenko authored Aug 20, 2020
1 parent 920bf23 commit de8bfae
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ struct StageMetaInfo final {
std::vector<ie::Precision> outPrecisions;
std::vector<ie::Layout> outLayouts;

int inputsNum = 0;

std::string layerName;
std::string layerType;

Expand All @@ -35,6 +33,12 @@ struct StageMetaInfo final {
std::string stageName;
std::string stageType;

std::vector<size_t> parentIndices;
std::vector<ie::Precision> inputPrecisions;
std::vector<ie::SizeVector> inputDims;

size_t childsNum = 0;

int execOrder = -1;
float execTime = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@

namespace vpu {

InferenceEngine::ICNNNetwork::Ptr buildRuntimeGraphAsIeNet(
GraphMetaInfo& graphMetaInfo,
const std::vector<float>& perfInfo);
InferenceEngine::ICNNNetwork::Ptr buildRuntimeGraph(
GraphMetaInfo &graphMetaInfo,
GraphMetaInfo& graphMetaInfo,
const std::vector<float>& perfInfo);


} // namespace vpu
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void BackEnd::getMetaData(
}

if (stage->origLayer() == nullptr) {
stageMeta.layerName = "<Extra>";
stageMeta.layerName = "";
stageMeta.layerType = "<Extra>";
} else {
const auto& origLayer = stage->origLayer();
Expand Down Expand Up @@ -125,13 +125,22 @@ void BackEnd::getMetaData(
}

if (data->usage() != DataUsage::Output) {
size_t prIndex;
if (data->usage() == DataUsage::Input) {
prIndex = stagesMeta.size() - 1;
} else {
prIndex = stageToMetaIndex.find(data->producer())->second;
}

for (const auto &child : data->consumers()) {
auto it = stageToMetaIndex.find(child);

if (it != stageToMetaIndex.end()) {
StageMetaInfo& meta = stagesMeta[it->second];

meta.inputsNum++;
stagesMeta[prIndex].childsNum++;
meta.parentIndices.push_back(prIndex);
meta.inputDims.push_back(dataMeta.desc.getDims());
meta.inputPrecisions.push_back(dataMeta.desc.getPrecision());
dataMeta.childrenIndices.push_back(it->second);
}
}
Expand Down
Loading

0 comments on commit de8bfae

Please sign in to comment.