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

Look into adding a numba sampler #608

Open
digicosmos86 opened this issue Dec 4, 2024 · 4 comments
Open

Look into adding a numba sampler #608

digicosmos86 opened this issue Dec 4, 2024 · 4 comments
Assignees

Comments

@digicosmos86
Copy link
Collaborator

PyMC 5.19 was just released. The version highlight is the ability to use numba to compile the likelihood function, which achieves about a 2x speed up in inference. We should look into this and see if there is an option in Bambi to allow us to use this option.

@cpaniaguam
Copy link
Collaborator

PyMC 5.19 was just released. The version highlight is the ability to use numba to compile the likelihood function, which achieves about a 2x speed up in inference. We should look into this and see if there is an option in Bambi to allow us to use this option.

If an option for this were to be available in Bambi, wouldn't it appear in a release post-PyMC 5.19? Bambi latest release (v0.14) was published back in July.

@digicosmos86
Copy link
Collaborator Author

Just to clarify, we know that Bambi does not have this included atm. However, since bambi does provide some flexibility in using kwargs to pass additional options to PyMC's model.sample call, what we are trying to figure out is if we can take advantage of that and provide an additional option for the users to use the numba backend. Let me know if you want to chat more about this

@cpaniaguam
Copy link
Collaborator

I spent some time looking into this. I seems like the backends one can specify are the ones that come under bmb.inference_methods.names (see this). I couldn't find anything regarding backend options for sampling.

@AlexanderFengler
Copy link
Collaborator

@cpaniaguam one route to testing this is to just directly go down to the pymc model attached to any hssm model.

my_hssm_model.pymc_model, then you should be able to do something like:

import pymc as pm
with my_hssm_model.pymc_model:
    pm.sample(**kwargs)

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

No branches or pull requests

3 participants