-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
Add APIs for creating NumPy arrays backed by pinned memory #4870
Conversation
TODO: mention it in memory tutorial/reference and else where
This comment has been minimized.
This comment has been minimized.
So I wrote a decorator |
Flake8 error will be fixed in #4888. |
Jenkins, test this please |
Jenkins CI test (for commit e5f357b, target branch master) failed with status FAILURE. |
Jenkins, test this please |
Jenkins CI test (for commit 31d2338, target branch master) succeeded! |
Jenkins CI test (for commit c6804a8, target branch master) succeeded! |
@kmaehashi Errors are due to OSError: [Errno 28] No space left on device. |
I've freed up some space now. pfnCI, test this please. |
Jenkins CI test (for commit c6804a8, target branch master) succeeded! |
hmmm...I wonder why Jenkins still shows a red cross despite chainer ci says success? |
It seems Jenkins github plugin was using deprecated github APIs and now they're removed. I bumped the plugin version so it should work now. |
Jenkins, test this please |
Jenkins CI test (for commit c6804a8, target branch master) succeeded! |
Resolved conflicts. Jenkins, test this please |
Jenkins CI test (for commit 500d53c, target branch master) failed with status FAILURE. |
Jenkins, test this please |
Jenkins CI test (for commit cc6fe6c, target branch master) succeeded! |
@kmaehashi as mentioned I'd love to have this PR backported 🙏 |
Jenkins, test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Jenkins CI test (for commit cc6fe6c, target branch master) succeeded! |
Add APIs for creating NumPy arrays backed by pinned memory
Thanks, @kmaehashi and @jakirkham! |
Close #3625.
This PR adds a few convenience functions to the
cupyx
namespace for allocating NumPy arrays backed by pinned/pagelocked memory, see the discussion around #3625 (comment). Currently the provided APIs are as follows:cupyx.empty_pinned()
cupyx.empty_like_pinned()
cupyx.zeros_pinned()
cupyx.zeros_like_pinned()
with exactly the semantics as their NumPy counterparts.
Ideally, we can do better than this if we use NumPy's memory hooks to always allocate NumPy arrays from pinned memory (numpy/numpy#17467), however it's still a WIP, so we can only revisit it when it's in.
TODO: