Check GPU availability for cupy import#187
Conversation
cupy could be installed in the environment but: - CUDA version could be not compatible - The computer could not have a GPU
|
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, |
|
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 . |
cupy could be installed in the environment but: