I’m trying to work with a dataset with missing data using the CUDA.jl. I’d like to skip the missing data in some statistics (mean, covariance etc). Is there any general solution to this that performs well on a GPU? I have written custom kernels to do this but I think I may be missing something and there could be a cleaner way to do it.
I’d like to be able to write something short like:
using CUDA a = rand(1000,1000) #random data a[ a.>0.5 ] .= NaN # simulate missing data using nan since no missings support a = cu(a) mapslices( x->mean(filter(!isnan,x)),a,dims=1) #average non-missing data in each colum
This works but is extremely slow on the GPU. Everything I have tried is either very slow or won’t compile for the GPU. Is there a reasonably fast way to do this without custom kernels?