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

Fixed scalar creating in tf.Graph decoder #19735

Merged
merged 5 commits into from
Sep 14, 2023

Conversation

popovaan
Copy link
Contributor

@popovaan popovaan commented Sep 11, 2023

Root cause analysis:
In tf.Graph decoder scalars are wrapped to list, then to nd.array before passing to ov.Tensor() constructor.
Creating of intermediate nd.array leads to creating of additional object in memory which is deallocated before C++ part access it.
This leads to corruption of scalar value.

Solution:
Creating of additional list is redundant.
Intermediate nd.array needs to be saved to TFGraphNodeDecoder field to avoid deallocating.

Ticket: 117250, 119142
Closes #19019

Code:

  • Comments
  • Code style (PEP8)
  • Transformation generates reshape-able IR
  • Transformation preserves original framework node names
  • Transformation preserves tensor names

Validation:

  • Unit tests
  • Framework operation tests
  • Transformation tests
  • Model Optimizer IR Reader check

Documentation:

  • Supported frameworks operations list
  • Guide on how to convert the public model
  • User guide update

@popovaan popovaan requested review from a team as code owners September 11, 2023 08:42
@github-actions github-actions bot added the category: Python API OpenVINO Python bindings label Sep 11, 2023
@rkazants rkazants merged commit 18f29c0 into openvinotoolkit:master Sep 14, 2023
56 checks passed
@ilya-lavrenov ilya-lavrenov added this to the 2023.2 milestone Sep 18, 2023
jade-cho pushed a commit to isanghao/openvino that referenced this pull request Sep 19, 2023
* Fixed scalar logic in tf.Graph decoder.

* Passed memory sharing flag to all Tensor constructors.

* Small correction.

* Test correction.
alvoron pushed a commit to alvoron/openvino that referenced this pull request Nov 6, 2023
* Fixed scalar logic in tf.Graph decoder.

* Passed memory sharing flag to all Tensor constructors.

* Small correction.

* Test correction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Python API OpenVINO Python bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Low perfromance of the TF quantized model.
3 participants