Skip to content

Conversation

wbigat
Copy link
Contributor

@wbigat wbigat commented May 8, 2023

Complete the implementation of the interface is_pinned() of untyped storage class for privateuse1.
And refactor the implementation in typed storage by untyped_storage.is_pinned().

Hi, @ezyang
This is another improvement of untyped storage for privateuse1, can you take a moment to review it? Thanks.

@pytorch-bot
Copy link

pytorch-bot bot commented May 8, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 88a7612:
💚 Looks good so far! There are no failures yet. 💚

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

@wbigat wbigat changed the title Master storage privateuse1 Improve the functionality of untyped storage for privateuse1. May 8, 2023
@wbigat wbigat force-pushed the Master-storage-privateuse1 branch from f3ee099 to fc9f805 Compare May 8, 2023 13:08
@ezyang ezyang requested a review from kurtamohler May 8, 2023 22:32
@ezyang
Copy link
Contributor

ezyang commented May 8, 2023

@kurtamohler do you think you can take this one?

@wbigat
Copy link
Contributor Author

wbigat commented May 9, 2023

Hi, since the TypedStorage API will be deprecated in the future, I'm trying to implement is_pined() in untyped storage to support other backends. The implementation of is_pined() in typed storage is only to invoke the interface in untyped storage.

The default value of the ‘device’ parameter is ‘cuda’. Therefore, users of the CUDA backend do not need to modify the usage of this interface. This parameter only needs to be set when other backends support the construction of pin_memory tensors.

I sincerely look forward to your discussion and comments, @kurtamohler @ezyang

@kurtamohler
Copy link
Collaborator

kurtamohler commented May 9, 2023

I think we should probably add a property function like Tensor/UntypedStorage.pinned_device. That can be in a different PR though

@ezyang ezyang added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label May 10, 2023
@wbigat wbigat force-pushed the Master-storage-privateuse1 branch 2 times, most recently from 7881ab1 to aa04df4 Compare May 10, 2023 08:46
@wbigat
Copy link
Contributor Author

wbigat commented May 10, 2023

I think we should probably add a property function like Tensor/UntypedStorage.pinned_device. That can be in a different PR though

Hi, @kurtamohler
I am trying to understand this idea. Do you mean that we need to add an attribute to record the pinned device and a new function to obtain this attribute, like Tensor/UntypedStorage.pinned_device() ?

@kurtamohler
Copy link
Collaborator

Do you mean that we need to add an attribute to record the pinned device and a new function to obtain this attribute, like Tensor/UntypedStorage.pinned_device() ?

Yeah that's what I'm suggesting. Although we could make it a readonly property to avoid needing the parentheses, so that it's semantically similar to `Tensor.device'

@wbigat wbigat force-pushed the Master-storage-privateuse1 branch from a5bf3fe to ea5b67f Compare May 11, 2023 15:18
@wbigat
Copy link
Contributor Author

wbigat commented May 11, 2023

Yeah, in this latest PR, both string and torch.device types are supported as input of is_pinned and pin_memory. And in the implementation of pin_memory, we always create the tensor without any conditions as you suggested before.
@kurtamohler, please review this change.

@wbigat
Copy link
Contributor Author

wbigat commented May 13, 2023

Hi, @kurtamohler @ezyang
Dose this change be finished as expected? Would you please take a moment to review this pr, thanks a lot.

@wbigat wbigat force-pushed the Master-storage-privateuse1 branch from 22d4d3d to d61f3d5 Compare May 17, 2023 06:48
@wbigat
Copy link
Contributor Author

wbigat commented May 18, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 18, 2023
@github-actions
Copy link
Contributor

This PR needs a label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Approval needed from one of the following:
EscapeZero, 842974287, miguelmartin75, kauterry, priyaramani, ...

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@wbigat
Copy link
Contributor Author

wbigat commented May 18, 2023

@pytorchbot label "release notes: python_frontend"

@wbigat wbigat requested a review from kurtamohler May 18, 2023 01:15
@wbigat
Copy link
Contributor Author

wbigat commented May 18, 2023

Hi, @kurtamohler @ezyang
I'm so sorry to bother you. I found that kurtamohler has approved these changes, but I'm not sure if that means this pr can be appoveed? If so, what else do I need to do to merge in this PR? Thanks a lot.

@kurtamohler
Copy link
Collaborator

I'm not on the list of people whose approval allows a PR to be merged. When Edward has time, his approval will make it possible to merge

@ykddd
Copy link

ykddd commented May 19, 2023

@pytorchbot merge -r

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased Master-storage-privateuse1 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout Master-storage-privateuse1 && git pull --rebase)

@pytorchmergebot pytorchmergebot force-pushed the Master-storage-privateuse1 branch from d992418 to 88a7612 Compare May 19, 2023 01:57
@github-actions
Copy link
Contributor

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Approval needed from one of the following:
laurencer, miguelmartin75, serhaty, jubinchheda, qxy11, ...

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@github-actions
Copy link
Contributor

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@wbigat
Copy link
Contributor Author

wbigat commented May 19, 2023

@pytorchbot label "release notes: python_frontend"

@pytorch-bot pytorch-bot bot added the release notes: python_frontend python frontend release notes category label May 19, 2023
@ezyang
Copy link
Contributor

ezyang commented May 19, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
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

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 release notes: python_frontend python frontend release notes 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