patrick-kidger / patrick-kidger/diffrax
Create custom more-efficient `searchsorted` implementation.
Open
Nobody has claimed this yet.
refactor
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 189
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 1
Description
The current JAX implementation of searchsorted, available here:
has some flaws.
- It uses a for loop to run to iteration, rather than early-stopping once the best value has been found.
- It doesn't allow for any kind of hint for where to start.
In particular once hints are in then we can improve the efficiency of our own use of it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the JAX searchsorted implementation linked in jax/_src/numpy/lax_numpy.py around line 4219. Determine how the current loop and starting position work, then design the custom implementation around early stopping and optional hints. Done means the implementation supports those efficiency improvements and improves Diffrax's own use of searchsorted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100