# PyMC6 in docker complains about Loop fusion failed

**URL:** <https://discourse.pymc.io/t/pymc6-in-docker-complains-about-loop-fusion-failed/17818>\
**Category:** General\
**Created:** [June 4, 2026, 3:59pm UTC](https://discourse.pymc.io/t/pymc6-in-docker-complains-about-loop-fusion-failed/17818 "2026-06-04T15:59:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cricket4444](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Cricket4444](https://discourse.pymc.io/u/Cricket4444)\
**Post date:** [June 4, 2026, 3:59pm UTC](https://discourse.pymc.io/t/pymc6-in-docker-complains-about-loop-fusion-failed/17818/1 "2026-06-04T15:59:57Z")

</div>

> /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.

---

<div class="post-metadata">

**Author:** ![jessegrabowski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jessegrabowski/32/5010_2.png) [@jessegrabowski](https://discourse.pymc.io/u/jessegrabowski)\
**Post date:** [June 4, 2026, 4:14pm UTC](https://discourse.pymc.io/t/pymc6-in-docker-complains-about-loop-fusion-failed/17818/2 "2026-06-04T16:14:32Z")

</div>

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](https://github.com/pymc-devs/pytensor/issues/2193) to add a pure python backend to be used in the fast compile case that will solve this last remaining pain point.

---

<div class="post-metadata">

**Author:** ![Cricket4444](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Cricket4444](https://discourse.pymc.io/u/Cricket4444)\
**Post date:** [June 4, 2026, 4:23pm UTC](https://discourse.pymc.io/t/pymc6-in-docker-complains-about-loop-fusion-failed/17818/3 "2026-06-04T16:23:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jessegrabowski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jessegrabowski/32/5010_2.png) [@jessegrabowski](https://discourse.pymc.io/u/jessegrabowski)\
**Post date:** [June 4, 2026, 4:25pm UTC](https://discourse.pymc.io/t/pymc6-in-docker-complains-about-loop-fusion-failed/17818/4 "2026-06-04T16:25:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cricket4444](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Cricket4444](https://discourse.pymc.io/u/Cricket4444)\
**Post date:** [June 4, 2026, 4:26pm UTC](https://discourse.pymc.io/t/pymc6-in-docker-complains-about-loop-fusion-failed/17818/5 "2026-06-04T16:26:31Z")

</div>

Right, mean C BLAS backend, thanks for clarification!
