hcderiv v0.4.0 — JAX-XLA backend for exact one-pass Hessians

Fuente: Zenodo
Saved in:
Bibliographic Details
Main Author: Zetta Byte
Format: Recurso digital
Published: Zenodo 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866901138966577152
author Zetta Byte
author_facet Zetta Byte
contents <p>hcderiv v0.4.0 adds a JAX/XLA backend with coefficient-level compiled Hessians — 137–260× faster than the v0.3.0 JAX backend, matching NumPy performance.</p> <p><strong>New: JAX-XLA backend.</strong></p> <div> <div> <div> <div> <div> </div> <div> <div> </div> </div> </div> </div> </div> <div> <pre><code>H = hessian(f, x) # NumPy (unchanged) H = hessian(f, x, backend="jax") # JAX v0.3 (Python dispatch) H = hessian(f, x, backend="jax-xla") # JAX-XLA v0.4 (compiled)</code></pre> </div> </div> <p><strong>Architecture:</strong> Instead of one Python Hyper object per operation, the XLA backend represents the entire coefficient vector as a single JAX array and implements the algebra via jnp.einsum — one call, XLA-fusable, jax.jit traceable.</p> <p><strong>Performance</strong> (f(x) = Σ[sin(xi) + 0.1xi^4], CPU):</p> <ul> <li>d=3: NumPy 1.25ms | JAX 83ms | XLA 0.36ms (232× vs JAX)</li> <li>d=8: NumPy 1.02ms | JAX 213ms | XLA 0.82ms (260× vs JAX)</li> <li>d=16: NumPy 2.45ms | JAX 439ms | XLA 2.41ms (182× vs JAX)</li> <li>d=32: NumPy 7.58ms | JAX 993ms | XLA 7.24ms (137× vs JAX)</li> <li>d=64: NumPy 30.7ms | JAX 3976ms | XLA 27.0ms (148× vs JAX)</li> </ul> <p>XLA matches or beats NumPy across all dimensions.</p> <p><strong>What's new:</strong></p> <ul> <li>JAXHyperArray class — coefficient vector as single JAX array, pure jnp ops</li> <li>_mul_tensor(d) — precomputed multiplication tensor, cached JAX constant</li> <li>All unary ops: sin, cos, exp, log, tanh, sqrt, sigmoid</li> <li>hessian_xla_jit — jax.jit compiled end-to-end</li> <li>grad, hessian, grad_and_hessian all route to XLA with backend="jax-xla"</li> <li>37 new tests — tensor structure, algebra, Rosenbrock, JIT stability, XLA vs NumPy</li> </ul> <p><strong>Tests:</strong> 117/117 (80 NumPy + 21 JAX + 16 layout/algebra + 37 XLA)</p> <p><strong>Install:</strong> pip install "hcderiv[jax]"</p> <p>GitHub: <a href="https://github.com/zetta55byte/hypercomplex">https://github.com/zetta55byte/hypercomplex</a> PyPI: <a href="https://pypi.org/project/hcderiv/0.4.0/">https://pypi.org/project/hcderiv/0.4.0/</a> Paper DOI: <a href="https://doi.org/10.5281/zenodo.19394700">https://doi.org/10.5281/zenodo.19394700</a></p>
format Recurso digital
id zenodo_https___doi_org_10_5281_zenodo_19433812
institution Zenodo
language
publishDate 2026
publisher Zenodo
record_format zenodo
spellingShingle hcderiv v0.4.0 — JAX-XLA backend for exact one-pass Hessians
Zetta Byte
automatic differentiation
implicit differentiation
hessian
hypercomplex numbers
vectorized algebra
scientific computing
<p>hcderiv v0.4.0 adds a JAX/XLA backend with coefficient-level compiled Hessians — 137–260× faster than the v0.3.0 JAX backend, matching NumPy performance.</p> <p><strong>New: JAX-XLA backend.</strong></p> <div> <div> <div> <div> <div> </div> <div> <div> </div> </div> </div> </div> </div> <div> <pre><code>H = hessian(f, x) # NumPy (unchanged) H = hessian(f, x, backend="jax") # JAX v0.3 (Python dispatch) H = hessian(f, x, backend="jax-xla") # JAX-XLA v0.4 (compiled)</code></pre> </div> </div> <p><strong>Architecture:</strong> Instead of one Python Hyper object per operation, the XLA backend represents the entire coefficient vector as a single JAX array and implements the algebra via jnp.einsum — one call, XLA-fusable, jax.jit traceable.</p> <p><strong>Performance</strong> (f(x) = Σ[sin(xi) + 0.1xi^4], CPU):</p> <ul> <li>d=3: NumPy 1.25ms | JAX 83ms | XLA 0.36ms (232× vs JAX)</li> <li>d=8: NumPy 1.02ms | JAX 213ms | XLA 0.82ms (260× vs JAX)</li> <li>d=16: NumPy 2.45ms | JAX 439ms | XLA 2.41ms (182× vs JAX)</li> <li>d=32: NumPy 7.58ms | JAX 993ms | XLA 7.24ms (137× vs JAX)</li> <li>d=64: NumPy 30.7ms | JAX 3976ms | XLA 27.0ms (148× vs JAX)</li> </ul> <p>XLA matches or beats NumPy across all dimensions.</p> <p><strong>What's new:</strong></p> <ul> <li>JAXHyperArray class — coefficient vector as single JAX array, pure jnp ops</li> <li>_mul_tensor(d) — precomputed multiplication tensor, cached JAX constant</li> <li>All unary ops: sin, cos, exp, log, tanh, sqrt, sigmoid</li> <li>hessian_xla_jit — jax.jit compiled end-to-end</li> <li>grad, hessian, grad_and_hessian all route to XLA with backend="jax-xla"</li> <li>37 new tests — tensor structure, algebra, Rosenbrock, JIT stability, XLA vs NumPy</li> </ul> <p><strong>Tests:</strong> 117/117 (80 NumPy + 21 JAX + 16 layout/algebra + 37 XLA)</p> <p><strong>Install:</strong> pip install "hcderiv[jax]"</p> <p>GitHub: <a href="https://github.com/zetta55byte/hypercomplex">https://github.com/zetta55byte/hypercomplex</a> PyPI: <a href="https://pypi.org/project/hcderiv/0.4.0/">https://pypi.org/project/hcderiv/0.4.0/</a> Paper DOI: <a href="https://doi.org/10.5281/zenodo.19394700">https://doi.org/10.5281/zenodo.19394700</a></p>
title hcderiv v0.4.0 — JAX-XLA backend for exact one-pass Hessians
topic automatic differentiation
implicit differentiation
hessian
hypercomplex numbers
vectorized algebra
scientific computing
url https://doi.org/10.5281/zenodo.19433812