Skip to content

feat: GPU acceleration module and scripts#99

Open
FIrgolitsch wants to merge 1 commit into
pr-e-motor-stackingfrom
pr-f-gpu-acceleration
Open

feat: GPU acceleration module and scripts#99
FIrgolitsch wants to merge 1 commit into
pr-e-motor-stackingfrom
pr-f-gpu-acceleration

Conversation

@FIrgolitsch

@FIrgolitsch FIrgolitsch commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Stacked PR 2/22 — review order: #115#97#98#99#100#101#108#106#107#87#116#110#111#40#112#113#117#118#120#121#122#123#124#125

Base: pr-e-motor-stacking. Retargets to main as upstream PRs merge.


PR #99 — GPU Acceleration (unified CPU/GPU scripts)

Adds the linumpy/gpu/ module (CuPy + JAX primitives) and wires the existing CPU scripts in the repo to pick up an optional GPU path via --use_gpu. Stand-alone *_gpu.py script variants are intentionally removed in this PR (replaced by the unified CPU scripts in #97).

New library module linumpy/gpu/

  • array_ops.py — cupy/jax array primitives and CPU fallbacks
  • corrections.py — GPU illumination / flat-field corrections
  • cuda_env.py — CUDA environment detection (CUDA version, CuPy availability, JAX plugin status) + device selection; used by every GPU-capable script to negotiate the backend
  • fft_ops.py — GPU FFT (phase-correlation building blocks)
  • image_quality.py — GPU variance / sharpness metrics
  • interpolation.py — GPU affine/linear resampling
  • morphology.py — GPU morphological ops (erode/dilate/tophat)
  • normalization.py — GPU intensity normalization (percentile / rolling-ball) paired with linumpy/preproc/normalization.py from feat: utility modules, preprocessing improvements, galvo correction #97
  • registration.py — GPU phase-correlation + refinement; callable from linumpy/stitching/registration.py

Scripts

  • scripts/linum_benchmark_gpu.py — benchmark harness comparing CPU vs GPU on the key hot paths (normalization, registration, resampling)
  • scripts/linum_gpu_info.py — report available CUDA / CuPy / JAX devices and plugin status

Removed (unified into CPU scripts via --use_gpu)

  • linum_aip_gpu.py, linum_assess_slice_quality_gpu.py, linum_create_mosaic_grid_3d_gpu.py, linum_estimate_transform_gpu.py, linum_fix_illumination_3d_gpu.py, linum_generate_mosaic_aips_gpu.py, linum_normalize_intensities_per_slice_gpu.py, linum_resample_mosaic_grid_gpu.py

Shell helpers

  • shell_scripts/fix_jax_cuda_plugin.sh — resets a broken JAX CUDA plugin install; autodetects CUDA 12 vs 13 and picks the matching jax-cuda*-plugin wheel

Notes

@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch 2 times, most recently from 73f2ced to ece07fe Compare April 17, 2026 22:15
@FIrgolitsch FIrgolitsch changed the base branch from main to pr-a-build-tooling April 17, 2026 22:22
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from ece07fe to 5aae60d Compare April 23, 2026 19:43
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from 5aae60d to aa42b00 Compare April 23, 2026 21:09
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from aa42b00 to fdaffcf Compare April 23, 2026 21:23
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from fdaffcf to 5efa698 Compare April 23, 2026 21:28
@FIrgolitsch FIrgolitsch changed the base branch from pr-a-build-tooling to pr-e-motor-stacking April 27, 2026 23:36
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from 5efa698 to 3707675 Compare April 29, 2026 19:39
@FIrgolitsch FIrgolitsch force-pushed the pr-e-motor-stacking branch from e939493 to 20d26d1 Compare April 29, 2026 19:39
@FIrgolitsch FIrgolitsch force-pushed the pr-e-motor-stacking branch 2 times, most recently from 15db0d2 to 7b331c8 Compare April 30, 2026 03:21
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from 3707675 to 3872acc Compare April 30, 2026 03:21
@FIrgolitsch FIrgolitsch force-pushed the pr-e-motor-stacking branch from 7b331c8 to 258fdee Compare April 30, 2026 03:26
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from 3872acc to 7417982 Compare April 30, 2026 03:26
@FIrgolitsch FIrgolitsch force-pushed the pr-e-motor-stacking branch from 258fdee to 6649b3a Compare April 30, 2026 03:51
@FIrgolitsch FIrgolitsch force-pushed the pr-f-gpu-acceleration branch from 7417982 to cfa6a38 Compare April 30, 2026 03:51
@FIrgolitsch FIrgolitsch force-pushed the pr-e-motor-stacking branch from 6649b3a to c6ad655 Compare May 7, 2026 15:36
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.

1 participant