Repository navigation
Fix two host/device array mix-ups on the CuPy backend - #709
Open
max-models wants to merge 2 commits into
Open
max-models wants to merge 2 commits into
max-models wants to merge 2 commits into
Conversation
max-models
added a commit
that referenced
this pull request
Oct 7, 2026
Stack the PR on #709. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 8, 2026
Draft
max-models
added this pull request to stack #729
October 8, 2026 05:59
max-models
marked this pull request as draft
October 8, 2026 09:15
max-models
marked this pull request as ready for review
October 8, 2026 11:42
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack: part 1 of 14, based on
devel, next: #708. Full order: #709 → #708 → #711 → #712 → #705 → #713 → #714 → #718 → #720 → #721 → #724 → #725 → #723 → #722.Two small bugs that stop particle runs early on
CUNUMPY_BACKEND=cupy:SplineFunction.__init__(feec/psydac_derham.py): the knots ofderham.V0femare NumPy arrays, andxp.ascontiguousarray(=cupy.ascontiguousarray) does not accept them:TypeError: Argument 'a' has incorrect type (expected cupy._core.core._ndarray_base, got numpy.ndarray).They are now made contiguous on the host and copied to the device with
xp.asarray.SortingBoxes._set_boxes(pic/sorting.py):xp.sqrtof a Python int returned a 0-d CuPy array, whichround()rejects (TypeError: type ndarray doesn't define __round__ method).It is a host scalar, so this now uses
math.sqrt.The NumPy backend is unaffected.
Note
With these fixes,
examples/VlasovAmpereOneSpecies/strong_Landau_dampinggets further on CuPy but still stops ininitialize_neighbours: box sorting and thevlasov_maxwellaccumulationare not on the GPU yet (see
CUDA_STRATEGY.md, "Next"). This PR does not try to change that.