[ADOL-C] Performance dilemma

Kshitij Kulshreshtha kshitij at math.upb.de
Mon Oct 7 11:57:45 EDT 2013

```Hello Antoine,

The cost of retaping a small function is much less than propagating
thousands of useless partial derivatives.

Best.
Kshitij

As on 2013-10-07 17:20h, Antoine De Blois did write:
> Hello Kshitij,
>
> But this would involve re-taping all the time right? I only added S's and V's as independent to avoid re-taping. For my application, this means re-taping 10 thousands of times... If I don't re-tape, there is no way ADOL-C will see the new S and V?
>
> Are you saying that the cost of re-taping does not compensate for the added independents?
>
> Antoine
>
> -----Message d'origine-----
> De : Kshitij Kulshreshtha [mailto:kshitij at math.upb.de]
> Envoyé : Monday, October 07, 2013 10:43 AM
> À : Antoine De Blois
> Cc : adol-c at list.coin-or.org
> Objet : Re: [ADOL-C] Performance dilemma
>
> Hello Antoine,
>
> you have F(W, V(X,Y,Z), S(X,Y,Z)) and you only requier dF/dW then you don't require X,Y,Z and S,V as adouble variables at all. They should simply be double variables. W is the only adouble independent and F is the dependent. Then you should simply treat all the other things as constants which have been precomputed for each situation. You create a trace for F(W) in each stencil with the correct constants S,V and then directly call reverse()/gradient()/jacobian() for the derivative. Then you recreate a trace for then next stencil. This should infact be the most efficient thing as then the derivative computation will not need to propagate partial derivatives with respect to all the other variables (which you don't need).
>
> Best.
> Kshitij.
>
> As on 2013-10-07 16:31h, Antoine De Blois did write:
>> Hi Kshitij,
>>
>> Thank you for your fast response.
>>
>> In fact, I do not need any of the surface nor volume derivative. I have F=F(W, S, V) but I only need dF/dW (one could say, strictly speaking (F=F(W,X, Y, Z)). I need to compute dF/dW many times for different W, S and V.
>>
>> My question was more related to performance trade-off.
>>
>> But using the coordinates directly, I will have less independent
>> variables: W(n), X(n), Y(n), Z(n), giving  4n independent variables,
>> but more computation between trace_on and trace_off (essentially
>> repeating the surface and volume computation done globally) But using
>> the second option, I have more independent variables: W(n), S(n),
>> Vi(n), Vj(n), Vk(n), giving 5n independents, but less computations
>> (since all S's and V's are pre-computed anyway globally)
>>
>> Please let me know if you want more information.
>> Regards,
>> Antoine
>>
>> -----Message d'origine-----
>> De : adol-c-bounces at list.coin-or.org
>> [mailto:adol-c-bounces at list.coin-or.org] De la part de Kshitij
>> Kulshreshtha Envoyé : Monday, October 07, 2013 9:51 AM À :
>> adol-c at list.coin-or.org Objet : Re: [ADOL-C] Performance dilemma
>>
>> Hello,
>>
>> in such a case you should ask yourself which derivatives do you really require? Do you require the derivatives of some function computed on the stencil w.r.t. the areas and the volumes, or do you require the derivatives of the function on the stencil w.r.t. the coordinates of the stencil?
>>
>> In the first case you only need to do variant 2 on each stencil (depending on the case) this computation requires only tracing for one stencil and then can be repeated for all others. You will get per-stencil derivatives.
>>
>> In the second case you can break the trace into two parts, one that computes S and V from X,Y,Z globally. And another that does variant 2.
>> You will get two separate derivatives. One per-stencil as before and the second global. Then you need to multiply the corresponding stencil derivatives with the global ones to get the derivatives w.r.t. coordinates.
>>
>> So the real question is which derivatives do you need?
>>
>> Best
>> Kshitij.
>>
>> As on 2013-10-07 15:37h, Antoine De Blois did write:
>>> Hi Everyone,
>>>
>>>
>>>
>>> I would like to know which of the 2 following options is
>>> computationally better. My current version of the code involves
>>> surface areas as independent variables. I now have to add the volumes
>>> to the independent variable, which leads to a dilemma for my
>>> implementation. In my application, surfaces and volumes are
>>> pre-computed on the entire computational domain. However, I perform
>>> automatic differentiation on a smaller stencil. The only thing to
>>> remember for you is that the surfaces and volumes are already pre-computed on the entire grid.
>>>
>>>
>>>
>>> Since the surfaces and volumes are in fact dependent on the
>>> coordinates S=S(X,Y,Z), V=V(X,Y,Z), should I:
>>>
>>>
>>>
>>> 1.       Use the coordinates as independent variables (Xa << X; Ya << Y;
>>> Za <<Z;) and then compute the surfaces and volumes as active arrays
>>>
>>> 2.       Use the surfaces and volumes as independent variables (Sa <<S;
>>> Va <<V;), yielding more independent variables, but less computation
>>> between the trace_on and trace_off.
>>>
>>>
>>>
>>> I already asked what was the biggest contributing factor for
>>> efficient process was the amount of computation between the trace_on
>>> and trace_off, and not the amount of indendent variables. This would
>>> lead to option 2, right, especially that the volumes calculation
>>> involves tests at the boundaries.
>>>
>>>
>>>
>>> Thank you for your time,
>>>
>>> Cheers,
>>>
>>> Antoine
>>>
>>>
>>>
>>>
>>>
>>> *Antoine DeBlois*
>>> Specialiste ingenierie, MDO lead / Engineering Specialist, MDO lead
>>> Aéronautique / Aerospace
>>>
>>> T    514-855-5001, x 50862
>>>
>>> antoine.deblois at aero.bombardier.com
>>> <mailto:antoine.deblois at aero.bombardier.com>
>>>
>>> /2351 Blvd Alfred-Nobel/
>>> /Montreal, Qc/
>>>
>>> /H4S 1A9/
>>>
>>> Description :
>>> http://signatures.ca.aero.bombardier.net/eom_logo_164x39_fr.jpg
>>>
>>> *CONFIDENTIALITY NOTICE*- This communication may contain privileged
>>> or confidential information.
>>> If you are not the intended recipient or received this communication
>>> by error, please notify the sender and delete the message without
>>> copying
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> ADOL-C mailing list
>>> ADOL-C at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/adol-c
>>>
>>
>> --
>> Dr. Kshitij Kulshreshtha
>>
>> Institut für Mathematik,
>> Universität Paderborn,
>> Warburger Straße 100,
>> 33098 Paderborn.
>>
>> Büro: A3.235
>>
>> Privatanschrift:
>> Arnikaweg 62
>> 33100 Paderborn.
>> _______________________________________________
>> ADOL-C mailing list
>> ADOL-C at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/adol-c
>>
>
> --
> Dr. Kshitij Kulshreshtha
>
> Institut für Mathematik,
> Universität Paderborn,
> Warburger Straße 100,
> 33098 Paderborn.
>
> Büro: A3.235
>
> Privatanschrift:
> Arnikaweg 62
> 33100 Paderborn.
>

--
Dr. Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.235

Privatanschrift:
Arnikaweg 62
33100 Paderborn.
```

More information about the ADOL-C mailing list