Commit 38fd31d
authored
Add CuPy support to ArrayStore via Array API (#579)
## Description
<!-- Provide a brief description of the PR's purpose here. -->
This PR supports CuPy via the Array API. At first I thought this might
be challenging since CuPy has a different model of devices, i.e., it
depends on context managers rather than passing in devices. However,
array-api-compat seems to have solved these issues and made CuPy
compatible in terms of devices. Here are some references that I looked
at:
- data-apis/array-api-compat#293
-
https://github.com/data-apis/array-api-compat/blob/main/array_api_compat/cupy/_aliases.py
-
https://docs.cupy.dev/en/stable/reference/array_api_functions.html#cupy.array_api.ones
## TODO
<!-- Notable points that this PR has either accomplished or will
accomplish. -->
- [x] Add cupy backend to conftest
- [x] Add instructions for installing cupy
- [x] Test ArrayStore with CuPy on GPU
- [x] Update ArrayStore to consider CuPy in pandas return type
- [x] Add cupy tests to CI -- I installed CuPy but the CuPy tests won't
actually run because we don't have a GPU runner set up -- following
scipy
(https://github.com/scipy/scipy/blob/main/.github/workflows/gpu-ci.yml),
I also set the CI to only run on ubuntu, since installing cupy on mac
and windows seems to be problematic
## Status
- [x] I have read the guidelines in
[CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md)
- [x] I have formatted my code using `yapf`
- [x] I have tested my code by running `pytest`
- [x] I have linted my code with `pylint`
- [x] I have added a one-line description of my change to the changelog
in
`HISTORY.md`
- [x] This PR is ready to go1 parent c4f9ebe commit 38fd31d
File tree
5 files changed
+33
-7
lines changed- .github/workflows
- ribs/archives
- tests
5 files changed
+33
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
130 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
| 301 | + | |
| 302 | + | |
295 | 303 | | |
296 | 304 | | |
297 | 305 | | |
298 | | - | |
| 306 | + | |
299 | 307 | | |
300 | 308 | | |
301 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
| |||
0 commit comments