-
Notifications
You must be signed in to change notification settings - Fork 7
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
Make transforms work on CUDA arrays #48
Conversation
In particular, `plan_rfft(::CuArray, args...; kws...)` fails when `kws` is not empty. Therefore, for GPU arrays, we avoid passing any keyword arguments to planner functions.
Codecov Report
@@ Coverage Diff @@
## master #48 +/- ##
==========================================
- Coverage 98.32% 98.13% -0.20%
==========================================
Files 9 9
Lines 419 428 +9
==========================================
+ Hits 412 420 +8
- Misses 7 8 +1
Continue to review full report at Codecov.
|
Hi @jipolanco , I wonder whether it needs CUDA-aware MPI or just normal MPI? |
Hi, you definitely need CUDA-aware MPI if you're using CuArrays. |
This PR allows performing FFTs on
CuArray
s.Concretely, it's now possible to create and apply
PencilFFTPlan
s on CUDA arrays.Here is a short example:
For now this has only been tested on a few CPU processes and single GPU using CUDA.
I'm not yet sure if this actually gives correct results, but it's a start.For correct results, this also needs jipolanco/PencilArrays.jl#65, which will be included in PencilArrays v0.17.5.It would be great if this could be tested on multi-GPU configurations.
Note that an explicit dependency on CUDA.jl is not needed, since functions like
plan_rfft(::CuArray, args...)
automatically dispatch to CuFFT functions. The only minor issue is that those functions don't support keyword arguments (such asflags = FFTW.MEASURE
, which may be passed to FFTW plans), which is one of the reasons why creating plans onCuArrays
used to fail before this PR.This should hopefully close #3.