8000 Update from_dlpack tests and documentation by kurtamohler · Pull Request #70543 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Update from_dlpack tests and documentation #70543

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

kurtamohler
Copy link
Collaborator

Part of #58742

@pytorch-probot
Copy link
pytorch-probot bot commented Dec 31, 2021
CI Flow Status

⚛️ CI Flow

Ruleset - Version: v1
Ruleset - File: https://github.com/kurtamohler/pytorch/blob/da734ede4eb1624f622cfb7b596c490087be35bb/.github/generated-ciflow-ruleset.json
PR ciflow labels: ciflow/default

Workflows Labels (bold enabled) Status
Triggered Workflows
linux-bionic-py3.7-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/noarch, ciflow/trunk ✅ triggered
linux-docs ciflow/all, ciflow/cpu, ciflow/default, ciflow/docs, ciflow/linux, ciflow/trunk ✅ triggered
linux-vulkan-bionic-py3.7-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/trunk, ciflow/vulkan ✅ triggered
linux-xenial-cuda11.3-py3.7-gcc7 ciflow/all, ciflow/cuda, ciflow/default, ciflow/linux, ciflow/trunk ✅ triggered
linux-xenial-cuda11.3-py3.7-gcc7-bazel-test ciflow/all, ciflow/bazel, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/trunk ✅ triggered
linux-xenial-py3-clang5-mobile-build ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile, ciflow/trunk ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-static ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile, ciflow/trunk ✅ triggered
linux-xenial-py3.7-clang7-asan ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/sanitizers, ciflow/trunk ✅ triggered
linux-xenial-py3.7-clang7-onnx ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/onnx, ciflow/trunk ✅ triggered
linux-xenial-py3.7-gcc5.4 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/trunk ✅ triggered
linux-xenial-py3.7-gcc7 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/trunk ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/trunk ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single-full-jit ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/trunk ✅ triggered
win-vs2019-cpu-py3 ciflow/all, ciflow/cpu, ciflow/default, ciflow/trunk, ciflow/win ✅ triggered
win-vs2019-cuda11.3-py3 ciflow/all, ciflow/cuda, ciflow/default, ciflow/trunk, ciflow/win ✅ triggered
Skipped Workflows
caffe2-linux-xenial-py3.7-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux, ciflow/trunk 🚫 skipped
docker-builds ciflow/all, ciflow/trunk 🚫 skipped
ios-12-5-1-arm64 ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
ios-12-5-1-arm64-coreml ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
ios-12-5-1-arm64-custom-ops ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
ios-12-5-1-arm64-full-jit ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
ios-12-5-1-arm64-metal ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
ios-12-5-1-x86-64 ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
ios-12-5-1-x86-64-coreml ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
ios-12-5-1-x86-64-full-jit ciflow/all, ciflow/ios, ciflow/macos, ciflow/trunk 🚫 skipped
libtorch-linux-xenial-cuda10.2-py3.7-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/trunk 🚫 skipped
libtorch-linux-xenial-cuda11.3-py3.7-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/trunk 🚫 skipped
linux-bionic-cuda10.2-py3.9-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/slow, ciflow/trunk 🚫 skipped
linux-docs-push ciflow/all, ciflow/cpu, ciflow/linux, ciflow/scheduled 🚫 skipped
macos-10-15-py3-arm64 ciflow/all, ciflow/macos, ciflow/trunk 🚫 skipped
macos-10-15-py3-lite-interpreter-x86-64 ciflow/all, ciflow/macos, ciflow/trunk 🚫 skipped
macos-11-py3-x86-64 ciflow/all, ciflow/macos, ciflow/trunk 🚫 skipped
parallelnative-linux-xenial-py3.7-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux, ciflow/trunk 🚫 skipped
periodic-libtorch-linux-bionic-cuda11.5-py3.7-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-libtorch-linux-xenial-cuda11.1-py3.7-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-linux-bionic-cuda11.5-py3.7-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-linux-xenial-cuda10.2-py3-gcc7-slow-gradcheck ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled, ciflow/slow, ciflow/slow-gradcheck 🚫 skipped
periodic-linux-xenial-cuda11.1-py3.7-gcc7-debug ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-win-vs2019-cuda11.1-py3 ciflow/all, ciflow/cuda, ciflow/scheduled, ciflow/win 🚫 skipped
periodic-win-vs2019-cuda11.5-py3 ciflow/all, ciflow/cuda, ciflow/scheduled, ciflow/win 🚫 skipped
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-build ciflow/all, ciflow/android, ciflow/cpu, ciflow/linux, ciflow/trunk 🚫 skipped

