-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Layer][GPU][TF FE] test_segment_sum failed with get_shape was called… #28778
base: master
Are you sure you want to change the base?
Conversation
From TF FE side, looks good. |
build_jenkins |
build_jenkins |
const size_t num_segments_idx = 2; | ||
TensorsContainer const_data(&impl_param.get_stream()); | ||
if (memory_deps.count(num_segments_idx) > 0) { | ||
const_data.emplace(3, memory_deps.at(num_segments_idx)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that it uses dependency_idx=2 as num_segments
input? It seems that dependency_idx=2 refers to segment_ids
, doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, dependency_idx = 2 likely refers to segment IDs, and num_segments would be the number of segments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pravin25, I believe that such replacement is not correct in all cases. If an "empty segment" is the last one (and thus not present in segment_ids), this approach may lead to incorrect segment number calculations
Here is example from the specs:
<layer ... type="EmbeddingSegmentsSum" ... >
<input>
<port id="0"> <!-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] -->
<dim>5</dim>
<dim>2</dim>
</port>
<port id="1"> <!-- indices value is: [0, 2, 3, 4] -->
<dim>4</dim>
</port>
<port id="2"/> <!-- segment_ids value is: [0, 0, 2, 2] - second segment is empty -->
<dim>4</dim>
</port>
<port id="3"/> <!-- num_segments value is: 3 -->
<port id="4"/> <!-- default_index value is: 0 -->
<port id="5"/> <!-- per_sample_weigths value is: [0.5, 0.5, 0.5, 0.5] -->
<dim>4</dim>
</port>
</input>
<output>
<port id="6"> <!-- output value is: [[-1.05, -1.2], [-0.2, -0.6], [-0.1, 0.4]] -->
<dim>3</dim>
<dim>2</dim>
</port>
</output>
</layer>
But what if segment_ids was configured like this?
<port id="2"/> <!-- segment_ids value is: [0, 0, 1, 1] - third segment is empty -->
<dim>4</dim>
</port>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sshlyapn , First I want to correct this example. It should be
<port id="2"/> <!-- segment_ids value is: [0, 0, 0, 1, 1] - fourth segment is empty -->
<dim>5</dim>
</port>
Because data shape dimension and segment_id_shape have the same dimension.
If it is a mismatch, OpenVINO throws an exception.
Based on segment_id, the kernel calculates segment ops.
The second thing I take care of is if the blank segment_id comes.
Here is that core/shape_inference/includes/embedding_segments_sum_shape_inference.hpp:56-63
@pravin25 please take a look on failed tests |
build_jenkins |
build_jenkins |
… on a descriptor Fix GPU TensorFlow SegmentSum test failure - Added dynamic shape support in GPU inference pipeline for SegmentSum ops - Updated tensorflow_tests/test_tf_SegmentSum.py to remove GPU skip - Ensured correct inputs for EmbededdingSegmentSum ops - Ensured correct handling of dynamic shapes during GPU inference for SegmentSum - Pass custom_eps via kwargs for flexible test tolerances. - Removed calculate segments_num logic from embedding_segments_sum_shape_inference.hpp Following both tickets are interrelated. https://jira.devtools.intel.com/browse/CVS-105896 https://jira.devtools.intel.com/browse/CVS-152352 https://jira.devtools.intel.com/browse/CVS-156362
Details:
custom_eps
throughkwargs
to allow dynamic epsilon values for comparison in tests.This improves flexibility in handling precision variations (FP32, FP16).
Tickets: