Skip to content

[RF] Follow up on "RooFit::MultiProcess & TestStatistics part 5b: test RooGradMinimizerFcn"#8940

Merged
guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:RooFit_MultiProcess_PR_5b_fix_testRooGradMinimizerFcn_followup
Sep 1, 2021
Merged

[RF] Follow up on "RooFit::MultiProcess & TestStatistics part 5b: test RooGradMinimizerFcn"#8940
guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:RooFit_MultiProcess_PR_5b_fix_testRooGradMinimizerFcn_followup

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

This is a follow up on #8694, implementing the requests made in the PR review.

More details in the commit messages.

Turning some observables into parameters in the GradMinimizer.BranchingPDF test should not reduce the coverage of the test, because for the minimizer the model actually gets more complex where there are more parameters.

@phsft-bot

Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot

Copy link
Copy Markdown

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

Failing tests:

@phsft-bot

Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-08-31T17:20:32.470Z] C:\build\workspace\root-pullrequests-build\root\roofit\roofitcore\test\test_lib.h(64,15): error C2131: expression did not evaluate to a constant [C:\build\workspace\root-pullrequests-build\build\roofit\roofitcore\test\testRooGradMinimizerFcn.vcxproj]
  • [2021-08-31T17:20:32.470Z] C:\build\workspace\root-pullrequests-build\root\roofit\roofitcore\test\test_lib.h(64,25): error C2131: expression did not evaluate to a constant [C:\build\workspace\root-pullrequests-build\build\roofit\roofitcore\test\testRooGradMinimizerFcn.vcxproj]
  • [2021-08-31T17:20:32.470Z] C:\build\workspace\root-pullrequests-build\root\roofit\roofitcore\test\test_lib.h(66,56): error C3863: array type 'double [n]' is not assignable [C:\build\workspace\root-pullrequests-build\build\roofit\roofitcore\test\testRooGradMinimizerFcn.vcxproj]
  • [2021-08-31T17:20:32.470Z] C:\build\workspace\root-pullrequests-build\root\roofit\roofitcore\test\test_lib.h(67,68): error C3863: array type 'double [n]' is not assignable [C:\build\workspace\root-pullrequests-build\build\roofit\roofitcore\test\testRooGradMinimizerFcn.vcxproj]

@egpbos

egpbos commented Sep 1, 2021

Copy link
Copy Markdown
Contributor

I think I made up the BranchingPDF test myself as a sort of stress test, also for benchmarking purposes, but not based on realistic physics models. Perhaps good to check whether it makes sense at all (conceptually, as a representative of a real kind of model) to keep it. If not, maybe just ditch it.

@lmoneta lmoneta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, I require just to not move away from using std::vector in the test program

Comment thread roofit/roofitcore/test/test_lib.h Outdated

// create gaussian parameters
std::vector<double> mean(n), sigma(n);
double mean[n], sigma[n];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why this change ?
n seems not to be a const int and it is not known at compile time. It will not work for some compilers (e.g. Windows)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, that was an accident! Originally, this PR started as a revert of Patricks last commit, but I see in the tests I reverted too much. Thanks for spotting this

This is a follow up on commits 1e452a8 and 1e452a8, almost reverting
the second commit completely.

It addresses the following comments by @guitargeek made in PR root-project#8694:

1. I think it's better if the new overloads of `DoDerivative` and
   `Gradient` that take also the previous gradients have a different
   names like `DoDerivativeWithPrevResult` and `GradientWithPrevResult`
   to avoid the member shadowing problem when only the original
   `DoDerivative` and `Gradient` functions are overridden. Then you
   don't have to add all these trivial implementations of the new
   functions in 1e452a8, and we also don't create warnings for
   users that are implementing these IFunctions.

2. We should avoid changing existing public interfaces if not necessary.
   In 1e452a8, you changed the interface of
   `NumericalDerivator::SetInitialGradient`, but it's not absolutely
   necessary. In the `RooGradMinimizerFcn`, you can just pass a
   `nullptr` as the first parameter to avoid the problem that you
   described in the message of commit 1e452a8.
The speedup is achieved by reducing the number of observables in the
model, meaning less numeric integration is necessary.

This was done because originally, the GradMinimizer.BranchingPDF test
took between 3 and 5 minutes to run, depending on the setup.
@guitargeek
guitargeek force-pushed the RooFit_MultiProcess_PR_5b_fix_testRooGradMinimizerFcn_followup branch from 8fa9b95 to fd28c8f Compare September 1, 2021 16:35
@phsft-bot

Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot

Copy link
Copy Markdown

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

Failing tests:

@guitargeek
guitargeek merged commit 6b33e04 into root-project:master Sep 1, 2021
@guitargeek
guitargeek deleted the RooFit_MultiProcess_PR_5b_fix_testRooGradMinimizerFcn_followup branch September 1, 2021 21:36
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.

4 participants