jipolanco / PencilFFTs.jl

Fast Fourier transforms of MPI-distributed Julia arrays
https://jipolanco.github.io/PencilFFTs.jl/dev/
MIT License
77 stars 7 forks source link

Preliminary GPU Support #61

Open matinraayai opened 1 year ago

matinraayai commented 1 year ago

This PR contains my work on enabling GPU support for PencilFFTs.jl. The tests should work, except some permutations. I need help figuring out what goes wrong in those cases.

matinraayai commented 1 year ago

@jipolanco I'll work on creating the conditional dependency for CUDA.jl and AMDGPU.jl. Do we have a way to test the GPU code?

jipolanco commented 1 year ago

Do we have a way to test the GPU code?

Not yet. I'll contact the JuliaGPU organisation to see if we can use their Buildkite infrastructure.

matinraayai commented 1 year ago

@jipolanco why does the examples folder have its own project manifest? Do I have to update it to point to the correct version of PencilFFTs.jl?

jipolanco commented 1 year ago

You're right, there's no reason to include the examples/Manifest.toml file, especially since the examples are executed with a different set of package versions when tests are run (see runtests.jl). For now feel free to update it or to just "git remove" it.

matinraayai commented 1 year ago

@jipolanco the examples/in-place.jl on my machine works fine if I run it from the root directory project. I think it's best to make the action run it from the root directory instead of the test folder.

Is there a reason to have a Project.toml for the test/ folder and the examples/ folder?

jipolanco commented 1 year ago

Is there a reason to have a Project.toml for the test/ folder and the examples/ folder?

Yes. Tests and examples use certain extra packages that we do not want to include as PencilFFTs dependencies. OrdinaryDiffEq.jl is a good example. (Sorry, OrdinaryDiffEq.jl is used in the docs and not in the tests. But the same comment applies to other packages such as BenchmarkTools.jl.)

After looking at the details, the test failures seem to come from a recent change in FFTW.jl (https://github.com/JuliaMath/FFTW.jl/pull/253), which is actually an improvement. I'll fix this in a separate PR.

matinraayai commented 1 year ago

@jipolanco I turned CUDA and AMDGPU into optional dependencies. I tested it on both Julia 1.10 and Julia 1.7. On Julia 1.10, it will only load the extension if CUDA/AMDGPU is explicitly loaded. On Julia 1.7 it treats it as a hard dependency.