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

Python wrapper of vkFFT for Vulkan backend #229

Open
yves-surrel opened this issue Jun 9, 2021 · 5 comments
Open

Python wrapper of vkFFT for Vulkan backend #229

yves-surrel opened this issue Jun 9, 2021 · 5 comments

Comments

@yves-surrel
Copy link

I am an end-user needing GPU speed for my computations in Python. Until today, I have been pretty satisfied with the excellent pyOpenCL bindings and clFFT library. I recently discovered vkFFT (the name of which hides the fact that there are other backends than Vulkan). Vincent Favre-Nicolin created the Python bindings of vkFFT for the CUDA and OpenCL backends.

I began to play with interfacing vkFFT Vulkan backend to Python , using Vincent's existing work. It seems relatively easy to rework vkfft_opencl.cpp to create a vkfft_vulkan.cpp file that should be convenient. My problem is to rework opencl.py as vkFFT expects things like VkBuffer, VkQueue and VkCommandPool objects that seem not to be exposed by kompute.

Is there a way to get the required objects (e.g. the VkBuffer object from a Tensor object), or should I disregard kompute to switch to the much lower level Realitix Vulkan bindings ? This would be a pity, as Kompute seems more easily usable.

@axsaucedo
Copy link
Member

Thanks for the question @yves-surrel , I would be extremely interested to add vkFFT into Kompute and integrate it - I don't think currently there are plans to expose every underlying Vulkan API object through Kompute Python interface as ultimately the objective of Kompute is to provide an abstraction, although the C++ component would make more sense to expose it so happy to explore that. We recently had an example port of a neural network with only a couple of lines of code (https://github.com/EthicalML/vulkan-kompute/tree/master/examples/neural_network_vgg7) so it may be something interesting to try to implement this as an Operation / Kernel. If you are interested I would be very keen to explore this further.

@yves-surrel
Copy link
Author

Sure that a Kompute OpFFT would interest plenty of people. Probably OpenCL is reaching the end of its life, so switching with minimum efforts to a more modern framework is really desirable.

@axsaucedo
Copy link
Member

@yves-surrel just following up on this, would you be interested on giving this an initial go?

@yves-surrel
Copy link
Author

yves-surrel commented Sep 14, 2021 via email

@axsaucedo
Copy link
Member

No worries at all, I assumed from the suggestion that you may have some insights on creating an interface, which would be awesome as the vkFFT project is awesome, but let's keep this issue open to see if it can be picked up in the near future. For the meantime any contributions to increase the function and code coverage in the C++ codebase is certainly appreciated, but given your current committments it seems that's something that could be explored if relevant in a potential future. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants