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

Speed up test.sample.test_sample.test_pipeline #1208

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Nov 21, 2023

There is really no need to run pypesto.visualize.sampling.sampling_1d_marginals over 20 times.

It seems this was the cause of #1077. In some cases, plotting takes over 10min (cancelled at some point, not sure it would ever complete). Maybe somebody using this function would like to investigate that further...

There is really no need to run `pypesto.visualize.sampling.sampling_1d_marginals` over 20 times.

It seems this was the cause of ICB-DCM#1077. In some cases, plotting takes over 10min (cancelled at some point, not sure it would ever complete).
Maybe somebody using this function would like to investigate that further...
@dweindl dweindl requested a review from dilpath as a code owner November 21, 2023 13:06
@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a280f4b) 84.08% compared to head (f1a61b3) 84.09%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1208   +/-   ##
========================================
  Coverage    84.08%   84.09%           
========================================
  Files          148      148           
  Lines        11775    11775           
========================================
+ Hits          9901     9902    +1     
+ Misses        1874     1873    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dweindl
Copy link
Member Author

dweindl commented Nov 21, 2023

For example:

904.16s call test/sample/test_sample.py::test_pipeline[Emcee-gaussian]

image

Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

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

Agreed, I don't see a need for any testing of visualization here, it's tested elsewhere.

904.16s call test/sample/test_sample.py::test_pipeline[Emcee-gaussian]

I'm surprised this took so long. It should be plotting just 1000 (n_walkers * n_samples) samples in total, for a single parameter...

@dweindl
Copy link
Member Author

dweindl commented Nov 21, 2023

I'm surprised this took so long. It should be plotting just 1000 (n_walkers * n_samples) samples in total, for a single parameter...

Ditto. Might be good to dig deeper. The two times I was able to reproduce long run times were both with emcee. The second time was "only" 210.49s, though. Maybe seaborn / mpl is doing something funny there, not sure.

@dweindl dweindl merged commit 2d95ca4 into ICB-DCM:develop Nov 21, 2023
15 of 17 checks passed
@dweindl dweindl deleted the fix_timeout_sample branch November 21, 2023 13:38
@dilpath
Copy link
Member

dilpath commented Nov 21, 2023

I'm surprised this took so long. It should be plotting just 1000 (n_walkers * n_samples) samples in total, for a single parameter...

Ditto. Might be good to dig deeper. The two times I was able to reproduce long run times were both with emcee. The second time was "only" 210.49s, though. Maybe seaborn / mpl is doing something funny there, not sure.

Looks like it, I can plot a histogram with matplotlib almost immediately, but seaborn takes a lot of time, when using a vector of parameter samples from test/sample/test_sample.py::test_pipeline[Emcee-gaussian]. Might be worth switching to matplotlib then.

Regarding the variability, this seems to be dependent on the number of burn-in (Geweke test) samples removed from the visualization.

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