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
[ONNX] Preprocess index_put with bool inputs to masked_scatter/masked_fill #45584
[ONNX] Preprocess index_put with bool inputs to masked_scatter/masked_fill #45584
Conversation
…kare/bool-input-index-put
💊 CI failures summary and remediationsAs of commit 1367144 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 6 times. |
Can you add a better description, also try to explain why and when you use aten::masked_scatter and aten::masked_fill |
…kare/bool-input-index-put
Codecov Report
@@ Coverage Diff @@
## master #45584 +/- ##
=======================================
Coverage 68.50% 68.50%
=======================================
Files 408 408
Lines 52484 52484
=======================================
Hits 35952 35952
Misses 16532 16532 Continue to review full report at Codecov.
|
Thank you @shubhambhokare1! This patch actually resolves #34054. @apaszke I would recommend this patch |
…kare/bool-input-index-put
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.
LGTM, thanks!
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.
@bzinodev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@bzinodev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@bzinodev Any changes required on my end for the PR to be merged? |
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.
@bzinodev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
When the input to an indexing operation is a boolean, for example array[True] = value,
the subsequent index_put node formed needs to be converted to masked_scatter/masked_fill node based on the type of val the indexing node is equated. If that value is just a single scalar, then we use the masked_fill functionality and if value is a tensor of appropriate size, we use the masked_scatter functionality.
Fixes #34054