Skip to content

Consider using KernelAbstractions.jl for GPU support #541

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

Open
SouthEndMusic opened this issue Feb 3, 2025 · 2 comments
Open

Consider using KernelAbstractions.jl for GPU support #541

SouthEndMusic opened this issue Feb 3, 2025 · 2 comments
Labels
computing Related to computational issues wishlist Features and/or changes that could be nice in the future

Comments

@SouthEndMusic
Copy link
Contributor

Feature type

None

Improvement Description

See https://juliagpu.github.io/KernelAbstractions.jl/stable/kernels/. It provides a syntax to write kernels that can be compiled for either CPU or GPU.

Implementation Description

Benefits of using this:

  • It allows for both CPU and GPU parallelizatiation without code duplication
  • The transition can be done stepwise in the current code base instead of building a separate ‘Wflow for GPU’ code base from scratch
  • You don’t have to align with the SciML data structure standard if you don’t want to
  • I have some experience 🙂

Additional Context

No response

@SouthEndMusic SouthEndMusic added computing Related to computational issues wishlist Features and/or changes that could be nice in the future labels Feb 3, 2025
@BSchilperoort
Copy link

Hi Bart, we were also considering using KernelAbstractions for parallelizing parts of Wflow for the exact reasons you stated (as part of the ESiWACE project). Good to see that you've found this package too! We can try to keep you in the loop about our progress towards this.

@vers-w
Copy link
Collaborator

vers-w commented Feb 25, 2025

Just adding this as a reminder here (discussed as part of the ESiWACE project on 17 Feb. 2025):

Recommendation is to also check the CPU performance of KernelAbstractions during implementation as we have experienced a decrease in performance when using > 8 threads with Julia's native treading, hence the use of Polyester (> 8 threads). Additionally, we make use of LoopVectorization for local inertial routing. @SouthEndMusic provided the following with some info on the KernelAbstractions CPU backend. And there is a KernelAbstractions issue reporting a slowdown with CPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
computing Related to computational issues wishlist Features and/or changes that could be nice in the future
Projects
None yet
Development

No branches or pull requests

3 participants