Skip to content

BUG: sample_smc can lead to compilation halting #8022

@tvwenger

Description

@tvwenger

Describe the issue:

I upgraded to pymc 5.27.0 and noticed that my models do not sample with sample_smc nearly as efficiently. I just confirmed this on a fresh install and running the model from https://www.pymc.io/projects/examples/en/latest/samplers/SMC2_gaussians.html

Using pymc=5.23.0, each chain starts up right away and completes sampling within 10 seconds. The output is:

Chain 0  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 1  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 2  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 3  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 4  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 5  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 6  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 7  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 8  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 9  ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 10 ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000
Chain 11 ⠸ -:--:-- / 0:00:09 Stage: 0 Beta: 1.000

Using pymc=5.27.0, chains take almost 1 minute to start, and they do not all start at the same time, and they take longer to finish. The output is

Chain 0  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 1  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 2  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 3  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 4  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 5  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 6  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 7  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 8  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 9  ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 10 ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000
Chain 11 ⠦ -:--:-- / 0:01:39 Stage: 0 Beta: 1.000

Reproduceable code example:

https://www.pymc.io/projects/examples/en/latest/samplers/SMC2_gaussians.html

Error message:

PyMC version information:

5.27.0

Context for the issue:

There is a 10x runtime increase in sample_smc between 5.23.0 and 5.27.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions