Skip to content
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

Fix non-contiguous tensor problem in jagged_index_select #2060

Closed
wants to merge 1 commit into from

Conversation

sryap
Copy link
Contributor

@sryap sryap commented Oct 5, 2023

Summary:
Before this diff, jagged_index_select kernels take raw pointers as
arguments. This requires the input tensors to be contiguous.
However, the jagged_index_select operator did not make sure that the
tensors are contiguous before extracting and passing the raw pointers
to the kernels causing the correctness issue. This diff replaces the
raw pointer arguments with PyTorch's PackedTensorAccessor which
handles non-contiguous tensor accesses automatically. For some
tensors that their raw pointers are still being used, the operator
makes sure that the tensors are contiguous before using them.

Differential Revision: D49937274

Summary:

Before this diff, `jagged_index_select` kernels take raw pointers as
arguments.  This requires the input tensors to be contiguous.
However, the `jagged_index_select` operator did not make sure that the
tensors are contiguous before extracting and passing the raw pointers
to the kernels causing the correctness issue.  This diff replaces the
raw pointer arguments with PyTorch's `PackedTensorAccessor` which
handles non-contiguous tensor accesses automatically.  For some
tensors that their raw pointers are still being used, the operator
makes sure that the tensors are contiguous before using them.

Differential Revision: D49937274
@netlify
Copy link

netlify bot commented Oct 5, 2023

Deploy Preview for pytorch-fbgemm-docs canceled.

Name Link
🔨 Latest commit 11749d7
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/651e046c79dfef00080c10b0

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 8f7d8c7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants