Skip to content

Commit

Permalink
Enabled Convolution + post ops fusing (openvinotoolkit#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-gorokhov committed Mar 25, 2021
1 parent f0dab6a commit 1ec5f8c
Show file tree
Hide file tree
Showing 27 changed files with 513 additions and 519 deletions.
4 changes: 0 additions & 4 deletions inference-engine/src/mkldnn_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ set(LAYERS
# ${CMAKE_CURRENT_SOURCE_DIR}/nodes/unique.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/nodes/unsqueeze.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nodes/common/softmax.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nodes/common/emitter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nodes/jit_eltwise_emitters.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nodes/jit_mkldnn_emitters.cpp
#
# ${CMAKE_CURRENT_SOURCE_DIR}/nodes/argmax.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/nodes/argmax_imp.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/nodes/topk.cpp
Expand Down
30 changes: 0 additions & 30 deletions inference-engine/src/mkldnn_plugin/mkldnn_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,6 @@ void MKLDNNGraph::Replicate(const CNNNetwork &network, const MKLDNNExtensionMana

op2node[op] = node;

const auto& rtInfo = op->get_rt_info();
if (rtInfo.count("originalLayersNames")) {
node->originalLayers = getRTInfoValue(rtInfo, "originalLayersNames");
}

for (size_t port = 0; port < op->get_input_size(); port++) {
auto parentOp = op->get_input_node_shared_ptr(port);

Expand Down Expand Up @@ -349,7 +344,6 @@ void MKLDNNGraph::InitGraph() {

CreatePrimitives();

SetOriginalLayerNames();
//
// if (!config.dumpToDot.empty())
// dumpToDotFile(config.dumpToDot + "_init.dot");
Expand Down Expand Up @@ -381,30 +375,6 @@ void MKLDNNGraph::InitGraph() {
ExecuteConstantNodesOnly();
}

void MKLDNNGraph::SetOriginalLayerNames() {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNN_LT, "MKLDNNGraph::SetOriginalLayerNames");
// Do it before cleanup. Because it will lose original layers information
for (auto &graphNode : graphNodes) {
auto nodeType = graphNode->getType();
if (nodeType == Reorder || nodeType == Output) continue;

if (graphNode->getOriginalLayers().empty()) {
graphNode->addOriginalLayer(graphNode->getOriginalName());
}

if (!graphNode->getFusedWith().empty() || !graphNode->getMergeWith().empty()) {
// Original layer names
std::vector<MKLDNNNodePtr> internal = graphNode->getFusedWith();
auto &merged = graphNode->getMergeWith();
internal.insert(internal.end(), merged.begin(), merged.end());

for (auto &sub_node : internal) {
graphNode->addOriginalLayer(sub_node->getOriginalName());
}
}
}
}

void MKLDNNGraph::InitNodes() {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNN_LT, "MKLDNNGraph::InitNodes");
for (auto &node : graphNodes) {
Expand Down
1 change: 0 additions & 1 deletion inference-engine/src/mkldnn_plugin/mkldnn_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ class MKLDNNGraph {
void AllocateWithReuse();
void CreatePrimitives();
void ExecuteConstantNodesOnly();
void SetOriginalLayerNames();

void do_before(const std::string &dir, const MKLDNNNodePtr &node);
void do_after(const std::string &dir, const MKLDNNNodePtr &node);
Expand Down
Loading

0 comments on commit 1ec5f8c

Please sign in to comment.