Open auto-differentiation-dev opened 1 year ago
Hi All !
I would just like to enquire if this enhancement has been employed within XAD ? And if so is there an example of this being done in code ?
Looking forward to hearing from you
Kind regards Stephan
Hi Stephan,
This feature has not yet been employed in XAD - it is in planning stage at the moment.
At this point we envisage the following steps, and are interested in feedback and ideas:
NOTE: It is very important that the code-path stays exactly the same for any other inputs, as it's recorded only once. It is essential that no branches, polymorphic function calls, number of loop iterations, etc, depend on the independent input data. Ideas how to enforce and detect data-dependent branching are welcome.
In some applications, the exact same calculations need to be carried out for different inputs repeatedly. Examples are Monte-Carlo simulation where the execution path (branches, etc.) is independent of the input data point.
Re-recording the tape on every path is redundant in this case, and it may be beneficial to record only one path on tape and then generate compiled code from this recording just in time. This code should produce both the value and the derivatives, and optimisations can be applied to increase performance. The overhead of JIT compilation should be compensated for larger numbers of repeated executions.
It would be good to add such a feature to XAD as an option.