JAXbind: Bind any function to JAX

Jakob Roth, Martin Reinecke, Gordian Edenhofer
3/13/2024
astro-ph.IMcs.LGstat.CO

No official code found. Best implementation: NIFTy-PPL/JAXbind (82 stars, BSD-2-Clause, last commit 2026-02-12).

Abstract

JAX is widely used in machine learning and scientific computing, the latter of which often relies on existing high-performance code that we would ideally like to incorporate into JAX. Reimplementing the existing code in JAX is often impractical and the existing interface in JAX for binding custom code either limits the user to a single Jacobian product or requires deep knowledge of JAX and its C++ backend for general Jacobian products. With JAXbind we drastically reduce the effort required to bind custom functions implemented in other programming languages with full support for Jacobian-vector products and vector-Jacobian products to JAX. Specifically, JAXbind provides an easy-to-use Python interface for defining custom, so-called JAX primitives. Via JAXbind, any function callable from Python can be exposed as a JAX primitive. JAXbind allows a user to interface the JAX function transformation engine with custom derivatives and batching rules, enabling all JAX transformations for the custom primitive.

View on arXivView PDF

Code Implementations(1)

NIFTy-PPL/JAXbindCommunity100%
BSD-2-Clause

Bind any function written in another language to JAX with support for JVP/VJP/batching/jit compilation

820C++, TeXFeb 20, 20248 months agoBSD-2-Clause

Similar Papers

Cite this paper

@article{roth2024jaxbind,
  title  = {JAXbind: Bind any function to JAX},
  author = {Jakob Roth and Martin Reinecke and Gordian Edenhofer},
  year   = {2024},
  eprint = {2403.08847},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.08847v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.08847.svg)](https://codeofpaper.com/paper/2403.08847)

Discussion