You can add a comment to the PR and tag @pytorchbot with the following commands:
# ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun

# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow

For more information, please take a look at the CI Flow Wiki.

@facebook-github-bot
Copy link
Contributor
facebook-github-bot commented Dec 31, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit 0af0353 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@kurtamohler kurtamohler changed the title Make from_dlpack public Use public from_dlpack method in test Dec 31, 2021
@kurtamohler kurtamohler changed the title Use public from_dlpack method in test Update from_dlpack tests and documentation Dec 31, 2021
@lezcano lezcano requested a review from rgommers January 1, 2022 14:04
@rgommers
Copy link
Collaborator
rgommers commented Jan 1, 2022

Thanks @kurtamohler! gh-70437 also updates the docs, so after whichever one of these PRs lands first, the other one needs an update.

@rgommers
Copy link
Collaborator
rgommers commented Jan 1, 2022

Was from_dlpack already moved to the torch namespace in a previous PR? I had missed that.

@kurtamohler
Copy link
Collaborator Author
kurtamohler commented Jan 2, 2022

Was from_dlpack already moved to the torch namespace in a previous PR? I had missed that.

It wasn't moved, it's still under torch.utils.dlpack. But this PR made it available under torch as well: https://github.com/pytorch/pytorch/pull/57110/files#diff-c8835eba8562819a44e70a30545213c96e68c588a2cfa673fa495b187b1ea8dfR762

Copy link
Collaborator
@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

This looks good, thanks @kurtamohler. Adding tests for non-contiguous input is a good idea. Just two very minor comments from me.

@skipMeta
@onlyCUDA
@dtypes(*get_all_dtypes(include_bool=False))
def test_dlpack_conversion_with_diff_streams(self, device, dtype):
from torch._C import _from_dlpack
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change is a good cleanup. No change in behavior due to this, because the test bypasses stream handling in from_dlpack by passing in a capsule rather than a tensor.

@rgommers
Copy link
Collaborator
rgommers commented Jan 3, 2022

One related thing is what we should do with to_dlpack. It was added to the main namespace as well, is also undocumented there, but unlike from_dlpack it's not that useful (because recommended usage is torch.from_dlpack(a_tensor), no to_dlpack involved). Options include:

  • document it anyway
  • deprecate it again in the main namespace (just leave it in torch.utils.dlpack)
  • leave things as they are

@mruberry any preference?

rgommers added a commit to rgommers/pytorch that referenced this pull request Jan 3, 2022
Leave `to_dlpack` in the `torch.utils.dlpack` namespace here.
It is present in the main namespace as well, but undocumented there
and it's not clear if we want to keep it there - see
pytorch#70543 (comment)
@rgommers
Copy link
Collaborator

@kurtamohler this has accumulated a merge conflict, could you resolve it?

The to_dlpack question above can be dealt with separately, it'd be good to get this merged.

@mruberry mruberry self-requested a review February 11, 2022 15:48
Copy link
Collaborator
@mruberry mruberry left a comment

Choose a reason for hiding this comment

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

Thanks @kurtamohler!

@facebook-github-bot
Copy link
Contributor

@mruberry has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Feb 14, 2022
Summary:
Part of #58742

Pull Request resolved: #70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
@github-actions
Copy link
Contributor

Hey @kurtamohler.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@kurtamohler kurtamohler added the release notes: python_frontend python frontend release notes category label Feb 14, 2022
@kurtamohler kurtamohler added the topic: docs topic category label Feb 14, 2022
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 15, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 15, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 15, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
@rgommers
Copy link
Collaborator

Thanks for merging @mruberry. Just to confirm: are you happy to see the doc change backported to the 1.11 branch?

cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 16, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 16, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
@mruberry
Copy link
Collaborator

Thanks for merging @mruberry. Just to confirm: are you happy to see the doc change backported to the 1.11 branch?

Yep, sounds like a fine cherrypick. cc @malfet

cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 17, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 17, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 17, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 17, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 17, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 17, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 17, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 20, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 20, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 20, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Feb 21, 2022
Summary:
Part of pytorch/pytorch#58742

Pull Request resolved: pytorch/pytorch#70543

Reviewed By: soulitzer

Differential Revision: D34172475

Pulled By: mruberry

fbshipit-source-id: d498764b8651a8b7a19181b3421aeebf28a5db2b
(cherry picked from commit 05332f164c4317e46e1242fdae483204e0412ef3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed open source release notes: python_frontend python frontend release notes category topic: docs topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0