Skip to content

fit() with multiple cores hangs with PyMC >= 5.27.1 #976

@swademb

Description

@swademb

Using JupyterLab with bambi 0.16.0

Fitting a generalised linear mixed effects model - the formula doesn't seem to matter much. Let's say that:

  • height and group:height are fixed effects.
  • (1|area) is a random effect.

E.g. we have the formula:

outcome ~ 0 + group + group:height + (1:area)

And we have:

import bambi as bmb

# df = ...

model = bmb.Model(
    'outcome ~ 0 + group + group:height+ (1|area)',
    data=df,
    family='bernoulli'
)
model.build()
model.fit(chains=4, cores=2)
  • PyMC == 5.26.1 or 5.27.0: Can train with either cores >= 1.
  • PyMC >= 5.27.1: Can train with cores == 1; cannot train with cores > 1

When using a version of PyMC that fails, the (python) processes briefly appear in top using CPU, then a second later they go to zero usage or disappear, without control returning to JupyterLab. No error or other output is encountered. It just hangs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions