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
overriding inefficient CalosubdetectorGeometry::present function #22205
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-22205/3352 |
A new Pull Request was created by @Sam-Harper for master. It involves the following packages: Geometry/EcalAlgo @cmsbuild, @civanch, @Dr15Jones, @ianna, @mdhildreth can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
@Sam-Harper |
The tests are being triggered in jenkins. |
@Sam-Harper |
Yes ! |
yep, done, same branch works in both |
@ianna this is urgent, could you please check? |
Comparison job queued. |
Sam, couldn't you fix this for everyone at once using an std::unordered_set to contain the list of detids Sunanda is currently iterating through? This would avoid virtual functions and fix it everywhere at once. |
@fabozzi reported that the increase in timing in RECO is not noticeable in fullsim pile-up MC relvals of 10_0_0 with respect to 10_0_0_pre3. Consistent w/ the expectation that the time increase is additive and not multiplicative of the overall time of a give cmsRun. |
Comparison is ready @slava77 comparisons for the following workflows were not done due to missing matrix map:
Comparison Summary:
|
Just for the record from the review of the original feature by Sunanda (from Dec 16)
the cost to reco is small |
okay so glad to hear it doesnt impact reco, this is good. I was wondering why there werent more complaints. @lgray : its already a virtual function so I didnt see any harm in overriding it. I agree that they should have used an unordered_set or to be honest, anything else! However I leave it to @bsunanda to that. I needed a quick fix for my studies, I made one and if people dont like it, then the person who caused the problem can fix it :) |
@lgray as far as I can see, ::present it is already overridden in other specialized geometries, so this PR addresses the cases where it was relying directly on the inefficient base implementation. Pending a possible more general solution by @bsunanda (m_validIds is a vector since Run1) do you see drawbacks in integrating this now? I understand that while this is not an issue for RECO, it is for HLT timing studies, and it should be fixed in a relatively short time. |
@Dr15Jones @civanch @ianna could someone for geometry check and comment or sign? This is essentially a performance issue not supposed to change the code output (as also shown by tests) |
+1 |
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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
First, I suspect this is a blocker for all 10_X MC production as it will take a larger than expected CPU time which may or may not be significant.
Also this is a bit of a drive by bug fix as I happened to come across it and needed it fixed for my own purposes. If this fix requires things beyond what is already here, I'm sure @bsunanda as the author of the problem PR will be able to assist in fixing it promptly.
#21808 updated the CalosubdetectorGeometry::present function with an non-optimally coded version (it has a vector of all valid DetIds and basically compares the current DetId one by one with these to see if its valid).
This cripples the HLT from a timing perspective (doubles it) due to PFRecHit associating its neighbours which involves a lot of calo topology operations which each time requires a call to CalosubdetectorGeometry::present to check its a valid ID. It surprises me that it does not also significantly impact RECO timing, something is odd here. Regardless the HLT timing issue is real and needs to be urgently fixed. This PR solves the issue.
igprof: pre this PR (10_0_1, HLT Physics sample): http://sharper.web.cern.ch/sharper/cgi-bin/igprof-navigator/1001HLTTiming/igreport_default
igprof: post this PR (10_0_1, HLT Physics sample): http://sharper.web.cern.ch/sharper/cgi-bin/igprof-navigator/1001HLTTiming/igreport_ecalGeomFix
Time from ~500ms / event to 250 ms / event based on 1K input.
@Martin-Grunewald FYI