Skip to content

Setting maxdepth in nutpie.sample() causes model to run indefinite (v0.16.2) #257

@kenteross

Description

@kenteross

This should run normally and does in v0.15.2, but when I run any model with 'maxdepth', the model runs indefinitely.

Environment:

  • Python 3.11
  • nutpie v0.16.2
  • pymc v5.26.1

Example model:

import numpy as np
import pymc as pm
import nutpie

date_index = np.array(['2022-01-01', '2022-01-02', '2022-01-03'])
coords = {'date': date_index}
observed_data = np.array([1.0, 2.0, 3.0])

with pm.Model(coords=coords) as model:
    alpha = pm.Normal("alpha", mu=0, sigma=1, dims="date")
    obs = pm.Normal("obs", mu=alpha, sigma=1, observed=observed_data, dims="date")

compiled = nutpie.compile_pymc_model(model)

# Works
trace = nutpie.sample(compiled, draws=100, chains=1)

# Runs indefinitely
trace_maxdepth = nutpie.sample(compiled, draws=100, chains=1, maxdepth=10)

Additional notes:

  • Removing the maxdepth argument makes it work fine.
  • Happens for any maxdepth value (e.g., 1–10).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions