arviz-devs / arviz

Exploratory analysis of Bayesian models with Python
https://python.arviz.org
Apache License 2.0
1.59k stars 395 forks source link

Make use of numba opt-in not opt-out #2313

Open ricardoV94 opened 7 months ago

ricardoV94 commented 7 months ago

Calling forest_plot when numba is installed ends up with cryptic errors: ValueError: Failed in object mode pipeline (step: remove phis nodes) This is a PITA.

Please consider making the use of numba opt-in (not simply by having numba installed).

tomicapretto commented 7 months ago

If we wanted to do this, I think (almost?) everything is already there. We just need to make sure that

https://github.com/arviz-devs/arviz/blob/7c1637f6d4574bc8ba5757165f9e7bb02e202621/arviz/utils.py#L200

is not True by default when numba is installed (which is the case now)

OriolAbril commented 7 months ago

Sounds good to me, the only change would be in https://github.com/arviz-devs/arviz/blob/7c1637f6d4574bc8ba5757165f9e7bb02e202621/arviz/utils.py#L328 make it False instead of the result of numba_check.

I'll also look into the error, it might not change much between using numba there or not if its in object mode.

drbenvincent commented 7 months ago

+1: I'm hitting this error as well