Integration Guide

AADC Integration Quick Start: 3-Step Integration in Weeks

Get started with AADC in 3 simple steps: see code examples, timelines, and best practices for rapid deployment. No templates required, minimal code changes, and results in weeks not months.

Localized code changes (<1%)
No performance penalty during development
Results in weeks, not months
Single branch of code during integration

Integration in Weeks, Not Years

Unlike tape-based AAD tools that require months or years of integration effort, AADC can be deployed in weeks with minimal code changes. This AADC Integration Guide walks you through the three-step process.

MatLogica uses an unorthodox integration approach that delivers 6-100x performance results in a few weeks, while our competitors can take months or even years to implement. The required code changes are minimal and can be performed by an experienced quant developer or software engineer with little to no additional training in automatic differentiation or AAD concepts.

You can perform the AADC integration yourself using our comprehensive toolkit, invite our integration expert for hands-on assistance, or work with a certified third-party vendor to supercharge your quantitative finance systems with automatic adjoint differentiation capabilities.

No-Trade-off Integration Explained

Introducing a traditional operator overloading AAD library will slow down the codebase by a factor of approximately 2x during development. MatLogica has developed a unique approach that avoids this undesired performance penalty, and the code will not slow down once AADC is introduced—maintaining full speed throughout the integration and testing phases.

CI/CD Compatible

Our semi-automated integration approach enables you to maintain a single branch of code during the integration and development processes. MatLogica integration scripts can be part of your CI/CD pipeline, meaning that team members will not be impacted by the changes introduced during gradual rollout. You can then transition to production once you have full confidence in the results from comprehensive testing and validation!

Our Integration Approach

Simple, low-risk integration in weeks

Integrate MatLogica's acceleration into existing systems with minimal code changes. Kernels are created for specific use cases and treated as disposable—generated when needed, discarded when no longer relevant.

Weeks, Not Months

Get your first function accelerated and validated within weeks

Minimal Code Changes

Wrap existing pricing calls without restructuring your codebase

Low Risk

Existing systems remain largely unchanged during integration

Immediate Value

Performance gains for targeted workflows from day one

3-Step Integration Process

Get your first function accelerated and validated in weeks

1

Replace double with idouble

Integration time: less than a month

Use MatLogica's Automated Integration scripts to replace standard `double` with `idouble` (AADC's active type) for variables involved in the computational flow.

Before
double price = monteCarloPrice(
    spot,
    vol,
    rate
);
After
idouble price = monteCarloPrice(
    spot,  // idouble
    vol,   // idouble
    rate   // idouble
);
  • Maintains identical numerical results
  • Code compiles and runs at full speed
  • No slowdown during development (unlike tape-based AAD)
  • Ready for Step 2
2

Record Your Function

Integration time: Days

Identify the pricing/simulation function to optimize, mark inputs and outputs, and instruct AADC to record the computational graph. This generates an optimized binary kernel.

// 1. Create AADC context
AADC::Context ctx;

// 2. Mark inputs
idouble spot = 100.0;
idouble vol = 0.2;
ctx.markInput(spot);
ctx.markInput(vol);

// 3. Start recording
ctx.startRecording();

// 4. Execute function once
idouble price = myPricingFunction(spot, vol);

// 5. Mark output
ctx.markOutput(price);

// 6. Generate kernel
auto kernel = ctx.stopRecording();
  • Branch handling: Ensure all code branches are covered
  • Typically 10-20 lines added: Minimal changes to your codebase
  • One-time cost: Recording happens once, kernel used repeatedly
  • Fast compilation: Kernel generation takes milliseconds to seconds
3

Execute the Kernel

Integration time: Days

Use the generated kernel instead of the original function. Compute valuations AND all derivatives simultaneously with 6-100x performance improvement.

// Process portfolio
for (auto& trade : portfolio) {
    // Set inputs
    std::vector<double> inputs = {
        trade.spot, trade.vol, trade.rate
    };

    // Execute kernel - computes price + all derivatives
    auto result = kernel.execute(inputs);

    // Extract results
    trade.price = result.value();        // Original value
    auto greeks = result.adjoints();     // All derivatives

    trade.delta = greeks[0];  // ∂price/∂spot
    trade.vega = greeks[1];   // ∂price/∂vol
    trade.rho = greeks[2];    // ∂price/∂rate
}

Typical Integration Timeline

Phase Activities Duration Deliverable
Week 1 Setup, idouble integration 5 days idouble produced same numerical results
Weeks 2-4 Identify target function, record and use recording 5-10 days One function accelerated, validated and ready for production
Weeks 5-20 Expand to core pricing functions, parallel testing 16 weeks Core functions accelerated
Weeks 21-34 Full library integration, comprehensive testing 14 weeks Complete integration tested
Weeks 35-48 Production rollout, monitoring, optimization 14 weeks Production deployment

Total Timeline (Typical) for Large Legacy Systems (10M+ LOC): 12 months

What Makes AADC Integration Fast?

  • No templates required
  • Automated migration scripts
  • Comprehensive debugging tools
  • CI/CD compatible
  • Incremental integration
  • No change to hardware stack

Related Resources

Ready to Get Started?

Schedule a consultation to discuss your integration timeline and requirements