Skip to content

DLPack: add support to PyTorch/XLA#138470

Closed
ysiraichi wants to merge 5 commits intopytorch:mainfrom
ysiraichi:dlpack-using-pytorch-xla
Closed

DLPack: add support to PyTorch/XLA#138470
ysiraichi wants to merge 5 commits intopytorch:mainfrom
ysiraichi:dlpack-using-pytorch-xla

Conversation

@ysiraichi
Copy link
Copy Markdown
Collaborator

Taking over: #128176.

In summary, this PR:

  • __dlpack__: Calls PyTorch/XLA to_dlpack function, if the tensor lives in an XLA:CUDA device
  • __dlpack_device__: Correctly maps PyTorch/XLA tensors to kDLGPU, if XLA:CUDA is being used

The tests are introduced in pytorch/xla#7213.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Oct 21, 2024

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit fe9c0aa with merge base aa95618 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@ysiraichi
Copy link
Copy Markdown
Collaborator Author

@albanD @JackCaoG Could you review this PR whenever you got time? This is basically #128176 + rebase + fix. Let me know if there are any changes you'd like to see.

@bdhirsh bdhirsh added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 23, 2024
Copy link
Copy Markdown
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

SGTM

Comment thread torch/_tensor.py Outdated
@ysiraichi ysiraichi force-pushed the dlpack-using-pytorch-xla branch from 59826a2 to af4f73f Compare December 5, 2024 14:48
Copy link
Copy Markdown
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Thanks!

@albanD
Copy link
Copy Markdown
Collaborator

albanD commented Dec 5, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 5, 2024
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@albanD
Copy link
Copy Markdown
Collaborator

albanD commented Dec 5, 2024

Please fix the lint!

@albanD
Copy link
Copy Markdown
Collaborator

albanD commented Dec 5, 2024

@pytorchbot merge

Thanks!

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

AmdSampsa pushed a commit to AmdSampsa/pytorch that referenced this pull request Dec 9, 2024
Taking over: pytorch#128176.

In summary, this PR:

- `__dlpack__`: Calls PyTorch/XLA `to_dlpack` function, if the tensor lives in an XLA:CUDA device
- `__dlpack_device__`: Correctly maps PyTorch/XLA tensors to `kDLGPU`, if XLA:CUDA is being used

The tests are introduced in pytorch/xla#7213.
Pull Request resolved: pytorch#138470
Approved by: https://github.com/albanD

Co-authored-by: iefgnoix <isaacwxf23@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants