Open t4c1 opened 5 years ago
Fantastic stuff Tadej!
To provide a bit more context to anyone reading this. I asked Tadej to go over this list of supported Stan Math signatures and to evaluate what functions could be solved using the kernel generator he is working on and which functions would benefit from a custom OpenCL kernel.
So there are a total of 31 signatures that would still benefit from a custom implementation (+ whichever of those 25+ question marks will require custom kernels):
cumulative_sum
determinant
eigenvalues_sym
eigenvectors_sym
gaussian_dlm_obs_log
gaussian_dlm_obs_lpdf
integrate_1d
integrate_ode
integrate_ode_adams
integrate_ode_bdf
integrate_ode_rk45
inverse
inverse_spd
log_determinant
matrix_exp
matrix_exp_multiply
mdivide_left
mdivide_left_spd
mdivide_right
mdivide_right_spd
qr_Q
qr_R
qr_thin_Q
qr_thin_R
quad_form_diag
singular_values
sort_asc
sort_desc
sort_indices_asc
sort_indices_desc
tcrossprod
Others will be solved using the generator at some point. There is also a lot of overlap in these function so it wont actually be completely separate kernels. The integrate functions require a function argument so that one will need some additional compiler support. As will the algebra solver.
Thanks @t4c1! fyi the reason I'm so adamant about the kernel generator being well doc'd and tested is because of how much stuff it's going to touch in the future (which is good and cool!)
tcrossprod
could use our current stuff right? Though if doing crossprod transpose with a custom kernel could probably be more clever with the indices so you don't need to do an actual transpose
Stan has many function, so there might be errors in the list. Each function should be reevaluated when OpenCL implementation is being developed.
Description
As requested by @rok-cesnovar I prepared a list of all functions in Stan Math and proposed how to implement them in OpenCL. Most are probably possible using kernel generator.
Legend:
List