Skip to content

Check GPU availability for cupy import#187

Closed
ymelul wants to merge 1 commit into
holodyne:mainfrom
ymelul:main
Closed

Check GPU availability for cupy import#187
ymelul wants to merge 1 commit into
holodyne:mainfrom
ymelul:main

Conversation

@ymelul

@ymelul ymelul commented May 22, 2026

Copy link
Copy Markdown
Contributor

cupy could be installed in the environment but:

  • CUDA version could be not compatible
  • The computer could not have a GPU

cupy could be installed in the environment but:
 - CUDA version could be not compatible
 - The computer could not have a GPU
@ichristen

Copy link
Copy Markdown
Collaborator

Hi @ymelul ,

Thanks for this suggestion. I agree that a change similar to this would be very useful, and we should also handle the case where multiple GPUs are present.

However, there are files/subpackages other than algorithms that use cupy. I think we should instead do a package-level test/import for GPU-acceleration.

Torch is additionally a dependency for gradient-based optimization, and we've been meaning to add jax as well #89 , so this package-level import could also handle backend switching for gradients. For non-gradient stuff, I think we will still only support cupy because the drop-in replacement for numpy is more maintainable and the GPU memory is transferrable (with no cost) to torch and jax.

Best,
Ian

@ichristen

Copy link
Copy Markdown
Collaborator

I'm going to close this pull request for now, because we would want to implement the full package-level import before merging into main. I've created an issue #188 .

@ichristen ichristen closed this May 22, 2026
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