Registered Member
|
According to benchmark, eigen is much better than atlas on M * M. However, I tested on some PCs (core duo/core2 quad), eigen 2.0.10/atlas 3.8, single thread.
The results showed M(1500,1500)*N(1500,1500) cost more or less the time on eigen and atlas. Actually, atlas was a little faster. I also compared matrix element accessing of ublas and eigen dynamic matrices. They are almost the same. Did I missing any optimizations? Here are my sample codes and Makefile
|
Registered Member
|
According to our benchmark (matrix-matrix product) we're 20% faster. If you only get roughly the same speedm that could be:
* either because your ATLAS is better tuned for your CPU cache size than Eigen is by default. With EIGEN, you can currently control that by #defines, grep for CACHE in Core/util/Macros.h * or that could be a difference between your setup and Gael's when he made the benchmark. That benchmark was on x86-64, with GCC 4.4.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Thanks for your expiation.
Following the suggestion, I enlarged CACHE macro, but it did not help. I did experiment on both i686 and x86_64 with gcc 4.4. Perhaps, the reason is that atlas was better tuned and fitted my machines better. |
Registered Member
|
Also, the benchmark was with the development branch, which now is much faster than 2.0, and already at that time (March 2009) was a bit faster than 2.0.
The CACHE macro is currently named: EIGEN_TUNE_FOR_CPU_CACHE_SIZE. Its default value is 4*256*256.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Regarding the elementwise access you should take a look at the Eigen functions coeff and coeffRef - they are not error-guided (asserts etc.) and faster.
|
Registered Member
|
Btw, what about performance in comparison with MTL library? I can't decide which one to use in performance-critical application with small(<20x20) matrix computation -)
|
Registered Member
|
MTL4 and other libraries where among our old benchmark:
http://eigen.tuxfamily.org/index.php?ti ... August2008 Later benchmark only show the high-performance libraries. But this benchmark tests dynamic-sizes only. If your sizes are not only small but known at compile time, a different benchmark is needed. Eigen does very well there too as this is one of our primary areas of interest, but then I don't know about MTL.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
bjacob, thank you for your reply. And is it possible(i'm really sorry, but i haven't read documentation yet;) to use statically-allocated big enough matrix and use its sub-matrix in computations without reallocation and copying? That would'be been a big performance goal, and, what is even more important, possible to use in real-time applications.
e.g. someting like (saw such syntax somewhere):
|
Registered Member
|
Yes, we have a Map mechanism just as you describe, see class Map. But in your case we have something even better, if you just dont know the exact size of a matrix at compile time but know that it will never be bigger than 20x20 and want to avoid dynamic memory allocation, you could do:
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Wow, that's really great! This feature is very important, because dynamic memory allocation at runtime is unacceptable in real-time systems. Thank you very much, bjacob, for your replies and for great job.
|
Moderator
|
regarding Eigen vs MTL4, for your use case, Eigen has a significant advantage which is explicit vectorization.
|
Registered Member
|
ggael, that's not an advantage in my case, because i'm writing fo i486@120Mhz using gcc 2.95 . But I can't compile library yet, some errors always appear. Anyway, I'm still trying, because eigen looks really great and perfectly suits my purpose.
|
Registered Member
|
We don't claim to support gcc 2.95.
The oldest gcc that we support is gcc 3.3 in Eigen 2.0. It might become gcc 3.4 in the default branch, if gcc 3.3 poses too many problems. Notice that with such old GCC, even if you could compile, the resulting code would still be of very poor quality ---> slow and bloated. If you want high performance, use GCC >= 4.2. It is perfectly able to generate code for your 486. You don't have to run it _on_ the 486.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]