cupy jit kernal vs numba cuda

112 views
Skip to first unread message

Mohammed Shambakey

unread,
Aug 6, 2022, 7:45:10 AM8/6/22
to CuPy User Group
Hi

(I'm sending attachement as a google drive link at "https://drive.google.com/file/d/1yzXfu5ZdY5ByxfYwTQLrQWgzTZrsww8u/view?usp=sharing" because it is big)

I'm comparing the results of the attached cupy implementation file, "test_cupy_jit_kernel.py" (using jit.rawkernel) to a numba cuda implementation file, "test_numba_cuda.py" (using cuda.jit kernel). The functions in both files are almost the same (except for using cupy.absolute instead of the simple python abs function). There is a huge difference in results as shown in the attached result files ("init_paw_cupy_jit.npy", and "init_paw_numba.npy"). I don't know why.

So, I tried a simple cupy implementation (without kernels) in the attached "test_cupy_simple.py" file. The results (the attached "init_paw_numba.npy") are very close to the numba code. But it is still different from the cupy jit kernel implementation. Despite this simple cupy implementation works, it takes a longer time than numba, and cupy jit kernel.

I don't know how to fix the different results.

BTW, I also tried  fused kernel, but I recieved different and strange errors, so I gave up on fused kernel.

Regards
Reply all
Reply to author
Forward
0 new messages