patrick-kidger / patrick-kidger/diffrax

Add support for Jax.experimental.jet.

Open
#616 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
2.1k
Forks
189
Avg merge
3d 18h
Merged PRs (30d)
1

Description

Is it possible to add support to diffrax for jax.experimental.jet? I would like be able to calculate higher order derivatives of the output of an ODE with respect to it's input, and repeated calls to the jacobian are obviously slow to perform. It seems like jax.jet provides a solution to this problem (see: https://github.com/jax-ml/jax/issues/5152#issuecomment-2636319226 and https://github.com/robochimps/vibrojet/blob/main/examples/jet_example.ipynb), as it is capable of reusing previous partial derivatives to calculate the next in a series. I understand that there is currently no jet rule for lax.scan and lax.while which might complicate matters, but even so is this something that could eventually be implemented into diffrax?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing diffrax's tracing and differentiation paths alongside the referenced JAX jet example and the lack of jet rules for lax.scan and lax.while. Determine whether higher-order derivatives through an ODE can be supported, then verify that jax.experimental.jet works for the relevant solver paths and repeated derivative calculations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.