Skip to content

Add Poisson Bootstrapping Capabilities - #148

Open
kevScheuer wants to merge 1 commit into
masterfrom
poissonBootstrap
Open

kevScheuer wants to merge 1 commit into
masterfrom
poissonBootstrap

Conversation

@kevScheuer

Copy link
Copy Markdown
Collaborator

Summary

Previously, if a user wanted to resample their signal (and background) files, they would need to create an entirely new AmpToolsInterface object for every bootstrap sample. This was very slow due to unnecessary reloading of events and calculations. This PR allows one to maintain the same AmpToolsInterface, events, and user variables by simply re-weighting all samples via Poisson Bootstrapping. In short, the user calls AmpToolsInterface::bootstrap and every event $i$ with weight $w_i$ gets re-weighted as $w_i = w_i * p_i$ where effectively:

  • $p_i = 0$: the event is removed
  • $p_i = 1$: the event is kept
  • $p_i = N>1$: the event is repeated $N$ times

This technique also bootstrap samples the accepted phasespace MC, providing an estimate of the uncertainties regarding acceptance. Thanks to @mashephe for the suggestion to implement this technique.

Code Changes

Listed below are some descriptions of the file changes that were needed, outside of the functions that directly implement the bootstrap capability.

  • GPUManager
    • memcpy-ing of weights factored out in stand alone function so AmpVecs can call it following a re-weight
  • AmpVecs
    • Original weights stored when loaded for subsequent bootstrap calls to reference
  • AmplitudeManager
    • added a safeguard against divide by zero situations that now occur due to this technique
  • LikelihoodCalculator
    • m_normInt promoted to protected variable so LikelihoodCalculatorMPI could access it.
  • NormIntInterface
    • setGen/AccEvents made const, otherwise a cascade of other functions would have their const protection removed
  • NormIntInterfaceMPI
    • counting of weights factored out of the setup, as weights of course change following the bootstrap

GPU vs CPU+MPI testing

I can confirm that the GPU and CPU(+MPI) fits work, but noticed that the MPI jobs were very very slow compared to the GPU. The fits themselves converged in a matter of seconds in both cases, but in between fits the MPI job was slow.
I do not typically run CPU+MPI jobs, so this may have been due to the resources (10 tasks, 5GB each), but perhaps others who do can test it out.

@kevScheuer

Copy link
Copy Markdown
Collaborator Author

GlueX users who want to test this can use the accompanying updates I've made in a halld_sim branch to the fitting programs: fit.cc and fitMPI.cc

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant