DTolm / VkFFT

Vulkan/CUDA/HIP/OpenCL/Level Zero/Metal Fast Fourier Transform library
MIT License
1.52k stars 89 forks source link

Python interface to VkFFT #21

Open vincefn opened 3 years ago

vincefn commented 3 years ago

This is not an issue, but rather to reference a python interface to VkFFT (using the cuda backend and pycuda) which is now available from https://github.com/vincefn/pyvkfft

It supports C2C, R2C, in and out-of place, single and double precision.

Thanks a lot to @DTolm for his help configuring this.

@inducer @lebedov this may interest you

inducer commented 3 years ago

Thanks! https://gitlab.tiker.net/inducer/pycuda/-/merge_requests/50

DTolm commented 3 years ago

Great job! I have added the link to the repo to the README of VkFFT. Best regards, Dmitrii

yves-surrel commented 3 years ago

Based on @vincefn's work and using kompute, it should be not too difficult to have a Python wrapper of vkFFT using the Vulkan backend (presently pyvkfft exposes only OpenCL and Cuda backends). Sorry it's largely beyond my skills ;-( BTW, is it expected that performances would depend on the backend (Vulkan better than OpenCL or...)?

DTolm commented 3 years ago

@yves-surrel The great thing about Vulkan backend is that users can add FFT straight to their own command buffers and have more low-level control of memory which VkFFT provides. I am not sure good this can be preserved in Python.

The performance of backends is expected to be similar. There are some things that slightly affect it (for example, you can only use 48KB of shared memory in Vulkan on Nvidia GPUs), but most systems are bandwidth limited, provided there is enough data to satisfy GPU.