Add APIs for creating NumPy arrays backed by pinned memory#4870
Add APIs for creating NumPy arrays backed by pinned memory#4870mergify[bot] merged 20 commits intocupy:masterfrom
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 |
|
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
cupyxnamespace 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: