Skip to content

Add pycurv-gpu dispatcher in curvature.run_pycurv.#61

Open
hemanthkapa wants to merge 7 commits into
baradlab:mainfrom
hemanthkapa:feature/pycurv-gpu-backend
Open

Add pycurv-gpu dispatcher in curvature.run_pycurv.#61
hemanthkapa wants to merge 7 commits into
baradlab:mainfrom
hemanthkapa:feature/pycurv-gpu-backend

Conversation

@hemanthkapa

Copy link
Copy Markdown
Member

Introduce run_pycurv_gpu() as a thin wrapper around core.api.run_pipeline so surface_morphometrics can opt into the GPU backend without changing the default CPU path.

hemanthkapa and others added 2 commits July 9, 2026 14:11
Introduce run_pycurv_gpu() as a thin wrapper around core.api.run_pipeline
so surface_morphometrics can opt into the GPU backend without changing the
default CPU path.

Co-authored-by: Cursor <[email protected]>
Read curvature_measurements.use_gpu / gpu_device / gpu_batch_size from
config, let --gpu override, fail fast if the GPU backend is missing, and
pass the flags through to curvature.run_pycurv().

Co-authored-by: Cursor <[email protected]>
@hemanthkapa hemanthkapa force-pushed the feature/pycurv-gpu-backend branch from 55733ec to d679aee Compare July 9, 2026 21:36
hemanthkapa and others added 5 commits July 9, 2026 14:38
Add use_gpu, gpu_device, and gpu_batch_size under curvature_measurements
so new configs expose the optional pycurv-gpu backend.

Co-authored-by: Cursor <[email protected]>
Read curvature_measurements GPU settings in refine_mesh, forward them
into the pycurv subprocess, and delete stale .gpu_normals.npz alongside
existing .gt/.vtp caches after vertex displacement.

Co-authored-by: Cursor <[email protected]>
Add pycurv-gpu next to pycurv in environment.yml / environment-ubuntu.yml
so GPU curvature is available by default; update install error messages
accordingly.

Co-authored-by: Cursor <[email protected]>
Cover use_gpu routing, write_gt=True on the GPU path, CLI --gpu /
config use_gpu wiring, and keep DEFAULTS in sync with the template.

Co-authored-by: Cursor <[email protected]>
Add a short pycurv-gpu section covering use_gpu / --gpu, install notes
for CUDA torch, and troubleshooting for missing GPU backends.

Co-authored-by: Cursor <[email protected]>
@hemanthkapa

Copy link
Copy Markdown
Member Author

Summary

  • Add an opt-in GPU curvature path via pycurv-gpu: curvature.run_pycurv(use_gpu=True) dispatches to core.api.run_pipeline(write_gt=True) so .vtp / .csv / .gt stay drop-in compatible with distances, thickness, refinement, and the GUI.
  • Wire morphometrics pycurv --gpu and curvature_measurements.use_gpu / gpu_device / gpu_batch_size (config template + DEFAULTS).
  • Pass the same GPU settings through refine_mesh’s pycurv subprocess and delete stale .NVV_rh*.gpu_normals.npz alongside existing .gt/.vtp caches.
  • Install pycurv-gpu in environment.yml / environment-ubuntu.yml (next to CPU pycurv). CUDA PyTorch is still installed separately on GPU machines.
  • Add unit tests for dispatch / CLI / config wiring and document usage in the README.

Default behavior is unchanged: use_gpu: false keeps the existing CPU pycurv path.

Test plan

  • pytest tests/test_pycurv_gpu_dispatch.py tests/test_config_utils.py::test_defaults_match_template
  • CPU path: morphometrics pycurv config.yml <surface.vtp> still produces .AVV_rh*.vtp/.csv/.gt
  • GPU path (CUDA env): use_gpu: true or --gpu → same output filenames; confirm .gt exists
  • Downstream: morphometrics distances_orientations config.yml on GPU outputs
  • refine_mesh with use_gpu: true deletes stale .gpu_normals.npz and writes a final .gt
  • Without torch/CUDA, --gpu fails fast with a clear install message

@hemanthkapa hemanthkapa marked this pull request as ready for review July 9, 2026 22:47
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