-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
JIT Code Generation #70
Comments
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 |
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.
The text was updated successfully, but these errors were encountered: