Saved in:
Bibliographic Details
Main Authors: Roth, Jakob, Reinecke, Martin, Edenhofer, Gordian
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2403.08847
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929400982798336
author Roth, Jakob
Reinecke, Martin
Edenhofer, Gordian
author_facet Roth, Jakob
Reinecke, Martin
Edenhofer, Gordian
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2403_08847
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle JAXbind: Bind any function to JAX
Roth, Jakob
Reinecke, Martin
Edenhofer, Gordian
Instrumentation and Methods for Astrophysics
Machine Learning
Computation
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.
title JAXbind: Bind any function to JAX
topic Instrumentation and Methods for Astrophysics
Machine Learning
Computation
url https://arxiv.org/abs/2403.08847