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

Abs value inference and optimization #24526

Conversation

jane-intel
Copy link
Contributor

@jane-intel jane-intel commented May 15, 2024

Details:

PyTorch semantic of Expand operation requires Abs operation for translation which is usually a no-op.

  1. partial value and symbol propagation for Abs operation
  2. optimize out the Abs with nonnegative input
  3. for this case Abs(Concat([Gather(ShapeOf), -1, 1, -1])) pulls Abs and tries to const-fold it. Resulting in Concat([Abs(Gather(ShapeOf)), 1, 1, 1]). Applies (2) to the graph and gets Concat([Gather(ShapeOf), 1, 1, 1]) because ShapeOf's lower bound is 0.

Tickets:


UPD: Current PR unraveled the issue in pass::Manager -- here is a WA: #24604, ticket: CVS-141764

@jane-intel jane-intel added this to the 2024.2 milestone May 15, 2024
@jane-intel jane-intel requested review from a team as code owners May 15, 2024 10:23
@jane-intel jane-intel requested review from itikhono and removed request for a team May 15, 2024 10:23
@github-actions github-actions bot added category: Core OpenVINO Core (aka ngraph) category: transformations OpenVINO Runtime library - Transformations category: CPP API OpenVINO CPP API bindings labels May 15, 2024
src/core/src/tensor_util.cpp Outdated Show resolved Hide resolved
src/core/src/tensor_util.cpp Outdated Show resolved Hide resolved
src/core/src/tensor_util.cpp Outdated Show resolved Hide resolved
src/core/dev_api/openvino/core/tensor_util.hpp Outdated Show resolved Hide resolved
src/core/dev_api/openvino/core/tensor_util.hpp Outdated Show resolved Hide resolved
src/core/tests/type_prop/abs.cpp Show resolved Hide resolved
src/core/tests/type_prop/abs.cpp Outdated Show resolved Hide resolved
src/core/tests/type_prop/abs.cpp Outdated Show resolved Hide resolved
src/core/tests/type_prop/abs.cpp Outdated Show resolved Hide resolved
src/core/tests/type_prop/abs.cpp Outdated Show resolved Hide resolved
@jane-intel jane-intel force-pushed the abs_value_inference_and_optimization branch from da27229 to 4b946ac Compare May 20, 2024 10:55
@jane-intel jane-intel requested a review from praasz May 20, 2024 10:57
@jane-intel jane-intel enabled auto-merge May 20, 2024 14:15
@jane-intel jane-intel added this pull request to the merge queue May 20, 2024
Merged via the queue into openvinotoolkit:master with commit bb8da80 May 20, 2024
116 checks passed
@jane-intel jane-intel deleted the abs_value_inference_and_optimization branch May 20, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings category: transformations OpenVINO Runtime library - Transformations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants