[IE][VPU]: Removed Mish decomposition (#3663)
Removed Mish decomposition because new Mish kernel implemented
This commit is contained in:
parent
26ca9919b9
commit
9fa8ad5404
@ -1,18 +0,0 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ngraph/pass/graph_rewrite.hpp>
|
||||
|
||||
namespace vpu {
|
||||
|
||||
class MishDecomposition : public ngraph::pass::MatcherPass {
|
||||
public:
|
||||
NGRAPH_RTTI_DECLARATION;
|
||||
MishDecomposition();
|
||||
};
|
||||
|
||||
} // namespace vpu
|
||||
|
@ -1,49 +0,0 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "vpu/ngraph/transformations/mish_decomposition.hpp"
|
||||
|
||||
#include <ngraph/opsets/opset5.hpp>
|
||||
#include <ngraph/rt_info.hpp>
|
||||
#include <ngraph/pattern/op/wrap_type.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
NGRAPH_RTTI_DEFINITION(vpu::MishDecomposition, "MishDecomposition", 0);
|
||||
|
||||
namespace vpu {
|
||||
|
||||
MishDecomposition::MishDecomposition() {
|
||||
const auto mishPattern = ngraph::pattern::wrap_type<ngraph::opset5::Mish>();
|
||||
|
||||
ngraph::matcher_pass_callback callback = [this](ngraph::pattern::Matcher &matcher) {
|
||||
const auto& mish = ngraph::as_type_ptr<ngraph::opset5::Mish>(matcher.get_match_root());
|
||||
|
||||
if (!mish || transformation_callback(mish)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto inputType = mish->input_value(0).get_element_type();
|
||||
const auto addConst = ngraph::opset5::Constant::create(inputType, ngraph::Shape{}, {1.0f});
|
||||
|
||||
const auto exp = std::make_shared<ngraph::opset5::Exp>(mish->input_value(0));
|
||||
const auto add = std::make_shared<ngraph::opset5::Add>(exp, addConst);
|
||||
const auto log = std::make_shared<ngraph::opset5::Log>(add);
|
||||
const auto tanh = std::make_shared<ngraph::opset5::Tanh>(log);
|
||||
const auto mul = std::make_shared<ngraph::opset5::Multiply>(mish->input_value(0), tanh);
|
||||
|
||||
mul->set_friendly_name(mish->get_friendly_name());
|
||||
ngraph::copy_runtime_info(mish, {addConst, exp, add, log, tanh, mul});
|
||||
ngraph::replace_node(mish, mul);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const auto matcher = std::make_shared<ngraph::pattern::Matcher>(mishPattern, "MishDecomposition");
|
||||
register_matcher(matcher, callback);
|
||||
}
|
||||
|
||||
} // namespace vpu
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <transformations/common_optimizations/common_optimizations.hpp>
|
||||
#include <transformations/init_node_info.hpp>
|
||||
#include <vpu/ngraph/transformations/convert_extract_image_patches_to_reorg_yolo.hpp>
|
||||
#include <vpu/ngraph/transformations/mish_decomposition.hpp>
|
||||
#include <vpu/ngraph/transformations/merge_subsequent_dsr_operations.hpp>
|
||||
#include "vpu/ngraph/transformations/dynamic_to_static_shape.hpp"
|
||||
#include "vpu/ngraph/transformations/eliminate_shapeof_after_dsr.hpp"
|
||||
@ -185,8 +184,6 @@ ie::ICNNNetwork::Ptr FrontEnd::convertNetwork(ie::ICNNNetwork& network) {
|
||||
manager.register_pass<vpu::DynamicToStaticShape>();
|
||||
manager.register_pass<vpu::EliminateShapeOfAfterDSR>();
|
||||
manager.register_pass<vpu::ConvertExtractImagePatchesToReorgYolo>();
|
||||
// WA: Mish is not accurate enough. Remove this decomposition when mish is improved
|
||||
manager.register_pass<vpu::MishDecomposition>();
|
||||
manager.register_pass<ngraph::pass::ConvertOpSet3ToOpSet2>();
|
||||
manager.register_pass<ngraph::pass::ConvertOpSet2ToOpSet1>();
|
||||
manager.register_pass<ngraph::pass::ConvertOpSet1ToLegacy>();
|
||||
|
Loading…
Reference in New Issue
Block a user