Skip to content

Batching evaluation of yield variations in yield uncertainty calculation #325

Open
@alexander-held

Description

@alexander-held

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceRelated to performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions