This forum has been archived. All content is frozen. Please use KDE Discuss instead.

AVX Vectorization Support on Eigen3?

Tags: None
(comma "," separated)
avastration
Registered Member
Posts
2
Karma
0
First of,

Congratulations on the new, highly anticipated release, eigen3!!!

I have already tried it on 2 of my projects that heavily used eigen2 for the computational part and witnessed noticable performance improvements!

One question though, I really thought that eigen3 would come with built in support for the new AVX vectorization instruction set from Intel... Correct me if I'm wrong but after a brief investigation of Eigen/Core I see no conditioning over AVX, just conditioning for SSE, SSE2,3,4 etc.

Does that mean that eigen3 does not fully support AVX and falls back to SSE4 for the new processors? And if yes, are there any plans to fully exploit it in future releases?

Again, great work from everyone!!! Glad to see that in the new benchmarks, eigen3 is on par with proprietary libs like Intel's MKL, performance wise!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
hi,

AVX support has never been planed for the 3.0 release, but yes this is a planed feature! The only difficult part is to enable AVX without loosing SSE: for instance, for 4x4 matrix products of floats, AVX is useless, and we have to fallback to SSE. So the basic idea is to add support multiple packet sizes for a given scalar type. Then, implementing a AVX backend should be quite easy.
User avatar
benoitsteiner
Registered Member
Posts
13
Karma
0
avastration,

I am currently working on adding support for AVX and FMA instructions to Eigen. I am finalizing a mercurial branch, can you give it a try and let me know if it works for you?

NB: the code currently requires gcc 4.8, earlier versions don't compile the code. I am hoping to fix this shortly.

Benoit


brebs
Registered Member
Posts
3
Karma
0
Now that AVX support has been merged into master (not released yet), what are the implications? I'm a bit fuzzy about how SSE and AVX are used in Eigen. Does it mean that on a modern machine with AVX support, most of eigen operations (matrix multiplications, additions, dot products, etc.) will be twice faster (compared to SSE)?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
If your vectors and matrices and large enough, then yes, a x2 speedup has been observed. Recall that you need to activate avx on your compiler, for instance with -mavx with gcc/clang/icpc.
ansar
Registered Member
Posts
15
Karma
0
I am interested in using AVX2 with Eigen. Is this now stable? What branch should I checkout to use avx please.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
You still need to use the default branch: http://bitbucket.org/eigen/eigen/get/default.tar.gz


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar