Refactoring away from BaseTrace
/MultiTrace
#5391
Replies: 3 comments 3 replies
-
I'm not in favor of switching to McBackend, if anything we maybe should just switch to |
Beta Was this translation helpful? Give feedback.
-
I would need more info to be able to discuss this. What are the pros, what are the drawbacks, and what other alternatives are out there. More importantly what immediate problem (if any) does this solve already. |
Beta Was this translation helpful? Give feedback.
-
Pros ➕Cleaner code in
|
Beta Was this translation helpful? Give feedback.
-
Can I get a distribution of gut feelings around BaseTrace and MultiTrace?
👉 Are we in favor of refactoring the inner workings in
sampling.py
away from them and towards the McBackend interfaces?👉 How important is backwards compat for passing
pm.sample(trace=...)
? (A hard break/switch fromBaseTrace/MultiTrace
tomcbackend.Backend
is a lot easier to realize.)Specifically, the tricky parts are the signatures of the various internal functions inside the sampling control flow as well as the different initialization behavior of
BaseTrace
vsmcbackend.Chain
:BaseTrace
is initialized by a mix of its constructor logic and a call to.setup()
. The constructor called once before (typically) the object is deep-copied for all chains. Then.setup()
is called once per chain.Run
. ViaRun().init_chain(chain_number)
the chains are then initialized all from the same metadata. No deepcopy involved.Beta Was this translation helpful? Give feedback.
All reactions