Skip to content

MHD equilibria on the CuPy backend #696

Closed

Description

@max-models

The MHD equilibria cannot be created on CuPy yet. EQDSKequilibrium passes device arrays from xp.linspace to SciPy's RectBivariateSpline. Tokamak works around this by building its default equilibrium on NumPy (PR 19).

  • find which equilibria fail on CuPy (fields_background/equils.py)
  • keep host-only setup (fits, SciPy splines) on NumPy, and move the evaluation that runs in the time loop to the device
  • tests on CuPy against NumPy

Part of #650 (see CUDA_STRATEGY.md).

Activity

  1. added
    GPURunning Struphy on GPUs
    CUDACUDA kernels and the CUDA porting (see #650)
    on Oct 7, 2026
  2. added 2 commits that reference this issue on Oct 7, 2026
  3. max-models commented on Oct 14, 2026

    @max-models
    MemberAuthor

    Done in #714: every equilibrium in fields_background/equils.py can be created and evaluated on CuPy. Host-only setup (SciPy fits, ODE solves, EQDSK files) runs on NumPy, and there are CuPy-vs-NumPy tests in fields_background/tests/test_equils_cupy.py. Evaluating GVEC/DESC fields on the device (instead of one host round trip per call) is tracked in #715.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CUDACUDA kernels and the CUDA porting (see #650)GPURunning Struphy on GPUs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions