PyMC6 in docker complains about Loop fusion failed

/usr/local/lib/python3.12/site-packages/pytensor/tensor/rewriting/elemwise.py:1034: UserWarning: Loop fusion failed because the resulting node would exceed the kernel argument limit.

I cannot reproduce the same on my mac with exactly the same model. Nutpie is installed in docker. I wonder if pymc6 is using numba by default, why would it care about kernel arguments?

The model is very simple, I’m testing docker packaging.

There are some cases where we call little helper functions with mode=FAST_COMPILE, which will still trigger C compilation in certain cases. You can get rid of all of this by setting the PYTENSOR_FLAGS=cxx=‘’ environment variable to completely disable the C compiler (that was off the top of my head, double check the exact flag name in the docs).

I have an issue open here to add a pure python backend to be used in the fast compile case that will solve this last remaining pain point.

1 Like

Does it have any performance penalty in doing that? I can install a compiler in docker, BLAS is a bit of a pain.

Not really, we only do it on tiny things where running optimization+compile is way more expensive than the computation itself.

To be clear, numba backend still uses blas, that’s a separate issue from a C compiler.

Right, mean C BLAS backend, thanks for clarification!