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

Large memory use of model_utils.yield_stdev #409

Open
1 of 2 tasks
alexander-held opened this issue May 31, 2023 · 1 comment
Open
1 of 2 tasks

Large memory use of model_utils.yield_stdev #409

alexander-held opened this issue May 31, 2023 · 1 comment
Labels
performance Related to performance

Comments

@alexander-held
Copy link
Member

alexander-held commented May 31, 2023

This is a partial follow-up to #315. @ekauffma found that the yield uncertainty calculation can use a large amount of memory. This ultimately is due to using awkward instead of pure numpy: scikit-hep/awkward#2480. awkward is not strictly needed, but was used for convenience instead. Giving the impact of the effect, it makes sense to switch to pure numpy though. This is done in the following PR:

In addition to this, @ekauffma found that splitting the calculation across channels can significantly improve performance.

  • implement this split

Additional performance improvements may be achieved via #415.

@ekauffma
Copy link
Contributor

ekauffma commented Jun 6, 2023

I did a quick study to understand the differences with using awkward vs numpy in yield_stdev using this workspace here.

First I kept the number of channels constant and changed the number of parameters, measuring the maximum memory usage during the function using memory-profiler and measuring the time and saw the following results:
akvnp_para

Then I kept the number of parameters constant by removing the staterror modifiers and varied the number of channels:
akvnp_chan

I believe that a per-channel split will also help because it implicitly reduces the number of parameters per matrix computation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Related to performance
Projects
None yet
Development

No branches or pull requests

2 participants