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

Batching evaluation of yield variations in yield uncertainty calculation #325

Open
alexander-held opened this issue Feb 10, 2022 · 0 comments
Labels
performance Related to performance

Comments

@alexander-held
Copy link
Member

alexander-held commented Feb 10, 2022

Maybe you already looked into it @alexander-held (if so, sorry for the noise), but I had a little bit of time and I tried out also vectorizing the initial setup of the yield variations (including batching the pyhf Model evaluation).
It does give some more improvement: my example went from 0.15s per call when using the perf/yield-uncertainty-vectorization version to 0.1s per call. That could be halved if the input model is already set up with the right batch size, so the function does not need to re-create it. (Though I think in most cases one might not want to bother)
Here is the implementation: gist.

Originally posted by @lhenkelm in #315 (comment)

Context:
As discussed in #315, the calculation of yield uncertainties can be sped up significantly. #316 vectorizes the most computationally expensive part of the calculation, resulting in significant improvements. After that change, the performance bottleneck is the initial setup of all yields for all variations. This can be improved by using a model that allows batched calls to also vectorize the remaining part of the implementation.

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

1 participant