Fix stale bounds after AbsSinking via conditional invalidation in replace_output()#33288
Fix stale bounds after AbsSinking via conditional invalidation in replace_output()#33288evkotov wants to merge 12 commits intoopenvinotoolkit:masterfrom
Conversation
...mon/transformations/src/transformations/common_optimizations/simplify_shape_of_sub_graph.cpp
Outdated
Show resolved
Hide resolved
...mmon/transformations/src/transformations/symbolic_transformations/symbolic_optimizations.cpp
Outdated
Show resolved
Hide resolved
.../transformations/include/transformations/symbolic_transformations/symbolic_optimizations.hpp
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| bool ov::util::tensors_equal(const Tensor& a, const Tensor& b) { | ||
| // Both empty = equal |
There was a problem hiding this comment.
is not duplicate of are_equal ?
This helper should do same.
There was a problem hiding this comment.
No, it's not a duplicate. The key difference is in handling empty tensors
There was a problem hiding this comment.
are_equal also handles empty tensors, most of it is duplication.
src/core/src/descriptor/input.cpp
Outdated
| // 1. Old had bounds but new doesn't have bounds (node was replaced with newly created one) | ||
| // 2. Both have bounds but they differ | ||
| bool should_invalidate = false; | ||
| if (old_has_bounds && !new_has_bounds) { |
There was a problem hiding this comment.
These check looks like duplicate whe are_equal do.
Do we need check tensors or just check in new input and all input are not same tensors (without data check)?
There was a problem hiding this comment.
In OptimizeSymbolsUsedAsValues, we call evaluate_both_bounds() and then replace(). The old and new outputs point to different nodes but may have identical bound values (same shape data). Using are_same_tensor (pointer comparison via data()) would return false and trigger unnecessary invalidation.
|
Created #33622 with alternative approach |
Details:
Problem
VIT model compilation fails with "Value for partial shape evaluation can't be lower than zero" because:
Solution
Implement conditional bounds invalidation in replace_output():
tensors_equal() - compares two tensors for equality
force_invalidate_bounds() - invalidates bounds bypassing SkipInvalidation attribute
Tickets: