Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CUDA into an extension #3481

Open
navidcy opened this issue Feb 15, 2024 · 3 comments
Open

Move CUDA into an extension #3481

navidcy opened this issue Feb 15, 2024 · 3 comments
Labels
extensions 🧬 GPU 👾 Where Oceananigans gets its powers from

Comments

@navidcy
Copy link
Collaborator

navidcy commented Feb 15, 2024

It'd be nice if we move CUDA functionality into an extension so it's only loaded for CUDA-enabled devices.

@vchuravy made a first attempt to do that at #3066

similar effort but for AMDGPU is at #3475

@navidcy navidcy added GPU 👾 Where Oceananigans gets its powers from extensions 🧬 labels Feb 15, 2024
@navidcy
Copy link
Collaborator Author

navidcy commented Mar 9, 2024

Of course, there is a (minor?) downside to this. As things stand now we can do:

using Oceananigans

grid = RectilinearGrid(GPU(), ...)

...

If we move CUDA functionality to an extension we'd have to do:

Of course, there is a (minor?) downside to this. As things stand now we can do:

using Oceananigans
using CUDA

grid = RectilinearGrid(GPU(), ...)

...

@vchuravy
Copy link
Collaborator

vchuravy commented Mar 9, 2024

The benefit is that the user can choose to not install CUDA and just use the CPU implementation of Oceananigans, or use AMDGPU instead of CUDA. So installing Oceanigans will be faster and users on laptops without GPUs won't have to pay for the additional packages

@glwagner
Copy link
Member

glwagner commented Mar 10, 2024

I think the benefit of faster CPU compilation is worth the price of a using CUDA, not least because we should be concerned about time-to-first-solution and because, though the most important simulations run on GPU, the most number of simulations run on CPU (including a lot of CI). It also seems more forward-looking since there may be many GPU options in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions 🧬 GPU 👾 Where Oceananigans gets its powers from
Projects
None yet
Development

No branches or pull requests

3 participants