JAXbind:将任意函数绑定到 JAX
JAXbind: Bind any function to JAX
AI总结:
JAXbind 提供了一个易用的 Python 接口,将任意 Python 可调用函数绑定至 JAX,并全面支持 Jacobian 乘积与 JAX 转换,大幅降低了整合外部高性能代码的难度。
摘要:
JAX 被广泛应用于机器学习和科学计算,后者通常依赖于现有的高性能代码,而我们理想中希望将这些代码整合到 JAX 中。用 JAX 重新实现现有代码通常是不切实际的,且 JAX 中用于绑定自定义代码的现有接口要么将用户限制在单一的 Jacobian 乘积,要么需要深入了解 JAX 及其 C++ 后端才能实现通用的 Jacobian 乘积。借助 JAXbind,我们大幅减少了将其他编程语言实现的自定义函数绑定到 JAX 所需的工作量,并完全支持 Jacobian-vector products 和 vector-Jacobian products。具体而言,JAXbind 提供了一个易于使用的 Python 接口,用于定义自定义的、所谓的 JAX primitives。通过 JAXbind,任何可从 Python 调用的函数都可以作为 JAX primitive 暴露出来。JAXbind 允许用户将 JAX 函数转换引擎与自定义导数和批处理规则进行对接,从而为自定义 primitive 启用所有 JAX 转换。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。