Comments (26)
Pinging @ettersi to see this discussion as well.
Happy to help, but I still feel like I don't understand the build process and the various constraints well enough to get very far on my own. So for the time being, I think the best I can do is to just follow along in the various conversations until things start to click.
from sparsearrays.jl.
The next step is to take the output in the repo posted above (https://github.com/Gnimuc/SuiteSparseGenerator) and update the cholmod wrappers (do they even need updating?) to use them. I don't think any binary building updates are necessary.
@Gnimuc initially we could just manually run clang.jl and check in the results instead of automating.
from sparsearrays.jl.
Probably better in the long run, but requires a complete overhaul of the CHOLMOD module. So I'd say if we do this, then we should be sure that this is truly what we want and take some time to really get it right. In particular, I guess it would make sense to not only update CHOLMOD, but also the UMFPACK and SPQR wrappers?
from sparsearrays.jl.
It is not easy to separate out SuiteSparse.jl into a separate repo - because it is a bit tightly coupled with SparseArrays, which is a bit tightly coupled with LinearAlgebra. So, there's some non-trivial work to separate these out, as I understand it. @KristofferC has perhaps tried it and can say more.
from sparsearrays.jl.
The actual work will have to be carried out in the JuliaPackaging/Yggdrasil
repo, since that's where the wrapper lives nowadays.
from sparsearrays.jl.
As @simonbyrne pointed out on slack, the 32/64 bit stuff is in module init, not the wrapper.
from sparsearrays.jl.
With JuliaInterop/Clang.jl#289, we can do something like https://github.com/Gnimuc/SuiteSparseGenerator. Like _JLL packages, it just generates one binding per platform.
Any thoughts? @ViralBShah, @simonbyrne
from sparsearrays.jl.
I'd love to try it out. We can make it part of the SuiteSparse_jll
build.
from sparsearrays.jl.
We can make it part of the
SuiteSparse_jll
build.
It isn't so easy, we need to run some Julia code at the end of the build which isn't part of the regular BinaryBuilder pipeline.
I find the approach suggested by Jameson much more viable, it should probably work right now, but someone needs to take the time to do it.
from sparsearrays.jl.
If I understand what @Gnimuc has proposed, there is no Julia code that needs to be run. Can't we check this stuff into the SuiteSparse stdlib (I realize it doesn't belong in SuiteSparse_jll), the files in gen/
and config/
both? They can just be regenerated when we bump SuiteSparse. Basically the toml files here include the information that @vtjnash shows how to get programatically
from sparsearrays.jl.
Oh, ok, I thought we'd need to run Clang.jl
at some stage, as it was suggested at some point in JuliaPackaging/BinaryBuilder.jl#673
from sparsearrays.jl.
Pinging @ettersi to see this discussion as well.
from sparsearrays.jl.
To clarify, there is no need to run Clang.jl in the BB environment but we still need to run Clang.jl to generate those bindings on someone's machine(or certain CI environment).
I don't know how those xxx_jll.jl
repos are generated, but I believe they're generated by running some Julia code. I guess we can follow the same way to trigger and run the scripts with Clang.jl.
stdlibs like LibCURL.jl
and Statistics.jl
are developed independently out of the Julia source tree in separated repos. When building Julia, the only thing we need is just downloading. Is this possible to let SuiteSparse do the same?
from sparsearrays.jl.
We do want to separate out suitesparse (and all of linear algebra) into separate repos. See JuliaLang/julia#22698.
from sparsearrays.jl.
update the cholmod wrappers (...) to use them
Functions and types, or just the types? The types are essentially the same, only difference is that the generator hard-codes SuiteSparse_long -> Clong
, and uses Cvoid
instead of nothing
. Reworking the rest of the wrapper to use the automatically generated functions would obviously be something which would take a couple of hours at least.
from sparsearrays.jl.
Yes, I think that is pretty much what needs to be done. Going forward then, we auto-generate the wrappers and just check them into SuiteSparse.jl.
from sparsearrays.jl.
Yes to updating just the types, or also the functions?
from sparsearrays.jl.
Ideally both, so that they are always generated in a consistent way and will be in sync with the generated types. What is your recommendation?
from sparsearrays.jl.
The UMFPACK and SPQR do not use the manually generated C++ wrappers though. So maybe this is a 3 step process, which could be separate PRs:
- Get the types sorted out - which is the thing that keeps changing the most in CHOLMOD.
- Update the CHOLMOD functions next.
- Do the others later.
@Gnimuc would then have to generate the wrappers for the others as well in SuiteSparseGenerator. I suggest we check the generator code into the SuiteSparse stdlib codebase itself with instructions on how to generate the wrappers. This is exactly what we do for Sundials.
from sparsearrays.jl.
@Gnimuc would then have to generate the wrappers for the others as well in SuiteSparseGenerator.
Done!
I suggest we check the generator code into the SuiteSparse stdlib codebase itself with instructions on how to generate the wrappers.
Maybe the first step should be to separate out suitesparse.jl.
from sparsearrays.jl.
Probably better in the long run, but requires a complete overhaul of the CHOLMOD module. So I'd say if we do this, then we should be sure that this is truly what we want and take some time to really get it right. In particular, I guess it would make sense to not only update CHOLMOD, but also the UMFPACK and SPQR wrappers?
Looks like most of the code in the CHOLMOD module are very high level. Maybe they do need to be refactored to some extent, but there should not be too much work to merely replace the old hand-written ccall
s with those thin wrapper functions generated by Clang.jl.
from sparsearrays.jl.
@Gnimuc With your recent PRs, is this something we recently addressed?
from sparsearrays.jl.
The last step would be removing SuiteSparse_wrapper.c
from SuiteSparse_jll
.
from sparsearrays.jl.
Ok - and also from deps
.
from sparsearrays.jl.
Removed the wrapper from the JLL: JuliaPackaging/Yggdrasil#3099
from sparsearrays.jl.
For the context see JuliaSparse/SuiteSparse.jl#2 and JuliaSparse/SuiteSparse.jl#3.
from sparsearrays.jl.
Related Issues (20)
- Loads of warnings about method redefinitions HOT 2
- Wrapper generator needs updating to pick SuiteSparse headers from new location HOT 1
- Single precision support in CHOLMOD HOT 3
- Cholesky F.PtL \ Av where Av is a view does not work HOT 1
- Base.stack is underperforming for SparseArrays HOT 3
- Regression in invalidations caused by SparseArrays HOT 3
- Elementwise multiplication by a view of a dense matrix gives a dense matrix
- `findmin(A; dims=1)` is much slower than manually looping over. HOT 1
- Sparse array of string types HOT 17
- Memory Mapped SparseArrays HOT 3
- Extra allocations when using generalized `mul!` operation
- Attempting to run sparse `qr` produces StackOverflow when run on a sparse matrix of `ForwardDiff.Dual`. HOT 6
- Inconsistent addition between sparse and dense HOT 1
- `ldiv` of `LUFactorization` can throw `SingluarException` HOT 1
- Thread-safe dropstored! HOT 1
- Merge SparseMatricesCSR.jl in HOT 2
- Support zero-based indices HOT 3
- Windows threading tests fail in GitHub Actions CI but pass in Buildkite CI
- Problem when running old benchmarks in Oceananigans HOT 6
- Sparse matrix format interfaces HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparsearrays.jl.