-
Notifications
You must be signed in to change notification settings - Fork 15
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
Replace ColPack with SparseMatrixColorings? #237
Comments
It's fine to add SparseMatrixColorings here Guillaume but it will be great to have benchmarks if we replace colpack.jl. |
I'd love to benchmark against ColPack.jl but I need an answer to exanauts/ColPack.jl#12, otherwise I don't even know where to start. To support both coloring options, the right way would be to switch to the ADTypes coloring interface. It is implemented by SparseMatrixColorings.jl, and I can easily add it to ColPack.jl once I figure out the issue above. As an example, PR #238 does something similar (switch from specific package to generic interface) with sparsity detection. |
@michel2323 We need you! |
I think I found the answer: exanauts/ColPack.jl#12 (comment) Bipartite coloring is not supported by ColPack.jl, even though it is the most efficient graph representation of Jacobian coloring problems. So I'll only be able to benchmark on Hessian coloring problems, which are symmetric. Let's see what that turns up |
Here are some benchmarks. In the range of parameters I've tested, SMC is uniformly better than ColPack.jl (but not necessarily better than ColPack itself). Full benchmark code here for @michel2323 to check: https://gdalle.github.io/MatrixColoringComparison/ For the Jacobian benchmarks, the insane speedup is probably due to the construction of a column adjacency grah instead of the natural row-column bipartite graph. It's bad because the adjacency graph is much denser than the bipartite graph. ColPack itself (in C++) can work directly with bipartite graphs, so it's just a question of interfaces. Line 527 in 15d897d
|
Of course there's also the fact that ColPack (the C++ library) has had zero activity for the past 5 years, and that I trust pure readable Julia code a bit more than undertested C++ bindings (even though they get the job done and I'm grateful for them). |
With our latest changes in exanauts/ColPack.jl#20, here's what I get for the partial column coloring of random sparse matrices (the star coloring plot stayed the same). Note that this comparison is done with the natural order on vertices. ColPack is still better than SMC for custom orders (it has more of them and probably will compute them faster even once gdalle/SparseMatrixColorings.jl#18 is merged). |
Hi there @amontoison and friends! It's me again, and I come bearing gifts 😎
My new package SparseMatrixColorings.jl aims to be a pure-Julia reimplementation of ColPack. It does not yet have every functionality, but it has the essentials. In addition, it offers decompression algorithms, and the test suite is outrageously thorough. Would you be interested in trying it out as a replacement for ColPack.jl?
I haven't yet run benchmarks because there are some things I don't understand about the ColPack.jl interface (see exanauts/ColPack.jl#12 if @michel2323 wants to help), but I expect performance to be rather good.
As an alternative, we could try a full integration with DifferentiationInterface.jl as discussed in #229, but that might be a lot of change at once.
The text was updated successfully, but these errors were encountered: