Skip to content
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

[GNA] Remove extra FQ layers from the final network #10599

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

elilobanova
Copy link
Contributor

Details:

  • FQ layers are fused with previous layers if they are not required for precision change
  • Calculation of PWL for Identity is made taking into account FQ statistics
  • Workaround is added for activation-activation patterns quantization until the final solution is not implemented in POT
  • Fixed Identity insertion before Eltwise which inputs are connected with the same layer
  • Fixed Identity insertion after layer with output connected to multiple layers
  • Added exception for the case when split alignment with ConvolutionFilter isn't supported
  • Some tests are fixed to allow their passing with the required accuracy

Tickets:

58806

@elilobanova elilobanova requested review from a team February 22, 2022 12:34
@openvino-pushbot openvino-pushbot added category: IE Tests OpenVINO Test: plugins and common category: GNA OpenVINO GNA plugin labels Feb 22, 2022
@elilobanova elilobanova requested review from a team, sbalandi, nkogteva, mryzhov and dmitriikhurtin and removed request for a team March 22, 2022 12:06
ngraph::opset8::Constant::create(ngraph::element::f32, {1}, {-10.}),
ngraph::opset8::Constant::create(ngraph::element::f32, {1}, {10.}),
static_cast<uint32_t>(std::numeric_limits<uint16_t>::max()) + 1);
auto concat = ngraph::builder::makeConcat({fq1, fq2}, 1);
function = std::make_shared<ngraph::Function>(concat, params, "WeighableLayerWithoutFq");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain why it is named WeighableLayerWithoutFq? I don't understand why it is Weighable and why WithoutFq

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I remember this test was written for issue with quantization of ConcatAlignFilter. This layer is weightable and it's inserted by GNA plugin, so POT doesn't quantize it. So, I think, it's a reason of this test name. There is a PR where this test was added: #7834

Copy link
Contributor

@nkogteva nkogteva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, LGTM

@@ -74,7 +74,8 @@ static const char softSignLayersCounter[] = "numSoftSignLayers";
static void insertDiagonalLayerBetween(InferenceEngine::CNNLayerPtr prevLayer,
InferenceEngine::CNNLayerPtr nextLayer,
std::shared_ptr<IPassManager> passmanager,
float fillValue) {
float fillValue,
size_t in_data_idx = invalid_data_idx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just on future, lets do not mix code styles in function signatures

@mryzhov mryzhov merged commit 3578ee9 into openvinotoolkit:master Mar 31, 2022
tadamowicz pushed a commit to tadamowicz/openvino that referenced this pull request Aug 30, 2023
…10599)

* [GNA] Fuse all FakeQuantize layers with their previous layers

* [GNA] Fuse FQ with previous layer if it's not required for precision change

* [GNA] Fixed MatMulOverloadCorrectionTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GNA OpenVINO GNA plugin category: IE Tests OpenVINO Test: plugins and common
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants