Re: [eigen] Different computation time when using Eige
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] Different computation time when using Eige
• From: tuch s <tuchfly@xxxxxxxxx>
• Date: Mon, 27 Jun 2016 18:15:51 +0800
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=GJ5jZ/mjqpU4h8s8JoycWoNhrTsWfXZmA7betmV/NQE=; b=ExwW0NmxA30SQqIUEzLPfP/FCjZkiU78cJkszvioyaF3m3SRubUyecE+ThnCTIfZCN FvxeOxn7Y9o/olnMRQnG3qp6pqaXj8g6sdTm8AmtnOWQ5I90f73m4mhIhFSdpAXyY2SO G8X0ZsMfhsQdyZZLM/3KrOxg9EU+e2Xfzzy9EjAh3xf/J1DiZBYgsFh/XhH77bO9kXDr myjOmDDZzzsKlFNGBheTpTn0DEskNNVFUQ26LKL761by6R5edEtdWIpGHwkVcqG4pCVZ fyVIsE0KK4ck3n3IdfdoXgrkY6zVQTtahsxXenklDG20urWRGBnj0JvU6QAMYr9SYRJ1 kLgw==

The input data and output date are the same, but the running time is much different, some times very fast, some times much slower.

The matrix is 128*1024, and the vector is 1024, I didn't know why the running time is so much different.

0.4 second and 2.1 second is just an example, maybe this time I can get the output using just 0.4 second, and the next time 1.9 second, or 2.1 second or some other value.

On Mon, Jun 27, 2016 at 5:54 PM, Christoph Hertzberg wrote:
Hi!

I'd need a bit more details to get any idea what is happening. E.g.:
Are the matrix sizes the same all the time (and how big are they)?
Does cur->i = this->bi involve resizing/memory allocation?
Is 0.4--2.1 seconds the time for all for computations or for each (or for multiple times)?
What Eigen version are you running?

The easiest way for us would be, if you could produce a minimal working example which exposes the problem.

Cheers,
Christoph

On 2016-06-27 11:37, tuch s wrote:
I have used eigen to do the following computation in a deep learning
programme，
Code: Select all
<https://forum.kde.org/viewtopic.php?f=74&t=133580&p=359022#>  cur->i =
this->bi;
cur->i.noalias() += this->Wxi*xt + this->Whi*prev->h;
cur->f = this->bf;
cur->f.noalias() += this->Wxf*xt + this->Whf*prev->h;
cur->o = this->bo;
cur->o.noalias() += this->Wxo*xt + this->Who*prev->h;
cur->u = this->bu;
cur->u.noalias() += this->Wxu*xt + this->Whu*prev->h;

W* is a matrix, and h, f, i, o, u are all vectors.

But I tried several times with the same input data， the time consuming is
much different.
Some times it costs 0.4 second to get the output, but some times it cost
2.1 second to get the output.

How can I solve this problem to get stable time cost ?

--
Dipl. Inf., Dipl. Math. Christoph Hertzberg

Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 1
28359 Bremen, Germany

Zentrale: +49 421 178 45-6611

Robert-Hooke-Straße 5
28359 Bremen, Germany

Tel.:    +49 421 178 45-4021
Empfang: +49 421 178 45-6600
Fax:     +49 421 178 45-4150
E-Mail:  chtz@xxxxxxxxxxxxxxxxxxxxxxxx

Weitere Informationen: http://www.informatik.uni-bremen.de/robotik

• Follow-Ups:

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