Post

Replies

Boosts

Views

Activity

Reply to Apple Accelerate libSparse performance
Here's the file with the API calls. I have to provide the correct symbol, not the function name, so it's a bit hard to read: e.g. you'll see _Z12SparseFactorh18SparseMatrix_Float instead of SparseFactor. I imagine you probably have Apple internal tools to deal with that...but if you don't, here's the mangled-demangled pairs. mangledDemangledPairs.txt All the relevant components can be found in that same GitHub repo, in the src/libSparse folder of the libSparse branch of AppleAccelerate.jl.
Jan ’25
Reply to compute Eigenvalues/EigenVector
There's a very similar question on SO. If your matrix is symmetric, then following approach will work: SparseFactor the matrix with the LDL^T factorization Use SparseCreateSubfactor to get an SparseOpaqueSubfactor objects representing D and L SparseMultiply those objects by the identity matrix to get D and L and as dense matrices. You can read off your eigenvalue/vector pairs from that. If the matrix isn't symmetric, then...there might be a way to use the QR factorization to indirectly say something about the eigenvalues. But the QR factorization doesn't tell you the eigenvalues straight-up.
Jan ’25
Reply to C++ API for Accelerate Framework (SparseSolve)
Hi, I am a Julia/C++ developper and a total novice with apple ecosystem. I look for examples and documentation about the SparseSolve C++ API from the Accelerate framework. I find myself in a very similar boat: I'm working on making an interface for libSparse in AppleAccelerate.jl I've managed to call SparseSolve and SparseFactor from Julia with @ccall, but I'm finding the performance puzzling. When it comes to solving Ax = b in-place (b is a vector) for large symmetric positive definite A, I find that KLU.jl's KLU.solve! (LU factorization) is 2x faster than Apple Accelerate's SparseSolve (Cholesky factorization). That's highly counter intuitive: you'd think that a hardware-specific implementation that exploits the positive-definite nature of the matrix would be faster. When I profile repeated calls to SparseSolve, I get the most called functions are _SparseConvertFromCoordinate_Double followed by BLASStateRelease. (The later ones are more reasonable, LAPACK/CBLAS stuff like dgemm, ssyrk.) I may post a separate question with more detail, but this post is so close to my own question.
Jan ’25