Skip to content

About

FlatPPL modules compiled to differentiable JAX functions through StableHLO

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FlatPPL for Python

Compile FlatPPL modules into JAX functions through the Rust StableHLO emitter. JAX/XLA executes the functions, and Enzyme-JAX supplies differentiation. Inference libraries such as BlackJAX consume the callable separately.

Documentation · Installation · Tutorials · API reference

import jax
from flatppl import flatppl

query = flatppl(r"""
    posterior = Normal(mu = 0.0, sigma = 1.0)
    x = elementof(reals)
    inputs = x
    outputs = logdensityof(posterior, x)
""")

logdensity = query.compile()
value, gradient = jax.value_and_grad(logdensity)(1.0)

Use inline source or load files, declare inputs and outputs in FlatPPL, and pass values from Python. Float32 is the default. See the quickstart for a complete example, modules and contexts for reusable queries, and the mixed-model tutorial for BlackJAX sampling with automatic coordinate transforms.

The alpha package supports Python 3.12–3.15 on Linux x86-64 and Apple silicon macOS. Wheels include the native compiler. Follow the installation guide for Pixi installation from GitHub, wheel downloads, and platform requirements.

See development to build, test, or contribute documentation.

About

FlatPPL modules compiled to differentiable JAX functions through StableHLO

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages