solprop.backends.mlx_gpu.backend#
The mlx backend: the single-precision oracle’s step, on the Metal GPU.
MlxBackend keeps everything the single-precision oracle
(NumpySingleBackend) does on the host –
admission, the narrowed tables and their exponents, the state scale, the stage
bundles, landing, statistics from the widened state, metadata – and moves the state and
every per-step pass to the device: the stage combinations, the double-float propagators
and prefactors (DoubleFloatTerms), the
transforms, the synthesis and projection products, the responses, the finish and the
error norm, reduced on the device to a few scalars per trial.
It admits the fibre route – mode-averaged and multimode capillaries, solid-core and GNLSE fibres on field and envelope grids, with Kerr, the envelope grid’s harmonic, scalar and tensor Raman, gas mixtures, the silica bundle, the field-grid plasma with its held current, loss, both temporal absorber schemes, the polarisation taper and device-ready gradients – and radial and Cartesian free space, including a line, with their transverse collars, stepped by Runge-Kutta. Everything else is refused by name.
Functions
|
Refuse, by name, what the |
Classes
|
A chunk's windowed polarisation and ungated current, device arrays. |
|
Propagate a single-precision problem on an Apple-silicon GPU. |
|
The low-storage RK4IP engine on the device (SEP 24 section 6.5). |
- class solprop.backends.mlx_gpu.backend.DeviceSources(polarisation, current)[source]#
Bases:
objectA chunk’s windowed polarisation and ungated current, device arrays.
- Attributes:
- polarisationmlx.core.array
The windowed polarisation, divided by
s.- currentmlx.core.array or None
The ungated plasma current, divided by
s, orNonewithout plasma.
- class solprop.backends.mlx_gpu.backend.MlxBackend(problem, *, grid=None, modes=None, profiles=None, tdse_binding=None)[source]#
Bases:
NumpySingleBackendPropagate a single-precision problem on an Apple-silicon GPU.
- Parameters:
- problemsolprop.translate.problem.KernelProblem
A validated single-precision fibre, radial or Cartesian problem.
- gridsolprop.grid.TimeGrid, optional
The grid, needed only by
stats.- modescollections.abc.Sequence, optional
The propagated modes, needed only by the
zdwstatistic.- profilescollections.abc.Mapping, optional
The z-profiles keyed by statistic name.
- tdse_bindingsolprop.translate.tdse.TDSEBinding or None, optional
Must be
None.
- Raises:
- BackendError
Naming what is refused, or a protected operation the device does not establish.
- memory_ledger()[source]#
Return the reference’s ledger with MLX’s device memory beside it.
- Returns:
- dict
The oracle’s rows,
mlx_device_activeandmlx_device_peak(MLX’s own counters, measured) andmlx_device_cache.
- metadata()[source]#
Return the backend’s metadata with MLX’s version, device and GEMM probe.
- Returns:
- dict
The reference’s metadata and the
mlxentries.
- name = 'mlx'#
- class solprop.backends.mlx_gpu.backend.MlxLowStorage(backend)[source]#
Bases:
objectThe low-storage RK4IP engine on the device (SEP 24 section 6.5).
The host engine’s four register passes (
HostLowStorage) with device arrays; the half-step flows are formed every step by the double-float kernel, which agrees with the host’s tabulated flows to rounding.- Parameters:
- backendMlxBackend
The backend whose state is the register
A.
- atomic = False#