Skip to content

Conversation

@Gattocrucco
Copy link
Collaborator

Right now the multichain implementation is completely at the interface level in mc_gbart with a big fat vmap over everything. This was convenient to set it up quickly but has the following issues:

  • when optimizing profiling mode, the vmap-of-jit seemed to create a lot of overhead
  • difficult to debug and optimize, and right now multichain seems slow
  • the internal interface is supposed to be usable standalone so it should have all the important features
  • automatic batch size setting should have access to the number of chains

This PR implements multichain directly at the level of the mcmcstep module.

I removed it because it is static and static attributes are a pain to
deal with in the multichain implementation, they don't play nicely with
vmap. I will remove the other static attributes in the next commits.
In ended up supporting static fields, so deleting Kind and moving around
the batch sizes was not necessary, but the current version looks better
so whatever.
This commit changes the previous object-oriented multichain support with
a more general and lightweight functional implementation based on
pytrees.
Copy link
Collaborator Author

@Gattocrucco Gattocrucco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested; marked them locally.

@Gattocrucco Gattocrucco marked this pull request as ready for review January 3, 2026 00:08
Copy link
Collaborator Author

@Gattocrucco Gattocrucco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All ok.

@Gattocrucco Gattocrucco merged commit fee93fb into main Jan 3, 2026
8 checks passed
@Gattocrucco Gattocrucco deleted the multichain-mcmcstep branch January 3, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants