Re: [eigen] Calls to copyPacketByOuterInner: when do they happen?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 25.11.2013 18:54, Gael Guennebaud wrote:
> Hi,
> 
> I'm surprised that this function (copyPacketByOuterInner) shows up in
> the profiling results. This is a trivial function that should be inlined
> and not visible from the profiler. Which compiler and version have you
> tried? You might try with two different compilers like g++ and clang/llvm.
> 
> gael

No it is exactly the same setup/machine/compiler. But as I said it is a
sample based profiler and I guess they are a bit trickier to interpret.
copyPacketByOuterInner definitely was not the problem.

I actually managed to fix it: turns out that in the newer version I
ommitted to properly set the vector v_J that was then used later in the
code using undefined values.

Could it be that uninitialized values have a negative impact on Eigen's
performance?

Cheers,
Martin

> 
> 
> On Mon, Nov 25, 2013 at 6:23 PM, Martin Felis
> <martin.felis@xxxxxxxxxxxxxxxxxxxxx
> <mailto:martin.felis@xxxxxxxxxxxxxxxxxxxxx>> wrote:
> 
>     On 25.11.2013 17:32, Christoph Hertzberg wrote:
>     > On 25.11.2013 16:25, Martin Felis wrote:
>     >>
> 
>     > Does it need 20% more time per call or is it called 20% more often?
>     > Neither of that would account for a performance decrease by 50%.
> 
>     It's a bit tricky to say as it's a sampling based profiler, however I
>     have used 2 million function calls for each method (corresponding do
>     ~2200/~3800 samples) so I guess it should correspond to the amount of
>     time spent in this function.
> 
>     > I doubt that you want to "avoid" calling copyPacketByOuterInner, since
>     > it is usually the fastest method of copying/evaluating.
>     > I guess the problem is rather that you do some extra computations in
>     > some cases.
> 
>     Okay, thanks!
> 
>     > I don't really understand what's the purpose of
>     > #ifdef EIGEN_CORE_H
>     > in your code. This will always be true if you have Eigen included
>     -- or
>     > does your code run with alternate matrix libraries? Do you need the
>     > .eval() where they are used? Unnecessary evals could account for some
>     > unnecessary copy operations.
> 
>     You are referring to the function ForwardDynamics() that is slower, too,
>     but wanted to analyse the simpler InverseDynamics() first.
> 
>     And yes I am using another library (SimpleMath) that is compatible to
>     Eigen for my use but compiles considerably faster. I mainly use it
>     during development. The profiling was however done using Eigen3 3.0.5
>     provided by Ubuntu 12.04.
> 
>     Other than that the .eval() call is required. At least otherwise I get a
>     compile error.
> 
>     > Could you link to a diff between the two versions which you profiled?
>     > Maybe something obvious pops out.
> 
>     I have attached the profiling outputs. Any comments highly welcome.
> 
>     > Finally, I'm sorry for asking the obvious question:
>     > Do you compile with optimization enabled (Release or RelWithDebug mode
>     > in cmake)? Otherwise Eigen spends a lot of time in methods that should
>     > be completely unrolled and inlined.
> 
>     Absolutely a valid question! Everything is done in Release mode (-O3
>     -DNDEBUG).
> 
>     Cheers,
>     Martin
> 
>     --
>     mail  : martin.felis@xxxxxxxxxxxxxxxxxxxxx
>     <mailto:martin.felis@xxxxxxxxxxxxxxxxxxxxx>
>     phone : +49 6221 544983 <tel:%2B49%206221%20544983>
>     office: IWR | Speyerer Str 6 | Room 319 | 69115 Heidelberg | Germany
> 
> 


-- 
mail  : martin.felis@xxxxxxxxxxxxxxxxxxxxx
phone : +49 6221 544983
office: IWR | Speyerer Str 6 | Room 319 | 69115 Heidelberg | Germany



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/