SciPy programming on CUDA cores - python

Has somebody managed to apply SciPy functions on CUDA kernels? As far as I see from the literature, there is no explicit support of SciPy for GPU computing.
I would like to speed-up code with some SciPy.optimize functions by applying it on CUDA kernels. If somebody knows of any other library for nonlinear optimization that can be applied on CUDA GPUs, would very much appreciate sharing it here.

Numba might be what you are looking for, it allows you to run python code on GPUs. Another good resource might be this tutorial

I have right now a similar problem and came across CuPy. It supports CUDA and has an interface that allows a drop-in replacement for NumPy and SciPy.

Have run into similar problems and I am now using tensorflow_probability's optimize capabilities. The biggest problem is that tensorflow ops often cannot be directly implemented from numpy functions, so there is a pretty steep learning curve. But it is very fast once your code is written.

Related

alternative to scipy's matrix exponential

I am using one of the new MacBooks with the M1 chip. I cannot use SciPy natively unless I go through Rosetta, but for other reasons I cannot do that now.
The ONLY thing I need from SciPy is scipy.linalg.expm. Is there an alternative library where there is an implementation of expm that is equally (or almost equally) fast?

FFT on RaspPi's GPU?

I am currently working on a Raspberry Pi project in which I am trying to calculate a FFT on some numpy arrays containing some measurement data. I would like to get this done on the GPU to free resources on the CPU. I found the GPU_FFT library of Andrew Holme that apparently allows exactly that.
http://www.aholme.co.uk/GPU_FFT/Main.htm
However, I do not know how to use this library exactly (I read the included instructions) as I have no knowledge of interaction between Python and C (I have never used C before). Further, I could not find any instructions on how to use GPU_FFT on the internet.
Is there any documentation/explanation that I could not find myself or can I use other Python libaries like PyFFT?
Have you tried using the Mathematica package on the rpi? I haven't but they advertise that their code is very fast and use the gpu.

How will I integrate MATLAB to TensorFlow?

I want to integrate MATLAB and TensorFlow, although I can run TensorFlow native in python but I am required to use MATLAB for image processing. Can someone please help me out with this one?
could this work?
A MATLAB implementation of the TensorFlow Neural Networks Playground.
https://github.com/StackOverflowMATLABchat/NeuralNetPlayground
I used a mex function for inference via the C++ API of TensorFlow once. That's pretty straight forward. I had to link the required TensorFlow libs statically from source though.
Similar to #HansQ's suggestion, I am currently writing a somewhat extensive wrapper called tensorflow.m for Matlab, see its repo on GitHub. I cannot provide a stable release yet, but simple functionality like importing a frozen graph and running an inference is already possible (see the examples).
I'd be glad if the package can be of use for someone looking for similar solutions; even more so, in case you extend/implement something and open a PR.

What is the main difference between Numba Pro and Theano/pyautodiff for GPU calculations?

Both Numba Pro and pyautodiff based on Theano supports conversion of Python code into GPU machine code. Theano will also allow symbolic derivation of the resulted syntax tree, but this is outside the scope of my question.
My question is whether there are technical limitations in one or the other framework, which would make the code less efficient.

Multidimensional FFT in python with CUDA or OpenCL

I have been browsing around for simple ways to program FFTs to work on my graphic card (Which is a recent NVIDIA supporting CUDA 3.something).
My current option is either to learn C, then that special C version for CUDA, or use some python CUDA functions. I'd rather not learn C yet, since I only programmed in high-level languages.
I looked at pyCUDA and other ways to use my graphic card in python, but I couldn't find any FFT library which could be use with python code only.
Some libraries/project seem to tackle similar project (CUDAmat, Theano), but sadly I found no FFTs.
Does a function exist which could do the same thing as numpy.fft.fft2(), using my graphic card?
EDIT: Bonus point for an open source solution.
There's PyFFT, which is open-source and based on Apple's (somewhat limited) implementation. Disclaimer: I work on PyFFT :)
Yes, ArrayFire has a 2-D FFT for Python.
Disclaimer: I work on ArrayFire.

Categories