News for hackers. Stuff that matters.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by heinrichhartman on Wednesday April 24, 2024 @11:04AM (#40145220)
This does not seem to depend on BLAS/LAPACK.

Good to see LU decomposition with full pivoting being implemented here (which is missing from BLAS/LAPACK). This gives a fast, numerically stable way to compute the rank of a matrix (with a basis of the kernel and image spaces). Details: https://www.heinrichhartmann.com/posts/2021-03-08-rank-decom....

Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sarah-ek on Wednesday April 24, 2024 @11:05AM (#40145235)
lapack does expose a full pivoting lu as far as i can tell? https://netlib.org/lapack/explore-html/d8/d4d/group__getc2_g...
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bee_rider on Wednesday April 24, 2024 @11:24AM (#40145491)
If you are going to include vs MKL benchmarks in your repo, full pivoting LU might be one to consider. I think most people are happy with partial pivoting, so I sorta suspect Intel hasn’t heavily tuned their implementation, might be room to beat up on the king of the hill, haha.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sarah-ek on Wednesday April 24, 2024 @11:34AM (#40145634)
funny you mention that, the full pivoting. it's one of the few benchmarks where faer wins by a huge margin

n faer mkl openblas

1024 27.06 ms 186.33 ms 793.26 ms

1536 73.57 ms 605.71 ms 2.65 s

2048 280.74 ms 1.53 s 8.99 s

2560 867.15 ms 3.31 s 17.06 s

3072 1.87 s 6.13 s 55.21 s

3584 3.42 s 10.18 s 71.56 s

4096 6.11 s 15.70 s 168.88 s

Re:Faer-rs: Linear algebra foundation for the Rust programmi... by adgjlsfhk1 on Wednesday April 24, 2024 @12:11PM (#40146114)
it might be interesting to add butterfly lu https://arxiv.org/abs/1901.11371. it's a way of doing a numerically stable lu like factorization without any pivoting, which allows it to parallelize better.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bee_rider on Wednesday April 24, 2024 @12:30PM (#40146414)
It looks like they are describing a preconditioner there.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by adgjlsfhk1 on Wednesday April 24, 2024 @01:00PM (#40146939)
the key point is that the preconditioner allows you to skip pivoting which is really nice because the pivoting introduces a lot of data dependence.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sarah-ek on Wednesday April 24, 2024 @12:19PM (#40146239)
looks interesting! thanks for sharing
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by heinrichhartman on Wednesday April 24, 2024 @01:50PM (#40147535)
Thanks for pointing this out. Looks like only the python bindings are not included in nunpy.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bmitc on Wednesday April 24, 2024 @03:48PM (#40148745)
Is there a collection of algorithms published somewhere, in a coherent manner? It seems like to me, there should be a collection of matrix algebra, symbolic algebra, etc. algorithms somewhere that makes it easy to implement these in any language or system. As it is, it seems you need to already be an expert or researcher in the space to make any movement.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by rvdca on Wednesday April 24, 2024 @04:13PM (#40149007)
One could argue that libraries like BLAS/LAPACK are those collections...
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bmitc on Wednesday April 24, 2024 @04:31PM (#40149214)
That can be argued, but they're pretty esoteric. For example, what language are they written in? Fortran, assembly, etc.? Probably nothing the majority of developers or mathematicians can't understand. And creating bindings for them is non-trivial. I don't even know where to start from the website. And on the website, all the links to the routines are broken. https://www.netlib.org/blas/
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by 1980phipsi on Thursday April 25, 2024 @03:36PM (#40162021)
The naming convention is a bit esoteric, but once you figure it out it's not too bad. I don't think writing bindings is too hard once you know what's going on. You most likely would want to write some kind of wrapper on top of that in order to make things a little more user-friend.

I will agree with you on the routines being broken. That happened within the past year. Not sure why it happened, but it's annoying. If you know the name of the routine you can usually find documentation on another site.

Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sevagh on Wednesday April 24, 2024 @05:53PM (#40150190)
BLIS is an interesting new direction in that regard: https://github.com/flame/blis

>The BLAS-like Library Instantiation Software (BLIS) framework is a new infrastructure for rapidly instantiating Basic Linear Algebra Subprograms (BLAS) functionality. Its fundamental innovation is that virtually all computation within level-2 (matrix-vector) and level-3 (matrix-matrix) BLAS operations can be expressed and optimized in terms of very simple kernels.

Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bmitc on Thursday April 25, 2024 @12:06PM (#40159253)
Interesting. Thanks for the heads up!
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sevagh on Wednesday April 24, 2024 @05:51PM (#40150171)
On the contrary, it seemingly can be used to make a BLAS implementation (example in a PR: https://github.com/sarah-ek/faer-rs/pull/37)