Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing batch sampling #416

Merged
merged 20 commits into from
Dec 1, 2022
Merged

Fixing batch sampling #416

merged 20 commits into from
Dec 1, 2022

Conversation

segasai
Copy link
Collaborator

@segasai segasai commented Nov 29, 2022

This PR started as a fix to #415 , but because of the issue i thought we need to refactor that code,
so I've now completely separated the creation of the batch_sampler in a distinct method that makes things much easier to understand.
Also I've added more tests, some of which would have been tripped before the #415 fix

Separate the creation of the batch_sampler in a separate internal method.
While doing that some small issues related to the nc= values were fixed.
@coveralls
Copy link

coveralls commented Nov 29, 2022

Pull Request Test Coverage Report for Build 3596317313

  • 122 of 127 (96.06%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 91.729%

Changes Missing Coverage Covered Lines Changed/Added Lines %
py/dynesty/sampler.py 1 3 33.33%
py/dynesty/dynamicsampler.py 120 123 97.56%
Totals Coverage Status
Change from base Build 3559835188: 0.1%
Covered Lines: 4048
Relevant Lines: 4413

💛 - Coveralls

was confusing whether b refers to batch or base. Furthermore
what was needed is just nlive_new
also get rid of blob in the IteratorShort as that is not
used for anything other than printing
update the selection of the upper boundary for batch selection
@segasai segasai requested a review from joshspeagle November 29, 2022 23:17
@segasai
Copy link
Collaborator Author

segasai commented Nov 30, 2022

Any comments @joshspeagle, otherwise I'll merge and aim to push a quick release, as the performance issue is pretty substantial.

@joshspeagle
Copy link
Owner

Unfortunately, I don't have time for a detailed review on this over the next day or two, so I'd say just merge this in to go for the performance improvement (well, some return to some past performance + all the additional changes).

Thanks as always for continuing to clean up all the internals. The code is so much easier to work with now compared to when you first started taking a hammer to things.

@segasai segasai merged commit a24b5c3 into master Dec 1, 2022
@segasai segasai deleted the batch_performance_fix branch December 26, 2022 15:43
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.

3 participants