Skip to content

Update to cunumpy 0.6.1 - #94

Merged
max-models merged 4 commits into
devel-tinyfrom
update-cunumpy-version
Oct 7, 2026
Merged

max-models merged 4 commits into
devel-tinyfrom
update-cunumpy-version

Conversation

@max-models

@max-models max-models commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

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 CudaKernel and CudaKernelVariants to cunumpy.kernels and the argument classes to the new cunumpy.arguments. The device runtime (bind_local_device, device_count, …) stays in cunumpy.cuda.

Changes

  • pyproject.toml: requires cunumpy >= 0.6.0.
  • linalg/solvers.py: xp.infty becomes xp.inf. NumPy 2 removed infty, 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 use PyccelStructArguments, __host_args__, dispatch="arrays" or CUNUMPY_MPI, all of which 0.6 removed or changed.

Testing

With cunumpy 0.6.0, linalg/tests/test_cuda_parity.py and linalg/tests/test_cuda_emulation.py pass 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 feectools submodule points at this branch.

🤖 Generated with Claude Code

max-models and others added 3 commits October 7, 2026 12:09
- 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>
@max-models max-models changed the title Update to cunumpy 0.6 Update to cunumpy 0.6.1 Oct 7, 2026
@max-models
max-models marked this pull request as ready for review October 7, 2026 12:45
@max-models
max-models requested a review from spossann October 7, 2026 12:46

@spossann spossann left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests on the struphy side must pass of course first, before this can be merged.

@max-models
max-models merged commit 2f6189d into devel-tiny Oct 7, 2026
15 of 17 checks passed
Comment thread pyproject.toml
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants