Code Generation AAD approach uses Code Transformation and Operator Overloading
to efficiently compute the gradients of mathematical models by generating optimized machine code at runtime.
in faster computing of the model and its first and higher order derivatives. The approach is particularly useful for models with many parameters
that require frequent gradient updates during training.
Please read our detailed overview of the AAD approaches available here.
MatLogica's Code Generation AAD - AADC
MatLogica has developed a specialised run-time compiler, AADC (AAD Compiler)
that generates efficient binary kernels
for execution of the original and adjoint functions on the fly.
Due to native CPU vectorisation and safe multithreading,
AADC can speed up the AAD method itself, and deliver pricing and scenario analysis
simply and effectively, in a way that is unattainable with competing products.
MatLogica's approach enables efficient AAD calculations in the legacy code, without major refactoring, introduction of templates, or constraining the control flow.
Code Generation AAD approach explained
A Code Generation approach to algorithmic differentiation delivers ease of use by using Operator Overloading
and fast performance due to on-the-fly generation of the original and the adjoint versions of the program.
In essence, a Code Generation approach involves generating the code of the original model and its adjoint at the
first execution of the function. This new code is subsequently used in all following loops, delivering speed-ups.
For any new task, or task configuration change (such as if pricing a new trade, a change in trading date,
or amending the portfolio), the
Code Generation tool will need to recompile the original and the adjoint model.
Therefore, the compilation time with a Code Genereation AAD tool becomes part of the execution flow.
Using a standard off-the-shelf compiler, such as LLVM or C++, simply cannot deliver the performance in practice.
To address this, we have designed a specialsed Just-in-time compiler for Code Generation and AAD.
Theory: Code Generation AAD approach
Benefits of MatLogica AADC Code Generation
MatLogica AADC does not introduce limits on functionality such as branching, instead enabling smooth integration without the loss of numerical precision or trade-offs in functionality or usability.
Practice - AADC Just-In-Time Compilation
Second-order greeks can be computed using bump-and-revalue of the first-order AAD greeks, fast.
Adjoint factor less than 1
Using AADC, the original function and all its derivatives can be calculated faster than the original function.
Any types of simulations (what if, stress test, backtesting, VaR) can be supercharged seamlessly
Debugging & checkpointing
Our debugging and checkpointing toolkit makes integration and troubleshooting simpler.
MatLogica AADC acts as an abstraction layer between your business logic and your hardware.