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

Stability of Eigen Vectorization

Tags: None
(comma "," separated)
Hedes
Registered Member
Posts
3
Karma
0

Stability of Eigen Vectorization

Thu Feb 04, 2016 3:55 pm
Hi,
How stable are the Eigen Results in terms of repeatability? Does vectorization of the code changes results between different runs, versions?
Thanks
S
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Vectorization essentially affects the result of reductions, and consequently the result of any operations involving reductions (e.g., dot product, matrix products, etc.). So depending on the compilation flags and eigen versions, results might slightly vary because of the non associativity of floating point arithmetic.
Hedes
Registered Member
Posts
3
Karma
0
ggael wrote:Vectorization essentially affects the result of reductions, and consequently the result of any operations involving reductions (e.g., dot product, matrix products, etc.). So depending on the compilation flags and eigen versions, results might slightly vary because of the non associativity of floating point arithmetic.


But does this mean that two different runs of the same algorithm (both with vectorization on) can yield different results? If not, then what about machines with different architectures (with similar precision)?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Two runs of the same binary code on the same computer will produce the same result, but if you change the version of Eigen, or some compilation flags (vectorization, multi-threading), or change the processor (different number of cores with multi-threading enabled, different size of cache), then you might get very slightly different results up to rounding errors.

Note that the same remarks apply to any optimized BLAS library.
Hedes
Registered Member
Posts
3
Karma
0
ggael wrote:Two runs of the same binary code on the same computer will produce the same result, but if you change the version of Eigen, or some compilation flags (vectorization, multi-threading), or change the processor (different number of cores with multi-threading enabled, different size of cache), then you might get very slightly different results up to rounding errors.

Note that the same remarks apply to any optimized BLAS library.


ggael, Do you mean this happens irrespective of vectorization ON or OFF?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
yes, for instance, if you do a scalar product between two vectors a and b, (i.e., sum_i a_i * b_i) we do not specify in which order the sums are carried out, and since (x+y)+z is not equal to x+(y+z) the results might be slightly differ. Again, that's not specific to Eigen and apply to any BLAS library.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft