News for hackers. Stuff that matters.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bayindirh on Wednesday April 24, 2024 @10:03AM (#40144543)
Why Eigen is not run in parallel mode w/ Open-MP?

Eigen handle most (if not all, I just skimmed the tables) tasks in parallel [0]. Plus, it has hand-tuned SIMD code inside, so it needs "-march=native -mtune=native -O3" to make it "full send".

Some solvers' speed change more than 3x with "-O3", to begin with.

This is the Eigen benchmark file [1].

[0]: https://eigen.tuxfamily.org/dox/TopicMultiThreading.html

[1]: https://github.com/sarah-ek/faer-rs/blob/main/faer-bench/eig...

Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sarah-ek on Wednesday April 24, 2024 @10:08AM (#40144588)
author here, eigen is compiled with -fopenmp, which enables parallelism by default
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bayindirh on Wednesday April 24, 2024 @10:10AM (#40144604)
Hi! Thanks for chiming in!

Did you check with resource utilization? If you don't provide "OMP_NUM_THREADS=n", Eigen doesn't auto-parallelize by default.

Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sarah-ek on Wednesday April 24, 2024 @10:11AM (#40144609)
i did check, yes
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by dannyz on Wednesday April 24, 2024 @10:15AM (#40144648)
Related on the Eigen benchmarking, I see a lot of use of auto in the benchmarks. Eigen does not recommend using it like this (https://eigen.tuxfamily.org/dox/TopicPitfalls.html) because the template expressions can be quite complicated. I'm not sure if it matters here or not, but it would probably better not to use it in the benchmarks.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sarah-ek on Wednesday April 24, 2024 @10:16AM (#40144660)
i've contributed to eigen in the past and know enough about the internals of the codebase to know my way around safe `auto` usage
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by dannyz on Wednesday April 24, 2024 @10:21AM (#40144712)
I wasn't worried about safe usage, more that some of the initialization may be moved inside the benchmarking function instead of outside of it like intended. I'm sure you know more about it than me though.
Re:Faer-rs: Linear algebra foundation for the Rust programmi... by bayindirh on Wednesday April 24, 2024 @10:25AM (#40144761)
While auto is a compile time burden, it creates a lot of load during compilation of this benchmark.

My complete Ph.D., using ton of Eigen components plus other libraries was compiling in 10 seconds flat on a way older computer. This requires gigs of RAM plus a minute.

Re:Faer-rs: Linear algebra foundation for the Rust programmi... by sarah-ek on Wednesday April 24, 2024 @10:28AM (#40144809)
the long compile times are mostly because im instantiating every dense decomposition in the library in one translation unit, for several data types (f32, f64, f128, c32, c64, c128)