-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CPU] A new transformation that adds a convert layer if there is no reorders that support the data type conversion. #3498
[CPU] A new transformation that adds a convert layer if there is no reorders that support the data type conversion. #3498
Conversation
@yury-intel Could you please review? |
@yury-intel thanks! |
@dmitry-gorokhov could you please review this PR? |
inference-engine/src/mkldnn_plugin/nodes/mkldnn_convert_node.cpp
Outdated
Show resolved
Hide resolved
inference-engine/src/mkldnn_plugin/nodes/mkldnn_convert_node.cpp
Outdated
Show resolved
Hide resolved
inference-engine/tests/functional/plugin/cpu/subgraph_tests/src/AddConverToReorder.cpp
Outdated
Show resolved
Hide resolved
inference-engine/tests/functional/plugin/cpu/subgraph_tests/src/AddConverToReorder.cpp
Outdated
Show resolved
Hide resolved
e1639f3
to
e1fe187
Compare
9d15d26
to
d51ebad
Compare
inference-engine/src/mkldnn_plugin/nodes/mkldnn_convert_node.cpp
Outdated
Show resolved
Hide resolved
inference-engine/src/mkldnn_plugin/nodes/mkldnn_convert_node.cpp
Outdated
Show resolved
Hide resolved
inference-engine/src/mkldnn_plugin/nodes/mkldnn_convert_node.cpp
Outdated
Show resolved
Hide resolved
inference-engine/src/mkldnn_plugin/nodes/common/tensor_desc_creator.cpp
Outdated
Show resolved
Hide resolved
d51ebad
to
677601e
Compare
7b35e35
to
0caa99e
Compare
4d080ef
to
007851c
Compare
…put and output Data in the CNNLayer object.
…y reorders cases.
cc64b40
to
30259a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good to me. Please make CI green to enable merge.
@@ -115,6 +115,41 @@ class MKLDNNGraph { | |||
MKLDNNNodePtr InsertReorder(MKLDNNEdgePtr edge, std::string layerName, const InferenceEngine::TensorDesc& inDesc, | |||
const InferenceEngine::TensorDesc& outDesc, bool isOptimized = false, InferenceEngine::Blob::Ptr scales = nullptr); | |||
|
|||
/** | |||
* @brief Insert MKLDNNNode at the edge-specified location. | |||
* This method supports two regimes. First, the node is inserted without initialization (i.e. supported descriptors initialization, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: regimes
-> mode
const auto& blockingDesc = config.inConfs[0].desc.getBlockingDesc(); // inp/out layouts must be the same | ||
dataConfigOut.desc = TensorDesc(output->getPrecision(), input->getDims(), blockingDesc); | ||
config.outConfs.push_back(dataConfigOut); | ||
supportedPrimitiveDescriptors.emplace_back(config, impl_desc_type::unknown, MKLDNNMemoryDesc(config.outConfs.front().desc).getFormat()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why cannot you just do smt like: dataConfigOut.desc
= dataIn.desc
and then update dataConfigOut.desc precision?
|
||
class CreatorsMapFilterConstIterator; | ||
|
||
class TensorDescCreator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things about TensorDescCreator and related logic:
- We definitely lack brief description of its API.
- It should be covered by unit tests (w/o connection to any graph patterns).
I think both tasks can be out of scope of this PR, but we should create follow up ticket.
Motivation of this PR is described in the ticket #39726. The main idea is to add Convert layer if a data type conversion is required for which there is no suitable reorder case. This transformation works on the mkldnn graph optimizer level.