Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new jax backend that calls the logp function through python #129

Merged
merged 7 commits into from
Jun 26, 2024

Conversation

aseyboldt
Copy link
Member

@aseyboldt aseyboldt commented Jun 22, 2024

Getting jax support in nutpie without python overhead seems to be tricky, but this PR implements this by calling the jax logp functions through python.
This leads to relatively bad performance for very small functions, especially if many chains are running simultaneously (due to the python GIL). But for larger models this doesn't add much to the total runtime, so I think this is still quite useful.

The new backend can be used as this:

compiled = nutpie.compile_pymc_model(model, backend="jax")
tr = nutpie.sample(compiled)

python/nutpie/compile_pymc.py Outdated Show resolved Hide resolved
python/nutpie/compile_pymc.py Outdated Show resolved Hide resolved
@aseyboldt aseyboldt merged commit b51af9a into pymc-devs:main Jun 26, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants