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

Add specification for SegmentMax-16 #28103

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

p-wysocki
Copy link
Contributor

Details:

Tickets:

Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
@p-wysocki p-wysocki requested a review from a team as a code owner December 17, 2024 15:08
@p-wysocki p-wysocki requested review from zKulesza and removed request for a team December 17, 2024 15:08
@github-actions github-actions bot added the category: docs OpenVINO documentation label Dec 17, 2024
Copy link
Contributor

@rkazants rkazants left a comment

Choose a reason for hiding this comment

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

Let us have EmbeddingSegmentsMax similar to EmbeddingSegmentsSum.
It should also have default index (defining default value for empty segment)

* Segment_4: ``[]``
* Segment_5: ``[data[6], data[7]]``

When there are no values in a segment, ``output[segment]`` is set to 0.
Copy link
Contributor

Choose a reason for hiding this comment

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

we should have default value for empty segments, otherwise, we will have additional computation graph (that is not trivial) to compute empty segments and replace zero value

Copy link
Contributor Author

@p-wysocki p-wysocki Dec 18, 2024

Choose a reason for hiding this comment

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

The default value seems to be 0, according to https://www.tensorflow.org/api_docs/python/tf/raw_ops/SegmentMax. I don't think we should expand the op on our own, especially since we only expect it to come from TF FE.


* **1**: *data*

* **Description**: The numerical data on which SegmentMax operation will be performed. **Required.**
Copy link
Contributor

Choose a reason for hiding this comment

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

please define input shapes and output shape for each input and describe what dimensions are equal

Copy link
Contributor Author

@p-wysocki p-wysocki Dec 18, 2024

Choose a reason for hiding this comment

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

data can have any rank and dimensions, so it's described as ND of any numerical type. segment_ids are specified to be a 1D tensor of non-negative, sorted integer numbers of size equal to the size of the first dimension of the input tensor.

Could you please specify what's missing? I think the shapes are covered, but I may be missing something.

@p-wysocki
Copy link
Contributor Author

Let us have EmbeddingSegmentsMax similar to EmbeddingSegmentsSum.

EmbeddingSegmentX is for sparse inputs, while SegmentMax I'm implementing (to unlock some models) accepts dense inputs, so I don't think it should be added as EmbeddingSegmentMax. I'm moving the discussion to internal channels, if it results in changes, I'll apply them to the PR.

@p-wysocki p-wysocki requested a review from rkazants December 18, 2024 12:34
Signed-off-by: p-wysocki <przemyslaw.wysocki@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: docs OpenVINO documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants