Re: 答复: Adjoint Greeks
Posted by Alexander Sokol on Mar 02, 2015; 8:18pm
URL: http://quantlib.414.s1.nabble.com/Adjoint-Greeks-tp16147p16294.html
Hi Peter:
I am not yet ready to comment on the performance implications, but not becuase the initial test results are not clear - it is just that the bottleneck may not be as dependent to the overhead of "unused" adjoint variable. For example, if the bottleneck is in Monte Carlo, and by the time we get to Monte Carlo claculations every value in time slices is an AD variable, then there is no additional overhead at all and performance optimizations may turn out to be completely different from isolating non-AD variables from AD variables.
On the other hand, the benefits of not touching much of the code are quite significant for continuity and avoiding a disruption to the codebase. So far I collected these changes in my master-adjoint-ready branch in github.com/compatibl/quantlib. They are faily minimal and I am planning to send Luigi a pull request shortly. Also, we confirmed that using a class for Real where inside is a regular double has no measurable performance impact at all because it is fully inlined. If we use our own class for Real, and inside that class place AD<double> or adouble, then the AD framework does not need to be patched at all.
Best regards
Alex