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

Spedup HCAL Digitization #40634

Merged
merged 7 commits into from Feb 20, 2023
Merged

Spedup HCAL Digitization #40634

merged 7 commits into from Feb 20, 2023

Conversation

VinInn
Copy link
Contributor

@VinInn VinInn commented Jan 28, 2023

Speed up HcalSiPMHitResponse::makeSiPMSignal by a factor 3.5
Verified using debug statement that result (signal) is the same!

Some more speed-up could be obtained using single precision float everywhere and trying to vectorize some loops.

current bottleneck is CLHEP::RandPoissonQ::poissonDeviateSmall

igprof
before
http://innocent.web.cern.ch/innocent/perfResults/igprof-navigator/digiDebug1T_ori_CMSSW_13_0_X_2023-01-26-2300_slc7_amd64_gcc11/24
after (i.e. this PR)
http://innocent.web.cern.ch/innocent/perfResults/igprof-navigator/digiDebug1T_hcal4_CMSSW_13_0_X_2023-01-26-2300_slc7_amd64_gcc11/69

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40634/33929

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @VinInn (Vincenzo Innocente) for master.

It involves the following packages:

  • CondFormats/HcalObjects (db, alca)
  • SimCalorimetry/HcalSimAlgos (simulation)

@malbouis, @civanch, @yuanchao, @mdhildreth, @cmsbuild, @saumyaphor4252, @ggovi, @tvami, @ChrisMisan, @francescobrivio can you please review it and eventually sign? Thanks.
@rovere, @bsunanda, @tocheng, @mmusich, @sameasy, @abdoulline, @mariadalfonso, @seemasharmafnal this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@ChrisMisan
Copy link
Contributor

ChrisMisan commented Jan 28, 2023

type hcal, performance-improvement

@ChrisMisan
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: RelVals-INPUT
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2f6ac1/30226/summary.html
COMMIT: 8afabdc
CMSSW: CMSSW_13_0_X_2023-01-28-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/40634/30226/install.sh to create a dev area with all the needed externals and cmssw changes.

RelVals-INPUT

  • 11630.011630.0_QCD_Pt_3000_3500_14TeV+2021/step2_QCD_Pt_3000_3500_14TeV+2021.log
  • 11723.1711723.17_QCD_Pt_1800_2400_14+2021_seedingDeepCore/step2_QCD_Pt_1800_2400_14+2021_seedingDeepCore.log

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3090 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3555495
  • DQMHistoTests: Total failures: 6899
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3548574
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 211 log files, 162 edm output root files, 49 DQM output files
  • TriggerResults: found differences in 2 / 47 workflows

@abdoulline
Copy link

Hi @kpedro88,
may be you could take a look (at your convenience)?

@VinInn
Copy link
Contributor Author

VinInn commented Jan 29, 2023

I can speed up HcalSiPMHitResponse::addPEnoise by a factor 4x using a custom poisson generator
see [2] in #40636

@VinInn
Copy link
Contributor Author

VinInn commented Jan 30, 2023

HcalSiPMHitResponse::addPEnoise definitively needs a fix:
the average is 5.5e-05 : the poisson result is essentially always 0

@davidlange6
Copy link
Contributor

given also that the same mean is used repeatedly, perhaps that special handling of a poisson distro belongs in addPENoise itself? It looks like that for small lambdas, the most expensive computation is exp(-lambda) - then its just a single uniform random number per value.

@VinInn
Copy link
Contributor Author

VinInn commented Jan 30, 2023

@davidlange6 : this is what I've already done in #40636. (factor 4 in speed as it throws just one random number and compute exp once per call (one can even avoid that easily)

I would prefer NOT to change random number sequence here to avoid divergences and regression that may require more validation.
I can commit here if preferred

@davidlange6
Copy link
Contributor

In practice, I don't see how to avoid changing the random number sequence here even if some logic was moved into the random number generator itself.... make a separate PR for it?

@VinInn
Copy link
Contributor Author

VinInn commented Jan 30, 2023 via email

@perrotta
Copy link
Contributor

please abort

@VinInn
Copy link
Contributor Author

VinInn commented Feb 20, 2023

I rebased changing the master.now is clean

@VinInn
Copy link
Contributor Author

VinInn commented Feb 20, 2023

@cmsbuild , please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2f6ac1/30749/summary.html
COMMIT: e43317c
CMSSW: CMSSW_13_1_X_2023-02-19-2300/el8_amd64_gcc11
Additional Tests: THREADING
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/40634/30749/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 6 lines from the logs
  • Reco comparison results: 3229 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3529029
  • DQMHistoTests: Total failures: 6582
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3522425
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 213 log files, 164 edm output root files, 49 DQM output files
  • TriggerResults: found differences in 2 / 47 workflows

@tvami
Copy link
Contributor

tvami commented Feb 20, 2023

+1

  • resign

@perrotta
Copy link
Contributor

@civanch the last update is quite simple: I think you can re-sign, unless you have doubts about it

@civanch
Copy link
Contributor

civanch commented Feb 20, 2023

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

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.

None yet