Repository navigation
Update to cunumpy 0.6.1 - #94
Merged
Merged
Conversation
- xp.infty -> xp.inf (NumPy 2 removed the alias; cunumpy forwards to NumPy/CuPy). - CUDA_STRATEGY.md: the cunumpy submodules since 0.6 (CudaKernel and CudaKernelVariants in cunumpy.kernels, the argument classes in cunumpy.arguments, the device runtime stays in cunumpy.cuda). feectools already imports everything else from the 0.6 locations; the parity and CPU emulation tests pass with cunumpy 0.6.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
spossann
approved these changes
Oct 7, 2026
spossann
reviewed
Oct 7, 2026
spossann
reviewed
Oct 7, 2026
max-models
added a commit
to struphy-hub/struphy
that referenced
this pull request
Oct 7, 2026
Corresponding PR in feectools: struphy-hub/feectools#94 **Solves the following issue(s):** Moves struphy to cunumpy 0.6.1. Part of the CUDA work tracked in #650. Stack: #668 (PR 13) → #670 (PR 14) → #671 (PR 15) → #679 (PR 16) → #680 (PR 17) → #681 (PR 18) → #683 (PR 19) → **this PR**. **Core changes:** - **Dependency:** `pyproject.toml` requires `cunumpy >= 0.6.0, <= 0.6.0`. The `feectools` submodule points at struphy-hub/feectools#94 (`update-cunumpy-version`), which moves feectools to cunumpy 0.6. - **New import locations.** cunumpy 0.6 moved `CudaKernel` from `cunumpy.cuda` to `cunumpy.kernels`, and the argument classes to the new `cunumpy.arguments`; the old paths are removed. Updated imports: - `CudaStructArguments` in `kernel_arguments/pusher_args_cuda.py` and `local_projectors_args_cuda.py` - `write_cuda_header` in `utils/cuda_arguments.py` - `CudaKernel` and `CudaStruct` in the tests: `pic/tests/cuda_emulation.py`, `test_cuda_emulation.py`, `test_device_helpers.py`, `test_kernel_backends.py`, `bsplines/tests/test_evaluation_cuda.py` - **Generated headers:** `kernel_arguments/pusher_args.cuh` and `local_projectors_args.cuh` are regenerated. Only the "Generated by `cunumpy.arguments.CudaStruct`" comment changes; the struct layouts are identical. - **Nothing else needed changing.** A script checked every cunumpy import and attribute used in `src/` and in the feectools submodule against cunumpy 0.6.0, with deprecation warnings treated as errors; after this PR it reports nothing. The other 0.6 changes don't apply to struphy: - **Removed:** `PyccelStructArguments`, `KernelArguments`, `resolve_host_args` and `__host_args__`. Struphy stopped using them in PR 16. - **`dispatch="arrays"`:** it changed meaning in 0.6, and struphy doesn't use it. - **MPI override variable:** it is now `MAYBEMPI` instead of `CUNUMPY_MPI`, and struphy doesn't set either. **Model-specific changes:** None. **Documentation changes:** `CUDA_STRATEGY.md`: the "Current state" table names the cunumpy 0.6 submodules (`cunumpy.kernels`, `cunumpy.arguments`, `cunumpy.cuda`). **Testing:** smoke-tested locally with cunumpy 0.6.0, with cunumpy deprecation warnings treated as errors: - `test_kernel_backends.py`, `test_cuda_parity.py`, and the CPU emulation of `push_eta_stage` and `kernel_evaluate` pass; - in the feectools submodule, the parity and emulation tests pass (16 passed). The full test suite runs in CI. GPU tests have not been run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Corresponding PR in struphy: struphy-hub/struphy#685
Summary
Moves feectools to cunumpy 0.6.0 (
pyproject.toml:cunumpy >= 0.6.0).In 0.6, cunumpy removed the top-level names that were deprecated in 0.5. It also moved
CudaKernelandCudaKernelVariantstocunumpy.kernelsand the argument classes to the newcunumpy.arguments. The device runtime (bind_local_device,device_count, …) stays incunumpy.cuda.Changes
pyproject.toml: requirescunumpy >= 0.6.0.linalg/solvers.py:xp.inftybecomesxp.inf. NumPy 2 removedinfty, and cunumpy forwards to NumPy/CuPy, so this line would fail whenever it was reached, independent of the cunumpy version.CUDA_STRATEGY.md: names the cunumpy 0.6 submodules feectools imports from.Nothing else needed changing. A script checked every cunumpy import and attribute used in
feectools/against cunumpy 0.6.0, with deprecation warnings treated as errors. After this PR it reports nothing, so the CUDA stack (#90, #86, #87, #88) already imports from the 0.6 locations (cunumpy.kernels,cunumpy.cuda,cunumpy.mpi,cunumpy.kernel_testing). feectools doesn't usePyccelStructArguments,__host_args__,dispatch="arrays"orCUNUMPY_MPI, all of which 0.6 removed or changed.Testing
With cunumpy 0.6.0,
linalg/tests/test_cuda_parity.pyandlinalg/tests/test_cuda_emulation.pypass locally: 16 passed, 31 skipped (GPU only). Both cover all 12 stencil kernels, comparing the pyccel versions with the CPU-emulated CUDA versions. The full test suite runs in CI. GPU tests have not been run.Used by struphy-hub/struphy#685, whose
feectoolssubmodule points at this branch.🤖 Generated with Claude Code