TuringLang / TuringLang/AbstractMCMC.jl

Error when using MCMCEnsemble on models containing Module types

Open
#89 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
108
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Originally detected in https://github.com/HighDimensionalEconLab/HMCExamples.jl/issues/28.

Essentially, we generate a Module and use that as a pseudo-function struct, but its inclusion in the model means that the model deepcopy

https://github.com/TuringLang/AbstractMCMC.jl/blob/56431bd4298bac6ad324dd47dc3162cf49c45626/src/sample.jl#L305

fails as Module cannot be deepcopied. Unfortunately it's a little tricky to detect this kind of weird case in advance. Perhaps it would be nice to add keywords disabling any of the deepcopy calls for users who don't mind so much?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/sample.jl around line 305 and reproduce the failure with MCMCEnsemble on a model containing a Module, using the linked HMCExamples.jl issue for context. Trace which deepcopy call fails and determine the expected behavior for models that cannot be deepcopied; the issue is done when that behavior is defined and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.