Engine Internals & GPU Performance

Run One Tape on CPU, SIMD or GPU, Unchanged

The generated Java runs the Asian option on the available TeaVM CPU backend. Other listed engines remain explicitly unavailable here; no throughput is estimated for them.

MarketOptional

Browser workload defaults to 20,000 scenarios. The Java source shows the same tape and seed used for the measured CPU row.

Java source
SixBackendsRiskStudio.java

This exact source runs in TeaVM. Form changes update its Java literals and reset manual edits.

import com.nablatensor.quant.EquityMarket;
import com.nablatensor.quant.MonteCarlo;
import com.nablatensor.quant.Products;

public final class SixBackendsRiskStudio {
  private SixBackendsRiskStudio() {}

  public static void main(String[] args) {
    EquityMarket market = EquityMarket.of()
        .spot(100.0)
        .strike(100.0)
        .vol(0.20)
        .rate(0.03)
        .maturity(1.0)
        .build();
    int steps = 64;
    long scenarios = 20000L, seed = 42L;
    try (MonteCarlo<EquityMarket> mc = MonteCarlo.of(Products.asianCall())
        .market(market)
        .steps(steps)
        .fp64()
        .greeks()
        .on("cpu")
        .build()) {
      var value = mc.run(scenarios, seed);
      System.out.println("RESULT|" + mc.nodes() + "|" + value.price() + "|" + value.greek(EquityMarket::spot)
          + "|" + value.scenariosPerSecond());
    }
  }
}
TeaVM compiles and runs the Java source above in this browser.
Implementation guide

One computational graph, several execution targets

Separating recording from replay lets a stable valuation graph run on scalar, vector and accelerator backends without rewriting trade logic.

Core mechanism

Each backend implements the same tape semantics with a different execution strategy. Parity checks compare prices and Greeks before throughput differences are interpreted as a performance win.

Practical workflow

Start with the scalar oracle, establish numerical tolerances, benchmark representative tape shapes and scenario counts, then choose a backend based on reproducibility and operational fit as well as speed.

Key details

*Keywords: asian option monte carlo java, gpu monte carlo greeks, java vector api monte carlo, adjoint aad asian option*

An arithmetic-average Asian call has no closed form. The Java cell records it once, computes the price and spot delta on the TeaVM CPU backend, and measures that run's throughput.

This browser build exposes only the portable CPU row. The JIT, SIMD, CUDA, Vulkan and ROCm results from JVM or GPU environments are not measurements of this TeaVM run and are therefore left blank in the table.

Scope and review point

Not every tape maps equally well to every device. Precision, startup cost, memory transfer and driver availability can dominate small workloads.