Error using `nutpie` sampler with Latent GP

Hello, I am trying to sample a Latent GP model with numpie and getting the following error:

AttributeError: 'JITCPUCodegen' object has no attribute '_mpm_cheap'

(I can post the full stacktrace if that is more helpful).

The model is:

with pm.Model() as gp_model:
    # data containers
    X = pm.Data("X", times[:, None])
    trials = pm.Data("trials", trials)
    sends = pm.Data("sends", sends)
    # priors
    ell1 = pm.HalfNormal("ell1", sigma=1.25)
    ell2 = pm.HalfNormal("ell2", sigma=1.25)
    eta1 = pm.HalfNormal("eta1", sigma=1.0)
    eta2 = pm.HalfNormal("eta2", sigma=1.0)

    # define the kernel
    cov = eta1 * pm.gp.cov.Matern12(1, ell1) + eta2 * pm.gp.cov.Periodic(1, 12, ls=ell2)

    gp = pm.gp.Latent(cov_func=cov)
    f = gp.prior("f", X=X)

    # logit link and Binomial likelihood
    p = pm.Deterministic("p", pm.math.invlogit(f))
    lik = pm.Binomial("lik", n=trials, logit_p=f, observed=sends)

and when I run

compiled_model = nutpie.compile_pymc_model(categorical_gp_model)

I get the above error.

My versions are:

...
llvmlite==0.44.0
logical-unification==0.4.6
magic-carpet==4.0.2
magic-carpet-common==1.1.2
markdown-it-py==3.0.0
MarkupSafe==3.0.2
matplotlib==3.10.0
matplotlib-inline==0.1.7
mccabe==0.7.0
mdurl==0.1.2
miniKanren==1.0.3
mistune==3.1.1
multipledispatch==1.0.0
mypy-extensions==1.0.0
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nest-asyncio==1.6.0
notebook==7.3.2
notebook_shim==0.2.4
numba==0.61.0
numpy==1.26.4
nutpie==0.13.2
overrides==7.7.0
packaging==24.2
pandas==2.2.3
pandocfilters==1.5.1
parso==0.8.4
pathspec==0.12.1
pexpect==4.9.0
pillow==11.1.0
platformdirs==4.3.6
pluggy==1.5.0
prometheus_client==0.21.1
prompt_toolkit==3.0.50
psutil==6.1.1
ptyprocess==0.7.0
pure_eval==0.2.3
pyarrow==12.0.1
pycparser==2.22
Pygments==2.19.1
pylint==2.13.8
pymc==5.20.0
pyparsing==3.2.1
pyrsistent==0.20.0
pytensor==2.26.4
pytest==8.3.4
python-dateutil==2.9.0.post0
python-json-logger==3.2.1
pytz==2025.1
PyYAML==6.0.2
pyzmq==26.2.1
referencing==0.36.2
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.9.4
rpds-py==0.22.3
ruamel.yaml==0.18.10
ruamel.yaml.clib==0.2.12
s3transfer==0.11.2
scipy==1.15.1
sh==2.2.1
six==1.17.0
sniffio==1.3.1
soupsieve==2.6
stack-data==0.6.3
tabulate==0.9.0
termcolor==2.5.0
terminado==0.18.1
threadpoolctl==3.5.0
tinycss2==1.4.0
toolz==1.0.0
tornado==6.4.2
tqdm==4.67.1
traitlets==5.14.3
transdag==0.0.64
types-python-dateutil==2.9.0.20241206
typing_extensions==4.12.2
...

any ideas? It looks like it is not compiling because of a numba version issue?

Update: downgrading to:

pymc==5.18.2
numba==0.60.0

removes the error.

I will experiment with later versions of pymc

based on the error, my guess is that downgrading numba is the important thing

2 Likes

Fixed in: Release rel-2.27.1 · pymc-devs/pytensor · GitHub

1 Like