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 keyed_jagged_index_select_dim1 #2061

Closed
wants to merge 1 commit into from

Conversation

sryap
Copy link
Contributor

@sryap sryap commented Oct 5, 2023

Summary:
Before this diff, keyed_jagged_index_select_dim1 kernels take raw
pointers as arguments. This requires the input tensors to be
contiguous. However, the keyed_jagged_index_select_dim1 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: D49939713

@netlify
Copy link

netlify bot commented Oct 5, 2023

Deploy Preview for pytorch-fbgemm-docs canceled.

Name Link
🔨 Latest commit 3111b77
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/6524a93e3092c80008738f2e

@facebook-github-bot
Copy link
Contributor

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

@sryap sryap force-pushed the export-D49939713 branch from e0a88d2 to 31126e7 Compare October 9, 2023 18:03
sryap pushed a commit to sryap/FBGEMM that referenced this pull request Oct 9, 2023
…ytorch#2061)

Summary:

Before this diff, `keyed_jagged_index_select_dim1` kernels take raw
pointers as arguments.  This requires the input tensors to be
contiguous.  However, the `keyed_jagged_index_select_dim1` 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.

Reviewed By: jasonjk-park

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

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

1 similar comment
@facebook-github-bot
Copy link
Contributor

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

sryap pushed a commit to sryap/FBGEMM that referenced this pull request Oct 9, 2023
…ytorch#2061)

Summary:

Before this diff, `keyed_jagged_index_select_dim1` kernels take raw
pointers as arguments.  This requires the input tensors to be
contiguous.  However, the `keyed_jagged_index_select_dim1` 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.

Reviewed By: jasonjk-park

Differential Revision: D49939713
@sryap sryap force-pushed the export-D49939713 branch from 31126e7 to e3d38ba Compare October 9, 2023 18:37
@facebook-github-bot
Copy link
Contributor

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

…ytorch#2061)

Summary:

Before this diff, `keyed_jagged_index_select_dim1` kernels take raw
pointers as arguments.  This requires the input tensors to be
contiguous.  However, the `keyed_jagged_index_select_dim1` 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.

Reviewed By: jasonjk-park, venkatrsrinivas

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

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

1 similar comment
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 1e194b7.

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