Add check for negative index in cpu kernel op_index#15366
Add check for negative index in cpu kernel op_index#15366swolchok merged 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15366
Note: Links to docs will display an error until the docs builds have been completed. ❌ 9 New Failures, 2 Pending, 4 Unrelated FailuresAs of commit b2d4503 with merge base de56c81 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
swolchok
left a comment
There was a problem hiding this comment.
looks fine; inline comments are for your consideration and not blocking. However, please also add a test for this behavior (and feel free to @ me for re-review to avoid extra delay).
Fast path cannot be taken when the index is negative in op_index. It results in a failure in `check_fast_path_args`. Add a check to `check_fast_path_conditions` for negative index and return `false` if one is encountered. Change-Id: I6c3fb1793da9a0831ef41a47dc2ab4423aa38be3 Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
0315d9b to
b2d4503
Compare
|
Changed to your suggestions and added tests @swolchok |
| EXPECT_TENSOR_EQ(ret, expected); | ||
| } | ||
|
|
||
| TEST_F(OpIndexTensorOutTest, NegativeIndexSupportedForInt) { |
There was a problem hiding this comment.
I would prefer to see a templated test, but it's probably not worth blocking on
|
looks like we have a bunch of infra failures and known flakes in CI. merging. |
Fast path was broken for negative indices (see pytorch#15285) Because of this, pytorch#15366 disabled the fast path when the index tensor had negative indices. In this PR we fix the bug, and re-enable the fast path for negative indices. Fixes pytorch#15285 Differential Revision: D86351194
|
@pytorchbot cherry-pick --onto release/1.0 -c critical |
Fast path cannot be taken when the index is negative in op_index. It results in a failure in `check_fast_path_args`. Add a check to `check_fast_path_conditions` for negative index and return `false` if one is encountered. cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com> (cherry picked from commit d6de876)
Cherry picking #15366The cherry pick PR is at #15646 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated: Details for Dev Infra teamRaised by workflow job |
Fast path was broken for negative indices (see #15285) Because of this, #15366 disabled the fast path when the index tensor had negative indices. In this PR we fix the bug, and re-enable the fast path for negative indices. Fixes #15285 Differential Revision: D86351194 (cherry picked from commit 2fa44ea)
Fast path was broken for negative indices (see pytorch#15285) Because of this, pytorch#15366 disabled the fast path when the index tensor had negative indices. In this PR we fix the bug, and re-enable the fast path for negative indices. Fixes pytorch#15285 Differential Revision: D86351194
Fast path was broken for negative indices (see #15285) Because of this, #15366 disabled the fast path when the index tensor had negative indices. In this PR we fix the bug, and re-enable the fast path for negative indices. Fixes #15285 Differential Revision: D86351194 Co-authored-by: Manuel Candales <42380156+manuelcandales@users.noreply.github.com>
Fast path cannot be taken when the index is negative in op_index. It results in a failure in `check_fast_path_args`. Add a check to `check_fast_path_conditions` for negative index and return `false` if one is encountered. cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
Fast path was broken for negative indices (see pytorch#15285) Because of this, pytorch#15366 disabled the fast path when the index tensor had negative indices. In this PR we fix the bug, and re-enable the fast path for negative indices. Fixes pytorch#15285 Differential Revision: D86351194
Fast path cannot be taken when the index is negative in op_index. It results in a failure in
check_fast_path_args. Add a check tocheck_fast_path_conditionsfor negative index and returnfalseif one is encountered.cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai