patrick-kidger / patrick-kidger/diffrax
METAL Backend Support
Open
Nobody has claimed this yet.
question
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 189
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 1
Description
#Question
Thanks for all your work on diffrax!
Has anyone gotten diffrax working with a METAL GPU backend? There may be a simple reason why this isn't possible that I'm not aware of.
from diffrax import diffeqsolve, Dopri5, ODETerm, SaveAt, PIDController
vector_field = lambda t, y, args: -y
term = ODETerm(vector_field)
solver = Dopri5()
saveat = SaveAt(ts=[0., 1., 2., 3.])
stepsize_controller = PIDController(rtol=1e-5, atol=1e-5)
diffeqsolve(term, solver, t0=0, t1=3, dt0=0.1, y0=1, saveat=saveat,
stepsize_controller=stepsize_controller)
Returns:
ValueError: `EmitPythonCallback` not supported on METAL backend.
Run `reticulate::py_last_error()` for details.
5.
stop(<environment>)
4.
pure_callback_lowering at callback.py#141
3.
_call at _jit.py#98
2.
__call__ at _jit.py#102
1.
diffrax$diffeqsolve(term, solver, t0 = 0, t1 = 1, dt0 = 0.1,
y0 = y0, stepsize_controller = stepsize_controller, throw = F)
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 by reproducing the reported failure through diffrax.diffeqsolve with the METAL backend and the example configuration in the issue. Investigate the EmitPythonCallback limitation and determine whether METAL support is feasible; done means the example runs successfully without that error, with any required scope documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100