-
-
Notifications
You must be signed in to change notification settings - Fork 324
Update and document GPU buffer handling #2751
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
94e460e
Update GPU handling
TomAugspurger 9884f36
fixed doc
TomAugspurger 7bc90b9
Merge remote-tracking branch 'upstream/main' into tom/fix/gpu
TomAugspurger 8371513
Fixup
TomAugspurger 56cc00c
changelog
TomAugspurger 60ba16a
doctest, skip
TomAugspurger cb67094
removed not gpu
TomAugspurger 2b70d0d
assert that the type matches
TomAugspurger 1e94ce2
Merge remote-tracking branch 'upstream/main' into tom/fix/gpu
TomAugspurger 7c31bc2
Added changelog notes
TomAugspurger 424329f
Merge remote-tracking branch 'upstream/main' into tom/fix/gpu
TomAugspurger d5ab1d7
Merge branch 'main' into tom/fix/gpu
TomAugspurger c0b118f
Merge branch 'main' into tom/fix/gpu
d-v-b File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixed bug with Zarr using device memory, instead of host memory, for storing metadata when using GPUs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added new user guide on :ref:`user-guide-gpu`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added :meth:`zarr.config.enable_gpu` to update Zarr's configuration to use GPUs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.. _user-guide-gpu: | ||
|
||
Using GPUs with Zarr | ||
==================== | ||
|
||
Zarr can use GPUs to accelerate your workload by running | ||
:meth:`zarr.config.enable_gpu`. | ||
|
||
.. note:: | ||
|
||
`zarr-python` currently supports reading the ndarray data into device (GPU) | ||
memory as the final stage of the codec pipeline. Data will still be read into | ||
or copied to host (CPU) memory for encoding and decoding. | ||
|
||
In the future, codecs will be available compressing and decompressing data on | ||
the GPU, avoiding the need to move data between the host and device for | ||
compression and decompression. | ||
|
||
Reading data into device memory | ||
------------------------------- | ||
|
||
:meth:`zarr.config.enable_gpu` configures Zarr to use GPU memory for the data | ||
buffers used internally by Zarr. | ||
|
||
.. code-block:: python | ||
|
||
>>> import zarr | ||
>>> import cupy as cp # doctest: +SKIP | ||
>>> zarr.config.enable_gpu() # doctest: +SKIP | ||
>>> store = zarr.storage.MemoryStore() # doctest: +SKIP | ||
>>> z = zarr.create_array( # doctest: +SKIP | ||
... store=store, shape=(100, 100), chunks=(10, 10), dtype="float32", | ||
... ) | ||
>>> type(z[:10, :10]) # doctest: +SKIP | ||
cupy.ndarray | ||
|
||
Note that the output type is a ``cupy.ndarray`` rather than a NumPy array. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ Advanced Topics | |
performance | ||
consolidated_metadata | ||
extending | ||
gpu | ||
|
||
|
||
.. Coming soon | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I believe this shows it's covered: https://app.codecov.io/github/zarr-developers/zarr-python/blob/TomAugspurger%2Fzarr-python%3Atom%2Ffix%2Fgpu/src%2Fzarr%2Fcore%2Fconfig.py#L66
Maybe the warning comes from the CPU-only coverage run?