Hi everybody!
I am very thrilled by this new python module, aiming to further simplifying dealing with CUDA GPU programming: I just heard about it watching a video on youtube from PyCon 2018 and went straight to the docs to see what CuPy has to offer.
I have been working for the last here at a code to do non-linear curve fitting of huge volumes (we are talking of medical imaging so, let's say 4D array with an average shape of [256,256,47,70]). I have implemented a running version of it using a combination of skcuda and pycuda.
I am pretty confident I can easily switch the skcuda part to cupy, as it is mainly focused on tensors multiplication and inversion, that CuPy seems to be able to easily tackle using cupy.einsum.
My main concern is about the pycuda part of my code. So far I have been using pycuda.gpuarrays to allocate data on gpu, and custom kernels to actually implement the model I want to fit (it is a rather complex exponential-like model), and to compute its derivatives. Looking at CuPy docs, you have two types of custom kernels (reduction and elementwise), but I cannot really understand which one, if any, I can use to port my code. Basically, my kernel is straight C/CUDA code (pycuda can read it as a string), with some pointers as input, others as outputs: it does operations using input values and writes results back into those output pointers.
I hope I have been clear enough.
If it helps, I could provide you a link to an example of such a kernel I already have here on my GitHub.
I think this is the only doubt I have before starting porting my little library to CuPy: I love the core idea of mimic numpy syntax as close as possible! Help me to fill my next weekend with some good coding! xD
Thanks a lot
Hi everybody!
I am very thrilled by this new python module, aiming to further simplifying dealing with CUDA GPU programming: I just heard about it watching a video on youtube from PyCon 2018 and went straight to the docs to see what CuPy has to offer.
I have been working for the last here at a code to do non-linear curve fitting of huge volumes (we are talking of medical imaging so, let's say 4D array with an average shape of [256,256,47,70]). I have implemented a running version of it using a combination of skcuda and pycuda.
I am pretty confident I can easily switch the skcuda part to cupy, as it is mainly focused on tensors multiplication and inversion, that CuPy seems to be able to easily tackle using cupy.einsum.
My main concern is about the pycuda part of my code. So far I have been using pycuda.gpuarrays to allocate data on gpu, and custom kernels to actually implement the model I want to fit (it is a rather complex exponential-like model), and to compute its derivatives. Looking at CuPy docs, you have two types of custom kernels (reduction and elementwise), but I cannot really understand which one, if any, I can use to port my code. Basically, my kernel is straight C/CUDA code (pycuda can read it as a string), with some pointers as input, others as outputs: it does operations using input values and writes results back into those output pointers.
I hope I have been clear enough.
If it helps, I could provide you a link to an example of such a kernel I already have here on my GitHub.
I think this is the only doubt I have before starting porting my little library to CuPy: I love the core idea of mimic numpy syntax as close as possible! Help me to fill my next weekend with some good coding! xD
Thanks a lot