-
-
Couldn't load subscription status.
- Fork 5.7k
[WIP] add logabsdet(::UmfpackLU) method #38476
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
[WIP] add logabsdet(::UmfpackLU) method #38476
Conversation
|
@ElOceanografo Maybe address the comments and get this merged? |
|
Sorry, lost track of this! Comments were straightforward, but this is still very slow. Benchmarking on my computer produces the following timings: using LinearAlgebra, SparseArrays, BenchmarkTools
n = 2000
pnz = 0.01
A = sprandn(n, n, pnz); A = A'A + I
Adense = Matrix(A)
F = lu(A)
Fdense = lu(Adense)
@btime logabsdet($A) # 549.719 ms (91 allocations: 278.57 MiB)
@btime logabsdet($F) # 79.753 ms (25 allocations: 86.26 MiB)
@btime logabsdet($Adense) # 46.192 ms (3 allocations: 30.53 MiB)
@btime logabsdet($Fdense) # 20.099 μs (0 allocations: 0 bytes)Profiling shows most of the time in the first benchmark is spent here, while most of the time in the second benchmark is spent extracting the fields from the LU factorization in this line. I know next to nothing about the internals of SuiteSparse, maybe someone who does can chime in? Using the sparse factorization should in principle be faster than converting to a dense matrix and falling back on the default method, right? Edit: added timing for |
|
The problem with testing on random sparse matrices is that the LU factorization gets a lot of fill-in, making it almost dense. In this case, the filled up factors end up having 50% nonzeros. In reality, most sparse problems coming from a real application have more structure and significantly less fill-in. |
|
At scale, the |
|
Probably also rebase to master. |
|
Running the same benchmark with |
|
That will have to be in the UmfpackLU documentation or maybe even the Umfpack source code. I had trouble compiling this PR (following the gh command line) instructions and did end up rebasing it to master. Trying to get it working so I can try a few examples myself. |
|
I did some digging in the Umfpack documentation, and it should be possible to extract just the |
* deps: upgrade CSL This adds the `.so` files, particularly for libatomic that we need on FreeBSD * build: define uninstall targets even for deps that are not always installed Most commonly csl, llvm-tools, and clang, but there were other ones in the wrong lists also.
This adds a convenience method to be able to essentially wrap an arbitrary task in a try/catch/log block conveniently.
Fixes JuliaLang#40303. When printing values to fixed widths through the `Ryu.writefixed` or `Ryu.writeexp` routines, we have a "cleanup" section after a value has been printed to see if it needs to be rounded given the input precision and width. The core issue was the terminating condition: it previously only checked if we were at the start of a buffer or had encountered the `'-'` character. Via Printf formatting, however, it also allows specifying the `'+'` and `' '` characters to preceed a formatted number. Hence, in the OP, the `'1'` character was getting "rounded" up to the `','` character. The fix here is correctly checking if the `plus` or `space` options were passed to the routine and if so, include those in our rounding termination check. The original issue only reported the "plus" case for the `f` format specifier, but the same bug affects the `e` format specifier and the "space" option.
Inspired by JuliaLang#35710 Co-authored-by: Stephan Hilb <[email protected]>
JuliaLang#39999) * reduced_index for BigInt UnitRanges * Add tests for Integer subtypes * use OneTo constructor instead of typeof Co-authored-by: Simeon Schaub <[email protected]> Co-authored-by: Simeon Schaub <[email protected]>
* Make opnorm( 1x0 matrix ) zero Fixes #40370. * more opnorm tests * remove convert on svdvals Co-authored-by: Daniel Karrasch <[email protected]>
…ng#39481) Co-authored-by: Jameson Nash <[email protected]>
Co-authored-by: Sebastian Stock <[email protected]>
Co-authored-by: akaysh <[email protected]> Co-authored-by: Sacha Verweij <[email protected]> Co-authored-by: akaysh <[email protected]> Co-authored-by: Sacha Verweij <[email protected]>
…s`, `Base.preferences_names`, and `Artifacts.artifact_names` always have the same length (JuliaLang#40618) * Add tests to make sure that `Base.project_names`, `Base.manifest_names`, `Base.preferences_names`, and `Artifacts.artifact_names` always have the same length * Add a comment explaining why we have these tests
Co-authored-by: Simeon Schaub <[email protected]>
…40684) Co-authored-by: Dilum Aluthge <[email protected]>
…evant information) (JuliaLang#40663)
* update all checksums and pcre rules to generate them Co-authored-by: Jameson Nash <[email protected]>
…40687) Co-authored-by: Dilum Aluthge <[email protected]>
using new efficient method from JuliaLang#40663
…ulia into sparse_logabsdet
|
Something has gone wrong with this PR. |
|
I tried to rebase it to master last night and may have messed it up. I can try to fix it, or if it's easier I could close it and open a new one with the same changes... |
|
If its easier to do a new PR, just go for it. |
|
Ok, closing this, will open a new one in a second. |
Will fix JuliaLang/LinearAlgebra.jl#788. This new method is a direct translation of the dense
logabsdet(::LU)method in LinearAlgebra:julia/stdlib/LinearAlgebra/src/lu.jl
Line 457 in 3365b4e
It produces the correct answers, but is relatively slow and needs work on optimization. The main bottleneck is extracting the factors via
umf_extract, so directly indexing into theUmfpackLUstruct should speed it up...though I'm not sure how to do that.