Skip to content

Commit

Permalink
Unroll Tensor Iterator using ngraph pass (openvinotoolkit#7205)
Browse files Browse the repository at this point in the history
* use ngraph-based unroll-ti as default

* use isNgraphPassesUsed for legacy code

* code review fixes

* code review fixes
  • Loading branch information
evkotov authored and dood-apo committed Aug 24, 2023
1 parent 5593bb1 commit 702c37c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions inference-engine/src/gna_plugin/gna_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,11 +750,6 @@ void GNAPlugin::LoadNetwork(CNNNetwork & _network) {
manager.register_pass<ngraph::pass::UnrollTensorIterator>();

const auto& pass_config = manager.get_pass_config();
pass_config->set_callback<ngraph::pass::UnrollTensorIterator>(
[](const std::shared_ptr<const ngraph::Node> &node) -> bool {
// UnrollTI transformation is disabled by default, is turned on by LowLatency transformation
return node->get_rt_info().count("UNROLL_TI") == 0;
});
pass_config->disable<ngraph::pass::FakeQuantizeMulFusion>();
pass_config->disable<ngraph::pass::FakeQuantizeReshapeFusion>();
pass_config->disable<ngraph::pass::PullTransposeThroughFQUp>();
Expand Down Expand Up @@ -798,10 +793,12 @@ void GNAPlugin::LoadNetwork(CNNNetwork & _network) {
auto run_passes = [&] (const CNNNetwork& network, bool runBeforeCopy, bool lowPrecision) {
auto passes = make_shared<PassManager>(PassManagerSettings{runBeforeCopy, lowPrecision}, network);
passes->registerPass<RemoveConstPass>();
passes->registerPass<UnrollTIPass>();
passes->registerPass<RemoveConstPass>();
if (!isNgraphPassesUsed)
if (!isNgraphPassesUsed) {
passes->registerPass<UnrollTIPass>();
passes->registerPass<RemoveConstPass>();
passes->registerPass<UnrollLSTMCellPass>();
}

passes->registerPass<RemoveSingleInputConcatPass>();

// fake quantisation aware passes
Expand Down

0 comments on commit 702c37c

Please sign in to comment.