Skip to content

Conversation

@Sebastian-Larsson
Copy link
Collaborator

@Sebastian-Larsson Sebastian-Larsson commented Oct 23, 2025

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

@Sebastian-Larsson Sebastian-Larsson added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: arm Changes to the ARM backend delegate labels Oct 23, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 23, 2025

🔗 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 Failures

As of commit b2d4503 with merge base de56c81 (image):

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.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 23, 2025
@Sebastian-Larsson Sebastian-Larsson added release notes: ops & kernels Changes to the opset and any new / changed kernel implementations and removed partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate labels Oct 23, 2025
Copy link
Contributor

@swolchok swolchok left a comment

Choose a reason for hiding this comment

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

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 <[email protected]>
@Sebastian-Larsson
Copy link
Collaborator Author

Changed to your suggestions and added tests @swolchok

EXPECT_TENSOR_EQ(ret, expected);
}

TEST_F(OpIndexTensorOutTest, NegativeIndexSupportedForInt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to see a templated test, but it's probably not worth blocking on

@swolchok
Copy link
Contributor

looks like we have a bunch of infra failures and known flakes in CI. merging.

@swolchok swolchok merged commit d6de876 into pytorch:main Oct 24, 2025
288 of 301 checks passed
lucylq pushed a commit to lucylq/executorch-1 that referenced this pull request Nov 6, 2025
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
@manuelcandales
Copy link
Contributor

@pytorchbot cherry-pick --onto release/1.0 -c critical

pytorchbot pushed a commit that referenced this pull request Nov 6, 2025
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 <[email protected]>
(cherry picked from commit d6de876)
@pytorchbot
Copy link
Collaborator

Cherry picking #15366

The 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 team Raised by workflow job

pytorchbot pushed a commit that referenced this pull request Nov 6, 2025
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)
abhinaykukkadapu pushed a commit to abhinaykukkadapu/executorch that referenced this pull request Nov 6, 2025
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
GregoryComer pushed a commit that referenced this pull request Nov 6, 2025
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: ops & kernels Changes to the opset and any new / changed kernel implementations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants