MatLogica AADC delivers the fastest Greeks computation for Python Monte Carlo, dramatically outperforming XAD, Enzyme-AD, JAX, PyTorch, and Autograd.
All benchmarks use 100 trades × 10,000 scenarios × 252 timesteps on identical hardware with 4-thread execution for fair comparison.
100 trades × 1,000 scenarios × 252 timesteps (single-threaded)
* PyTorch time includes JIT compilation; per-path AD takes 1361s
Different approaches to automatic differentiation have vastly different performance characteristics
Lines of code changed and model rewrite requirements
JAX does not support native Python control flow inside JIT-compiled functions:
for loops must be replaced with jax.lax.fori_loopif/else must be replaced with jax.lax.condPeak memory consumption during Greeks computation
Key insight: AADC uses 3-5x less memory than JIT-based alternatives (JAX, PyTorch, Enzyme-AD) while delivering faster performance.
Strengths and considerations for each AAD library
Production-grade performance
LLVM-based differentiation
Tape-based AAD
XLA-compiled differentiation
The fundamental problem: XAD creates a new tape for every Monte Carlo path
# AADC: Record kernel once, evaluate all scenarios
funcs.start_recording()
S0_v = aadc.idouble(0.0)
S0_arg = S0_v.mark_as_input()
# Standard Python loop - NO REWRITE!
for t in range(num_timesteps):
price = price * np.exp(drift + vol * Z[t])
payoff_res = payoff.mark_as_output()
funcs.stop_recording()
# Evaluate ALL scenarios + Greeks in ONE call
results = aadc.evaluate(funcs, request, inputs) # XAD: New tape for EVERY scenario - catastrophic!
for scenario in range(10000): # 10,000 iterations!
with xadj.Tape() as tape: # New tape each time
tape.registerInput(S0_ad)
tape.newRecording()
# Simulate single path
payoff = simulate_path(S0_ad, ...)
tape.registerOutput(payoff)
payoff.derivative = 1.0
tape.computeAdjoints() # Backward pass
delta_sum += S0_ad.derivative AADC records the computation graph once and evaluates all 10,000 scenarios in parallel using SIMD vectorisation. XAD creates, records, and computes adjoints for a new tape on every single path - that's 10,000 tape operations instead of 1.
See how AADC can deliver 625x faster Greeks computation than XAD for your Python Monte Carlo models with minimal code changes.
All benchmarks executed on identical hardware for fair comparison
| CPU | Intel Xeon Platinum 8280L @ 2.70GHz |
| Cores | 28 cores/socket, 2 sockets, 112 threads |
| OS | Linux 6.1.0-13-amd64 (Debian) |
| Trades | 100 |
| Scenarios | 10,000 |
| Timesteps | 252 |
| Threads | 4 (fair comparison) |
Asian Option Monte Carlo with GBM dynamics