[IE][VPU]: Add runtime precision info in MYRIAD plugin (#2535)

* Add runtime precision info in MYRIAD plugin
This commit is contained in:
Aleksandr Korolev 2020-10-26 11:32:43 +03:00 committed by GitHub
parent 77ba9acada
commit d34dc7e206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -69,6 +69,12 @@ static const char EXECUTION_ORDER[] = "execOrder";
*/ */
static const char LAYER_TYPE[] = "layerType"; static const char LAYER_TYPE[] = "layerType";
/**
* @ingroup ie_dev_exec_graph
* @brief Used to get runtime precision of the executable primitive.
*/
static const char RUNTIME_PRECISION[] = "runtimePrecision";
/** /**
* @ingroup ie_dev_exec_graph * @ingroup ie_dev_exec_graph
* @brief The Execution node which is used to represent node in execution graph. * @brief The Execution node which is used to represent node in execution graph.
@ -81,6 +87,7 @@ static const char LAYER_TYPE[] = "layerType";
* - ExecGraphInfoSerialization::OUTPUT_LAYOUTS * - ExecGraphInfoSerialization::OUTPUT_LAYOUTS
* - ExecGraphInfoSerialization::EXECUTION_ORDER * - ExecGraphInfoSerialization::EXECUTION_ORDER
* - ExecGraphInfoSerialization::LAYER_TYPE * - ExecGraphInfoSerialization::LAYER_TYPE
* - ExecGraphInfoSerialization::RUNTIME_PRECISION
*/ */
class INFERENCE_ENGINE_API_CLASS(ExecutionNode) : public ngraph::Node { class INFERENCE_ENGINE_API_CLASS(ExecutionNode) : public ngraph::Node {
public: public:

View File

@ -241,8 +241,13 @@ std::map<std::string, std::string> extractMeta(const StageMetaInfo& stageMeta) {
serializationInfo[ExecGraphInfoSerialization::OUTPUT_LAYOUTS] = layoutStream.str(); serializationInfo[ExecGraphInfoSerialization::OUTPUT_LAYOUTS] = layoutStream.str();
std::string outPrecisionsStr; std::string outPrecisionsStr;
Precision runtimePrecision {Precision::I32};
ind = 0; ind = 0;
for (auto &outPrecision : stageMeta.outPrecisions) { for (auto &outPrecision : stageMeta.outPrecisions) {
// if we have any output precision not equal I32 -> we assume runtimePrecision is FP16
if (outPrecision != Precision::I32) {
runtimePrecision = Precision::FP16;
}
if (ind == 0) { if (ind == 0) {
outPrecisionsStr += outPrecision.name(); outPrecisionsStr += outPrecision.name();
ind++; ind++;
@ -251,7 +256,7 @@ std::map<std::string, std::string> extractMeta(const StageMetaInfo& stageMeta) {
outPrecisionsStr += ',' + std::string(outPrecision.name()); outPrecisionsStr += ',' + std::string(outPrecision.name());
} }
serializationInfo[ExecGraphInfoSerialization::OUTPUT_PRECISIONS] = outPrecisionsStr; serializationInfo[ExecGraphInfoSerialization::OUTPUT_PRECISIONS] = outPrecisionsStr;
serializationInfo[ExecGraphInfoSerialization::RUNTIME_PRECISION] = runtimePrecision.name();
return serializationInfo; return serializationInfo;
} }