JuliaDiff / SparseDiffTools.jl

Fast jacobian computation through sparsity exploitation and matrix coloring
MIT License
242 stars 42 forks source link

Make `num_vecjac<!>` GPU compatible #273

Open vpuri3 opened 1 year ago

vpuri3 commented 1 year ago

https://github.com/JuliaDiff/SparseDiffTools.jl/blob/9a713c6b665732d5d993651727204b39c97d5a61/src/differentiation/vecjac_products.jl#L24-L29

ChrisRackauckas commented 1 year ago

The autodiff ones should be GPU compatible already at least? Those ones should be tested on CI too. The numerical differentiation ones need some separate dispatches.

vpuri3 commented 1 year ago

Auto-diff ones work on GPU. num_jacvec<!> looks GPU compatible as well. From a cursory look num_vecjac<!> look like only ones that aren't.

vpuri3 commented 1 year ago

@ChrisRackauckas any idea how we can make this GPU? Can we use LinearAlgebra functions or does it need its own CUDA kernel?

ChrisRackauckas commented 1 year ago

Look at how FintieDiff.jl was made GPU compatible. You need to locally force allowscalar and it's a bit slow, and that's kind of required.