-
-
Notifications
You must be signed in to change notification settings - Fork 329
Initial GPU support #1967
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
Initial GPU support #1967
Changes from 32 commits
22a5807
d8cc79f
4d2b8c7
36b1cb2
04001b4
74a13c4
bdc0a24
d900aa3
0eca795
d9ed6c4
5405e38
2858701
4e18098
35948d4
bd2a20b
828401f
02a6e9d
ff40d3c
e5cfd2f
d473a3d
2a2e399
b89ab9a
c5a387d
72d172d
3db61bd
425c3f8
75b0ad7
c8c7e6d
25a67ca
ce7f5e2
ac061d9
523d8d5
b559ee4
26a74f4
7307833
f6fddd9
2b1fe14
abd135f
1db58e7
296bd02
b33c887
c894f60
e0da0fb
07277af
6e49e85
02c319c
e82ddc1
7854ce9
9688ad6
3852c9f
2e8069c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,48 @@ | ||||||||||||||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||||||||||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||||||||||||||
|
||||||||||||||
name: GPU Test V3 | ||||||||||||||
|
||||||||||||||
on: | ||||||||||||||
push: | ||||||||||||||
branches: [ v3 ] | ||||||||||||||
pull_request: | ||||||||||||||
branches: [ v3 ] | ||||||||||||||
workflow_dispatch: | ||||||||||||||
|
||||||||||||||
concurrency: | ||||||||||||||
group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||||||
cancel-in-progress: true | ||||||||||||||
|
||||||||||||||
jobs: | ||||||||||||||
test: | ||||||||||||||
name: py=${{ matrix.python-version }}, np=${{ matrix.numpy-version }}, deps=${{ matrix.dependency-set }} | ||||||||||||||
|
||||||||||||||
runs-on: gpu-runner | ||||||||||||||
strategy: | ||||||||||||||
matrix: | ||||||||||||||
python-version: ['3.10', '3.11', '3.12'] | ||||||||||||||
numpy-version: ['1.24', '1.26', '2.0'] | ||||||||||||||
dependency-set: ["minimal", "optional"] | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if we did something like this for now:
Suggested change
The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be ideal. There is currently a |
||||||||||||||
|
||||||||||||||
steps: | ||||||||||||||
- uses: actions/checkout@v4 | ||||||||||||||
- name: GPU check | ||||||||||||||
run: | | ||||||||||||||
nvidia-smi | ||||||||||||||
- name: Set up Python | ||||||||||||||
uses: actions/setup-python@v5 | ||||||||||||||
with: | ||||||||||||||
python-version: ${{ matrix.python-version }} | ||||||||||||||
cache: 'pip' | ||||||||||||||
- name: Install Hatch | ||||||||||||||
run: | | ||||||||||||||
python -m pip install --upgrade pip | ||||||||||||||
pip install hatch | ||||||||||||||
- name: Set Up Hatch Env | ||||||||||||||
run: | | ||||||||||||||
hatch env create test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} | ||||||||||||||
hatch env run -e test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} list-env | ||||||||||||||
- name: Run Tests | ||||||||||||||
run: | | ||||||||||||||
hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run-coverage-gpu |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,9 @@ jupyter = [ | |
'ipytree>=0.2.2', | ||
'ipywidgets>=8.0.0', | ||
] | ||
gpu = [ | ||
"cupy>=13.0.0", | ||
] | ||
docs = [ | ||
'sphinx', | ||
'sphinx-autobuild>=2021.3.14', | ||
|
@@ -136,6 +139,7 @@ features = ["optional"] | |
|
||
[tool.hatch.envs.test.scripts] | ||
run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov=tests" | ||
run-coverage-gpu = "pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov=tests" | ||
run = "run-coverage --no-cov" | ||
run-verbose = "run-coverage --verbose" | ||
run-mypy = "mypy src" | ||
|
@@ -223,4 +227,8 @@ filterwarnings = [ | |
"error:::zarr.*", | ||
"ignore:PY_SSIZE_T_CLEAN will be required.*:DeprecationWarning", | ||
"ignore:The loop argument is deprecated since Python 3.8.*:DeprecationWarning", | ||
"ignore:Creating a zarr.buffer.gpu.*:UserWarning", | ||
] | ||
markers = [ | ||
"gpu: mark a test as requiring CuPy and GPU" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make it is worth using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're thinking, @jakirkham, that then there could be a multiplicity of these. |
||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from zarr.core.buffer.core import ( | ||
ArrayLike, | ||
Buffer, | ||
BufferPrototype, | ||
NDArrayLike, | ||
NDBuffer, | ||
default_buffer_prototype, | ||
) | ||
from zarr.core.buffer.cpu import numpy_buffer_prototype | ||
|
||
__all__ = [ | ||
"ArrayLike", | ||
"Buffer", | ||
"NDArrayLike", | ||
"NDBuffer", | ||
"BufferPrototype", | ||
"default_buffer_prototype", | ||
"numpy_buffer_prototype", | ||
] |
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.
@jhamman What test matrix do we want to have for GPU testing? This current config seems a bit excessive? Might be worth cutting this down to the bare minimum to keep CI costs down?