Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factorize and solve the Laplacian on the GPU #84

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

lukem12345
Copy link
Member

PR #75 added GPU support to CombinatorialSpaces.jl via the CUDA.jl API.

Currently, we directly offer GPU support for the classic DEC primitive operators: $d, \star$, and $\wedge^{pp}$. And Decapodes.jl is able to automatically create bindings for higher-order operators on the GPU - such as the Laplacian - by expanding their definitions - e.g. $d\star d\star$ - and pre-multiplying those matrices. The branch llm/cuda-wedge-music is adding GPU support for $\wedge_{10}^{p d}, \wedge^{dp}_{01}$, and the interpolating musical operator $\flat\sharp$. These operators are implemented as matrix-multiplications are relatively straight-forward to port to the GPU.

However, some operators - such as the geometric Hodge star for 1-forms - are instead implemented by solving a matrix implementing that operator. $\star^{-1}$ was implemented by using gmres from Krylov.jl, and performantly solves this system, since it is "mostly" diagonal.

However, when we need to solve the heat equation by solving the sparse $\Delta_0$ matrix, gmres is not able to provide adequate performance. Further, even the factorization of this matrix on the GPU is prohibitively-expensive.

So, we need to provide a canonical way of solving this problem quickly in the CombinatorialSpaces library. The current prototype factors the matrix on the CPU, sends its components to the GPU, and in-houses an LU-solve.

We are also experimenting with approximations to the Laplacian on well-structured meshes that can be exploited for superior factorizations.

@lukem12345 lukem12345 added the enhancement New feature or request label May 16, 2024
@GeorgeR227
Copy link
Contributor

Looking at the CUDA.jl source I found that they actually do implement in-place sparse solvers on GPU with QR and Cholesky. They also have a eigenvalue solver. These are called csrlsvqr!, csrlsvchol! and csreigvsi respectively.

They seem to have sparse factorization support but I'm not sure how to use those to solve.

Link here: https://github.com/JuliaGPU/CUDA.jl/blob/master/lib/cusolver/sparse.jl#L101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants