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

CheckParameterValue numba #3

Closed
ricardoV94 opened this issue Jun 29, 2022 · 6 comments
Closed

CheckParameterValue numba #3

ricardoV94 opened this issue Jun 29, 2022 · 6 comments

Comments

@ricardoV94
Copy link
Member

ricardoV94 commented Jun 29, 2022

Just noticed that the numba funcify just gets rid of bound checks.

In PyMC, by default, we replace it by -inf switches here. This will obviously be slower and unnecessary for most (well) parametrized models. Just wanted to ask if it was a conscious choice.

https://github.com/aseyboldt/nutpie/blob/6f22b171ddc913e9b6b0cc16e1d25b5148db8614/nutpie/compile_pymc.py#L15

@aseyboldt
Copy link
Member

By bounds checks you mean domain checks, right? Array accesses should still be checked, right?
But other than that, yes this should be fixed properly. I also thought there was a switch in pm.Model that disabled those domain checks, but it didn't seem to do anything.

@ricardoV94
Copy link
Member Author

By bounds checks you mean domain checks, right? Array accesses should still be checked, right?
But other than that, yes this should be fixed properly. I also thought there was a switch in pm.Model that disabled those domain checks, but it didn't seem to do anything.

There is a model switch but it only disables the checks when compile_pymc (the one in aesaraf) is called. It basically switches which rewrite is included.

@ricardoV94
Copy link
Member Author

@aseyboldt
Copy link
Member

Hm, maybe I should call that to generate the logp function.
This also reminds me that the rng code won't work properly if it ends up in the dlogp function (although I can't think of a usecase where it legitimately would end up there), because updates to shared variables won't work, and if they did they wouldn't be threadsafe.

@aseyboldt
Copy link
Member

ref #4 for random deterministics

@aseyboldt
Copy link
Member

nutpie is now using the pymc rewrite if bounds checks are off. (since #42)

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

2 participants