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

Spec the behavior of select in SelectAndScatterOp #731

Open
sdasgup3 opened this issue Dec 9, 2022 · 0 comments
Open

Spec the behavior of select in SelectAndScatterOp #731

sdasgup3 opened this issue Dec 9, 2022 · 0 comments
Labels

Comments

@sdasgup3
Copy link
Member

sdasgup3 commented Dec 9, 2022

Request description

Problem what happens if the entire window of the reduce_window phase of select_and_scatter consists of padding values?

Specifically, per the spec
what is going to the behavior of selected_values = reduce_window_without_init(...) when the data consists of only padding values.

Ideally, The expected outcome sould be selected_values = []. But reduce_window_without_init does not convey that clearly.

A suggestion:

As per the hlo implementation of SelectAndScatter,
this is the callback function which is used to go through every valid operand index and book-keep the most updated selection based on the operand indices seen so far.

As expected, in case where there is no valid index, the above callback is never applied, leaving the result of selection empty.

One of the challenges that I found is: for the case of selectAndScatter we define reduce_window_without_init saying that it is based on reduce_window, but the reduce_window's spec relies very much on "init_values" and thereby, it might be hard to imagine how the _withpout_init version would look like.

How about we define selectAndScatter using reduce_without_init: Including just the valid indices in a window and applying reduce_without_init on that. The valid indices will be along this line.

@sdasgup3 sdasgup3 added the Spec label Dec 9, 2022
@burmako burmako changed the title Revisit the spec for SelectAndScatter Revisit the behavior of select in SelectAndScatterOp Dec 9, 2022
@burmako burmako changed the title Revisit the behavior of select in SelectAndScatterOp Spec the behavior of select in SelectAndScatterOp Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant