Fix bug in le broadcast for single element broadcast#11922
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11922
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (3 Unrelated Failures)As of commit 35caf87 with merge base 44ab83a ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
This also fixes the garbage output issue in optimum-executorch models |
guangy10
left a comment
There was a problem hiding this comment.
LGTM. Accepted to unblock the work in optimum-executorch.
Summary: Really comparison ops cannot be handled in the same way as other binary ops for broadcasting because output tensor dtype is different than input tensor dtype. As a result we just have to fall back to portable. Even the current vectorized impl for le, ge etc. assumes that the output type of compare is same as input type. That might actually be a bug. A potential way to handle this maybe via vectorized compare natively supporting binary output vector Test Plan: Tests added which fail before and passes after Reviewers: Subscribers: Tasks: Tags:
22e81d9 to
35caf87
Compare
|
failures are not related |
Summary: Really comparison ops cannot be handled in the same way as other binary ops for broadcasting because output tensor dtype is different than input tensor dtype. As a result we just have to fall back to portable. Even the current vectorized impl for le, ge etc. assumes that the output type of compare is same as input type. That might actually be a bug. A potential way to handle this maybe via vectorized compare natively supporting binary output vector Test Plan: Tests added which fail before and passes after Reviewers: Subscribers: Tasks: Tags: ### Summary [PLEASE REMOVE] See [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests) for ExecuTorch PR guidelines. [PLEASE REMOVE] If this PR closes an issue, please add a `Fixes #<issue-id>` line. [PLEASE REMOVE] If this PR introduces a fix or feature that should be the upcoming release notes, please add a "Release notes: <area>" label. For a list of available release notes labels, check out [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests). ### Test plan [PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.
Summary:
Really comparison ops cannot be handled in the same way as other binary ops for broadcasting because output tensor dtype is different than input tensor dtype.
As a result we just have to fall back to portable.
Even the current vectorized impl for le, ge etc. assumes that the output type of compare is same as input type. That might actually be a bug.
A potential way to handle this maybe via vectorized compare natively supporting binary output vector
Test Plan:
Tests added which fail before and passes after
Reviewers:
Subscribers:
Tasks:
Tags:
Summary
[PLEASE REMOVE] See CONTRIBUTING.md's Pull Requests for ExecuTorch PR guidelines.
[PLEASE REMOVE] If this PR closes an issue, please add a
Fixes #<issue-id>line.[PLEASE REMOVE] If this PR introduces a fix or feature that should be the upcoming release notes, please add a "Release notes: " label. For a list of available release notes labels, check out CONTRIBUTING.md's Pull Requests.
Test plan
[PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.