Skip to content
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

Implement CupyArrayContext #251

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7ab5211
Implement CupyArrayContext
matthiasdiener Feb 16, 2024
96b7a3d
print device name in test
matthiasdiener Feb 16, 2024
8dee38d
pylint
matthiasdiener Feb 17, 2024
2c025eb
Merge branch 'main' into cupyactx
matthiasdiener May 24, 2024
d6e3136
Merge branch 'main' into cupyactx
matthiasdiener Sep 6, 2024
bfa648a
update with current numpy actx
matthiasdiener Sep 6, 2024
27e5a19
restore some tests
matthiasdiener Sep 6, 2024
6d507e1
ruff
matthiasdiener Sep 6, 2024
8fb4e0b
make cupy import optional
matthiasdiener Sep 6, 2024
be70b67
CI fixes
matthiasdiener Sep 6, 2024
677419b
remove a few spurious changes
matthiasdiener Sep 6, 2024
6250211
change CI cupy integration
matthiasdiener Sep 6, 2024
d61f0cf
simplify CI install slightly
matthiasdiener Sep 6, 2024
5871ae7
Merge branch 'main' into cupyactx
matthiasdiener Nov 14, 2024
9c56443
Merge branch 'main' into cupyactx
matthiasdiener Dec 3, 2024
fd95813
lint
matthiasdiener Dec 3, 2024
5f4c4d9
update docs
matthiasdiener Dec 3, 2024
a8fe272
Merge branch 'main' into cupyactx
matthiasdiener Jan 31, 2025
2296c6d
improve array container support in {to,from}_numpy
matthiasdiener Jan 31, 2025
8fd5488
WS fix
matthiasdiener Jan 31, 2025
6f3cd94
fixes
matthiasdiener Feb 3, 2025
ab8266d
allow optional device selection
matthiasdiener Feb 7, 2025
79b0bc3
try running cupy via gitlab
matthiasdiener Feb 7, 2025
70aff99
debug more
matthiasdiener Feb 7, 2025
8b5c6cf
Revert "debug more"
matthiasdiener Feb 7, 2025
8561b2f
only test pocl-cpu in cupy test
matthiasdiener Feb 7, 2025
904e061
fix conda build
matthiasdiener Feb 7, 2025
340f9dc
add to coverage table
matthiasdiener Feb 8, 2025
3ee28cc
keep device in clone()
matthiasdiener Feb 11, 2025
ce33f23
remove loopy handling
matthiasdiener Feb 11, 2025
cd2a366
Revert "keep device in clone()"
matthiasdiener Feb 12, 2025
8e7e1f1
Revert "allow optional device selection"
matthiasdiener Feb 12, 2025
326e164
No need for separate method
matthiasdiener Feb 17, 2025
4d429f8
remove unneeded functions
matthiasdiener Feb 17, 2025
69e2133
add a comment on non-blocking cp.asnumpy
matthiasdiener Feb 17, 2025
f83ee9c
add README links
matthiasdiener Feb 17, 2025
fae85a4
fix typo
matthiasdiener Feb 17, 2025
d9ce8d5
clean up loopy cache
matthiasdiener Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WS fix
matthiasdiener committed Jan 31, 2025

Verified

This commit was signed with the committer’s verified signature.
commit 8fd5488b637c6a19da9a5ba0152157d46e253a45
1 change: 0 additions & 1 deletion test/test_arraycontext.py
Original file line number Diff line number Diff line change
@@ -1148,7 +1148,6 @@
# key stringification logic.
from arraycontext import from_numpy, to_numpy
actx = actx_factory()

rng = np.random.default_rng()

def my_rhs(scale, vel):
@@ -1284,7 +1283,7 @@

# {{{ test_array_container_with_numpy

@with_container_arithmetic(bcasts_across_obj_array=True, rel_comparison=True)

Check warning on line 1286 in test/test_arraycontext.py

GitHub Actions / Pytest Conda Py3 Intel

<class 'test_arraycontext.ArrayContainerWithNumpy'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'test_arraycontext.ArrayContainerWithNumpy'>.

Check warning on line 1286 in test/test_arraycontext.py

GitHub Actions / Pytest Conda Py3 Intel

<class 'test_arraycontext.ArrayContainerWithNumpy'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'test_arraycontext.ArrayContainerWithNumpy'>.

Check warning on line 1286 in test/test_arraycontext.py

GitHub Actions / Pytest Conda Py3 POCL

<class 'test_arraycontext.ArrayContainerWithNumpy'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'test_arraycontext.ArrayContainerWithNumpy'>.

Check warning on line 1286 in test/test_arraycontext.py

GitHub Actions / Pytest Conda Py3 POCL

<class 'test_arraycontext.ArrayContainerWithNumpy'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'test_arraycontext.ArrayContainerWithNumpy'>.
@dataclass_array_container
@dataclass(frozen=True)
class ArrayContainerWithNumpy:

Unchanged files with check annotations Beta

return self.mass.array_context
@with_container_arithmetic(

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

'bcast_container_types' is deprecated and will be unsupported from 2025. Use 'container_types_bcast_across', with equivalent meaning.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

<class 'testlib.MyContainerDOFBcast'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.MyContainerDOFBcast'>.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

'bcast_container_types' is deprecated and will be unsupported from 2025. Use 'container_types_bcast_across', with equivalent meaning.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

<class 'testlib.MyContainerDOFBcast'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.MyContainerDOFBcast'>.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

'bcast_container_types' is deprecated and will be unsupported from 2025. Use 'container_types_bcast_across', with equivalent meaning.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

<class 'testlib.MyContainerDOFBcast'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.MyContainerDOFBcast'>.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

'bcast_container_types' is deprecated and will be unsupported from 2025. Use 'container_types_bcast_across', with equivalent meaning.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

<class 'testlib.MyContainerDOFBcast'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.MyContainerDOFBcast'>.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

'bcast_container_types' is deprecated and will be unsupported from 2025. Use 'container_types_bcast_across', with equivalent meaning.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

<class 'testlib.MyContainerDOFBcast'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.MyContainerDOFBcast'>.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

'bcast_container_types' is deprecated and will be unsupported from 2025. Use 'container_types_bcast_across', with equivalent meaning.

Check warning on line 161 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

<class 'testlib.MyContainerDOFBcast'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.MyContainerDOFBcast'>.
bcasts_across_obj_array=False,
bcast_container_types=(DOFArray, np.ndarray),
matmul=True,
return self.u.array_context
@with_container_arithmetic(bcasts_across_obj_array=True, rel_comparison=True)

Check warning on line 204 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

<class 'testlib.Velocity2D'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.Velocity2D'>.

Check warning on line 204 in test/testlib.py

GitHub Actions / Pytest Conda Py3 Intel

<class 'testlib.Velocity2D'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.Velocity2D'>.

Check warning on line 204 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

<class 'testlib.Velocity2D'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.Velocity2D'>.

Check warning on line 204 in test/testlib.py

GitHub Actions / Pytest Conda Py3 POCL

<class 'testlib.Velocity2D'> does not have __array_ufunc__ set. This will cause numpy to attempt broadcasting, in a way that is likely undesired. To avoid this, set __array_ufunc__ = None in <class 'testlib.Velocity2D'>.
@dataclass_array_container
@dataclass(frozen=True)
class Velocity2D: