Skip to main content

aadc

Run the same numerical code many times, much faster.

AADC records your calculation once — as you already wrote it, in ordinary Python arithmetic — and turns that recording into machine code. Replaying it skips the interpreter entirely, and replays several scenarios at once on the CPU's vector units.

import aadc

f = aadc.Functions()
f.start_recording()
x  = aadc.idouble(1.0);  xa = x.mark_as_input()
y  = my_pricer(x)                  # your existing code, unchanged
ya = y.mark_as_output()
f.stop_recording()

f.compile("scalar")                     # -> machine code, once
ws = f.create_workspace(kind="scalar")  # a workspace those kernels run on
ws.set_val(xa, 1.5)
ws.forward()                            # compiled replay: ws.val(ya)
ws.set_diff(ya, 1.0)
ws.reverse()                            # ws.diff(xa) = dy/dx at x = 1.5

compile() with no argument is the same as compile("scalar"): the same script runs compiled on x86-64, Apple Silicon and Linux AArch64 alike, and create_workspace() / aadc.evaluate() with no workspace argument use the workspace those kernels run on. compile("auto") compiles for the host's vector lanes instead (AVX2 on x86-64, NEON on Apple Silicon) — use it for batches: aadc.evaluate() after compile("auto") replays several scenarios per instruction, typically 3-4x faster than after plain compile(). Choose the backend at the FIRST compile() of a recording: a later call with another backend does not replace kernels already installed.

From then on every replay runs compiled. Typical speedups are several times the interpreted path — about 4x on one customer's FX pricer — and more when you replay a batch of scenarios, because the vector backends evaluate four (AVX2) or eight (AVX-512) at a time.

Where to look first

import aadc
help(aadc)                 # the three ideas, and a quickstart that runs
aadc.llms_txt()            # the same, written for a coding agent

dir(aadc) is the declared API (aadc.__all__), and every headline type carries a docstring — help(aadc.Functions), help(aadc.idouble), help(aadc.Workspace).

The one trap. if x > k: on an active value forces a plain bool, which freezes that comparison as it came out while recording — a later replay with different inputs still follows the recorded branch. Use aadc.iif(x > k, a, b) when the condition depends on an input. Every such conversion is counted, so this is detectable rather than silent:

kernel.num_passive_warnings()      # 0 is the goal
kernel.passive_warnings()          # kind and location of each

Derivatives are optional. If you want them, the same recording gives you exact first-order sensitivities of every output with respect to every input — no bumping, no re-running the pricer per input, and exact rather than finite-difference approximations. If you do not want them, AADC is simply a compiler for the hot loop you already have.

That is the whole idea: record once, replay compiled — and take the derivatives if they are useful to you.

Install

pip install aadc

Supports CPython 3.10 and later. One abi3 wheel serves every CPython >= 3.11 on a given platform (the extension is built against the CPython Limited API); 3.10 is served by its own version-specific wheel.

Supported platforms

Binary wheels only — there is no source distribution, so pip install aadc on anything not listed here fails with no matching distribution rather than attempting a build.

CPython 3.10 – 3.14
Linux x86-64 (manylinux_2_28) yes
Linux aarch64 (manylinux_2_28) yes
macOS arm64 (Apple Silicon, 11.0+) yes
Windows x64 yes
macOS x86-64 (Intel) no
Alpine / musl no
32-bit Windows no

The macOS wheels are Apple Silicon only. An Intel Mac gets no matching distribution — the Operating System :: MacOS classifier is as specific as PyPI allows, so this table is the authority, not the sidebar.

The Linux wheels need glibc 2.28 or newer; the shipped library's own floor is lower (it references no symbol above GLIBC 2.14 / GLIBCXX 3.4.22), so the tag is the binding constraint rather than the binary.

Upgrading from aadc 1.x

2.x is a different engine, not a compatible successor. The 1.x line ended at 1.8.2; 2.x is a ground-up rewrite with its own recording API, and code written against 1.x will not run unchanged. Notably aadc.license() no longer exists — entitlement is resolved from the environment instead (see Licence in one paragraph below).

If you depend on the 1.x behaviour, pin it explicitly:

pip install 'aadc<2'

Migrating is a port rather than an upgrade. Start from Where to look first above; the recording shape — start_recording(), mark_as_input(), mark_as_output(), a workspace per evaluation — is what changed most.

Version 2.2.0 renames the distribution from aadc-ng to aadc, continuing the PyPI aadc 1.x line. The import (import aadc) and every binary name (_aadc_ng, the aadc_ng runtime package, libaadc-ng) are unchanged.

Upgrading from an environment that has aadc-ng installed: uninstall it FIRST (pip uninstall -y aadc-ng), then pip install aadc. pip treats the two as unrelated distributions that own the same files, so installing aadc over aadc-ng works — but a later pip uninstall aadc-ng would then delete the files out from under aadc, leaving an install whose metadata says it is fine and whose import aadc fails.

Licence in one paragraph

Proprietary. The free Community Edition covers non-commercial and academic use only — personal study, hobby projects, publicly available open-source development, and research or teaching at a university or recognised research institute. Everything else is Production Use and needs a commercial licence, including evaluation by a company and any calculation whose output reaches a book, a client report or a regulator.

The Community Edition is fast. On x86-64 with AVX2, and on Apple Silicon, it runs the interpreter and every JIT backend at full speed, and compile() selects a JIT by default — so on those hosts the ordinary path needs no licence and no C compiler on the box. Two hosts are the exception: on non-Apple 64-bit ARM the vector backends compile() picks there need a licence with the arm64 feature, and on pre-AVX2 x86-64 there is no scalar JIT, so compile('scalar') falls back to the C emitter and needs codegen_c. Both report the feature they want, and neither changes your numbers.

What a licence adds is the ahead-of-time code generators (which write a translation unit you keep, inspect and ship), AVX-512 in any form, and double-precision GPU.

Ask for a licensed backend without the licence and those segments replay on the interpreter: identical results, more slowly, with the reason reported in compile()'s unavailable field. Nothing expires and nothing contacts a server. Every numerical answer is the same in every tier — the licence buys speed, never correctness.

Full terms ship inside the wheel at <site-packages>/aadc-<version>.dist-info/licenses/LICENSE.txt, with THIRD-PARTY-NOTICES.txt beside it. Commercial and free full-performance academic licences: info@matlogica.com.

Which version am I running?

Two version strings, because there are two things to version:

import aadc

aadc.__version__          # e.g. '2.9.2' -- the WHEEL you pip-installed
aadc.__engine_version__   # e.g. '2.9.0' -- the aadc-ng C++ engine inside it

__version__ is the distribution version, identical to importlib.metadata.version("aadc") and to what pip freeze reports. __engine_version__ is the version of the compiled aadc-ng engine the wheel carries, recorded at build time from the SDK.

They are allowed to differ, and comparing them is not a health check: a Python-only fix ships a new wheel against an unchanged engine. Record __version__ next to your risk numbers and __engine_version__ when you need to say which arithmetic produced them. Both are also available as aadc_ng.__version__ / aadc_ng.__engine_version__.

For what the loaded library says about itself — a third, independent source — use aadc.license_status()["build_version"]; disagreeing with __engine_version__ means the wheel is carrying a different image than its metadata claims.

Check your entitlement in your own CI

import aadc

s = aadc.license_status()
assert s["state"] == "licensed", s["detail"]

state is unlicensed, licensed or expired. expired means the token is genuine but this build is newer than its version ceiling — the entitlement is to older builds, which keep running at full speed. Compare version_max against build_version to see the gap.

Token location, in order: $AADC_NG_LICENSE, ./aadc-ng.lic, ~/.aadc-ng/license.

One shared library per process

libaadc-ng carries thread-local recording state, so a second copy in one process gives correct values and silently zero gradients. This wheel is the only one that ships it; anything else linking it must resolve it by RPATH. Assert it:

import aadc_ng
aadc_ng.check_single_image()   # raises if more than one is mapped

Metadata

Release files for aadc 2.22.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for aadc 2.22.2
File
aadc-2.22.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
aadc-2.22.2-cp311-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
aadc-2.22.2-cp311-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
aadc-2.22.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
aadc-2.22.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
aadc-2.22.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
aadc-2.22.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
aadc-2.22.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 12.6 MB

Release files / aadc-2.22.2-cp311-abi3-win_amd64.whl

Download URL aadc-2.22.2-cp311-abi3-win_amd64.whl
Size 1.6 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
595b2ef0113408eae54e52dc7c9be1d5598b4da8b4465100fc157bae25732ebe
BLAKE2b-256 checksum
How to use checksums
b78eac51e39520acf9012784c8af3f3bd764c5ce113617aa0f2a3fb3f1c29faf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / aadc-2.22.2-cp311-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL aadc-2.22.2-cp311-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
293f381fc1977b3980e08b31422706de2106a888d06f429b30063c3d399b7301
BLAKE2b-256 checksum
How to use checksums
678d37daa35683e0027a21692841a76d42fdcccb2c948489062e7ee30d75d281
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / aadc-2.22.2-cp311-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL aadc-2.22.2-cp311-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
68015089b7c4ab7ba6549b76d19afa7451360c92782326b4e2c30fc6861d91fa
BLAKE2b-256 checksum
How to use checksums
a43b7d77b1cec780e08f16cebba9b1538922af6018e1da93c4cc8813bcc84361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / aadc-2.22.2-cp311-abi3-macosx_11_0_arm64.whl

Download URL aadc-2.22.2-cp311-abi3-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5ad829e828d64ae9e1867ff48f00c207117263a2e50b67cb5bdc9e40120f2c0b
BLAKE2b-256 checksum
How to use checksums
20e762dc749762efcb9e3326b6f27bcb4e77a743c0a7adc4dd63aa110486d631
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / aadc-2.22.2-cp310-cp310-win_amd64.whl

Download URL aadc-2.22.2-cp310-cp310-win_amd64.whl
Size 1.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
665381f2233cad0781a30998694be9847b1bafea4e1ad393cd0440c4ffa742be
BLAKE2b-256 checksum
How to use checksums
261ca084ab472c2c85b25eafe4db89e4f8c3a1645bf8ddd471fbc82162e03c8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / aadc-2.22.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL aadc-2.22.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b071f9a42f284311db8418befbdf182a9db88d186c781efc8391947a6eb1e0c2
BLAKE2b-256 checksum
How to use checksums
69aa6bae81bbdaa82020bd3b04fcadefd89bb1fcdf1e8c5765cc0bb2039b2f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / aadc-2.22.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL aadc-2.22.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
8882d790fa9eff9faf6a781c96e61e7176644682b1e09d0bdc796b0854104b52
BLAKE2b-256 checksum
How to use checksums
8dfdd53b25a3e745671052647c50868f66b845eff61783305389049f735ea83d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / aadc-2.22.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL aadc-2.22.2-cp310-cp310-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
337a1d9311fa32656899a853668685ee6e3e5b1ffdfe39540fcac6d439f6b48a
BLAKE2b-256 checksum
How to use checksums
f6b84920f5f79ce154f8d08c1753f8d0abc4d5470ecd7160c501d623152c1ac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

2.22.2 This release

8 release files

2.18.1

8 release files

1.8.2

11 release files

1.8.0

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page