Skip to content

Conversation

guitargeek
Copy link
Contributor

The RooAbsReal::getPropagatedError() function was using some of the
most expensive operations in RooFit for larger computation graphs:
cloning the model, and figuring out parameters and observables.

This was done for no apparent reason, as the RooAbsReal is not mutated
by getPropagaterError. Parameter values are slightly changed for
reevaluation, but they are reset right after. A final call to getVal()
is enough to reset the original state, which is much more efficient than
cloning everything.

This change was motivated by the following forum post:
https://root-forum.cern.ch/t/getpropagatederror-method-taking-too-long-to-run/50392

@guitargeek guitargeek self-assigned this Jun 15, 2022
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-1.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2022-06-15T00:10:09.933Z] CMake Error at /mnt/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1083 (message):

@guitargeek guitargeek force-pushed the getPropagatedError_1 branch from 21879fc to d78f5b3 Compare June 15, 2022 00:20
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-1.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2022-06-15T00:23:10.195Z] CMake Error at /mnt/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1083 (message):

@phsft-bot
Copy link

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

The `RooAbsReal::getPropagatedError()` function was using some of the
most expensive operations in RooFit for larger computation graphs:
cloning the model, and figuring out parameters and observables.

This was done for no apparent reason, as the `RooAbsReal` is not mutated
by `getPropagaterError`. Parameter values are slightly changed for
reevaluation, but they are reset right after. A final call to `getVal()`
is enough to reset the original state, which is much more efficient than
cloning everything.

This commit also adds a check if the parameters in the RooAbsReal have
the same values as in the fit result (otherwise the logic of
getPropagatedError() is broken).

This change was motivated by the following forum post:
https://root-forum.cern.ch/t/getpropagatederror-method-taking-too-long-to-run/50392
@guitargeek guitargeek force-pushed the getPropagatedError_1 branch from d78f5b3 to 7979d21 Compare June 15, 2022 10:42
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

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

LGTM!
I agree it is better not cloning the model and just re-evaluate it with the initial parameter values to have the same state as before.

@phsft-bot
Copy link

Build failed on mac1015/cxx17.
Running on macitois21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@guitargeek guitargeek merged commit 565e9aa into root-project:master Jun 15, 2022
@guitargeek guitargeek deleted the getPropagatedError_1 branch June 15, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants