Skip to content

add handling of out-of-range indices to Slice #3689

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

Closed
wants to merge 1 commit into from

Conversation

nathanaelsee
Copy link
Contributor

Summary:
Seeing some ops in graph like:

new_k[-self.left_context :, :, :],
        slice_66: "f32[10, 1, 256]" = torch.ops.aten.slice.Tensor(cat_8, 0, -10, 9223372036854775807);  cat_8 = None

Negative indices and 9223372036854775807 are valid inputs to start and end params on slice op, but runtime checks in Slice.cpp don't accept them.
(9223372036854775807 is the max value of signed int_64; it maps to the index not being provided.)

Adding code to compute the real values to the range [0, size(dim))

Differential Revision: D57597106

Copy link

pytorch-bot bot commented May 21, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3689

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 080024b with merge base 79e9b79 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-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 May 21, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57597106

nathanaelsee added a commit to nathanaelsee/executorch that referenced this pull request May 21, 2024
Summary:

Seeing some ops in graph like:
```aten edge dialect
new_k[-self.left_context :, :, :],
        slice_66: "f32[10, 1, 256]" = torch.ops.aten.slice.Tensor(cat_8, 0, -10, 9223372036854775807);  cat_8 = None
```
Negative indices and 9223372036854775807 are valid inputs to `start` and `end` params on slice op, but runtime checks in Slice.cpp don't accept them.
(9223372036854775807 is the max value of signed int_64; it maps to the index not being provided.)

Adding code to compute the real values to the range [0, size(dim))

Differential Revision: D57597106
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57597106

nathanaelsee added a commit to nathanaelsee/executorch that referenced this pull request May 25, 2024
Summary:

Seeing some ops in graph like:
```aten edge dialect
new_k[-self.left_context :, :, :],
        slice_66: "f32[10, 1, 256]" = torch.ops.aten.slice.Tensor(cat_8, 0, -10, 9223372036854775807);  cat_8 = None
```
Negative indices and 9223372036854775807 are valid inputs to `start` and `end` params on slice op, but runtime checks in Slice.cpp don't accept them.
(9223372036854775807 is the max value of signed int_64; it maps to the index not being provided.)

Adding code to compute the real values to the range [0, size(dim))

Reviewed By: jorgep31415

Differential Revision: D57597106
Summary:

Seeing some ops in graph like:
```aten edge dialect
new_k[-self.left_context :, :, :],
        slice_66: "f32[10, 1, 256]" = torch.ops.aten.slice.Tensor(cat_8, 0, -10, 9223372036854775807);  cat_8 = None
```
Negative indices and 9223372036854775807 are valid inputs to `start` and `end` params on slice op, but runtime checks in Slice.cpp don't accept them.
(9223372036854775807 is the max value of signed int_64; it maps to the index not being provided.)

Adding code to compute the real values to the range [0, size(dim))

Reviewed By: jorgep31415

Differential Revision: D57597106
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57597106

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57597106

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in b8f92df.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants