pydata / bottleneck

Fast NumPy array functions written in C
BSD 2-Clause "Simplified" License
1.08k stars 104 forks source link

Seeking advice on implementing certain operators on GPU #446

Open zjzjwang opened 7 months ago

zjzjwang commented 7 months ago

I am considering implementing some operators of bottleneck on the GPU using libraries such as pytorch, cupy, and perhaps CUDA or triton.

Specifically, for the "move" series of operators, when working with large data sizes, using pytorch (on GPU) can significantly accelerate the process. (I implemented a sliding window using unfold.)

However, I've encountered some difficulties while trying to implement rankdata, nanrankdata, and push operators. The performance is not as good as expected (In fact, it is much slower than the implementation in bottleneck.), and I suspect that the for-loops within these implementations might be causing the slowdown.

Do you have any suggestions or recommendations on how to efficiently implement these operators on the GPU?

2 / 2