-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
updates to customizeHLTforPatatrack
to limit overwriting of HLT modules
#36721
updates to customizeHLTforPatatrack
to limit overwriting of HLT modules
#36721
Conversation
type bugfix
|
process.hltEcalRecHit.cuda = process.hltEcalRecHit.cpu.clone( | ||
triggerPrimitiveDigiCollection = 'unused' | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bugfix for the handling of
process.hltEcalRecHit.cuda
(the bug was introduced in #36536).
After #36536, process.hltEcalRecHit.cuda
would be added only if process.hltEcalRecHit
was not a SwitchProducer in the input configuration. This condition is false in the latest menus, so for those process.hltEcalRecHit.cuda
was not being added.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36721/27818
|
A new Pull Request was created by @missirol (Marino Missiroli) for master. It involves the following packages:
@cmsbuild, @missirol, @Martin-Grunewald can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
elif hasattr(process.hltPixelTracksSoA, 'cpu'): | ||
# if cpu branch of SwitchProducerCUDA exists, take hltPixelTracksCUDA (gpu) | ||
# from hltPixelTracksSoA.cpu (cpu) to enforce same configuration parameters | ||
process.hltPixelTracksCUDA = process.hltPixelTracksSoA.cpu.clone( | ||
pixelRecHitSrc = "hltSiPixelRecHitsCUDA", | ||
onGPU = True | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This relates to the treatment of the value of process.hltPixelTracksSoA.idealConditions
. If process.hltPixelTracksSoA.cpu
already exists, it is not modified, and the GPU module (hltPixelTracksCUDA
) is configured based on process.hltPixelTracksSoA.cpu
.
You could define some helper functions to simplify the customisation: def load_if_mising(process, label, config):
if label not in process.__dict__:
process.load(config)
def load_if_missing_and_clone(_process, _config, _label, _alias = None, **kwargs):
if _alias is None:
_alias = _label
if _alias not in _process.__dict__:
module = __import__(_config, globals(), locals(), [ _label ], 0)
setattr(_process, _alias, getattr(module, _label).clone(**kwargs) to be used as # these should be used only on GPUs, will crash otherwise
load_if_mising(process, 'siPixelGainCalibrationForHLTGPU', 'CalibTracker.SiPixelESProducers.siPixelGainCalibrationForHLTGPU_cfi')
load_if_mising(process, 'siPixelROCsStatusAndMappingWrapperESProducer', 'CalibTracker.SiPixelESProducers.siPixelROCsStatusAndMappingWrapperESProducer_cfi')
...
# transfer the beamspot to the gpu
load_if_missing_and_clone(process, 'RecoVertex.BeamSpotProducer.offlineBeamSpotToCUDA_cfi', 'offlineBeamSpotToCUDA', 'hltOnlineBeamSpotToCUDA',
src = "hltOnlineBeamSpot"
) Please note that I did not test that they actually work... and maybe you can find more compact names :-) I didn't try to come up with something that support a |
Thanks for the suggestion, @fwyzard . I'm trying to implement it. What do you think about the following? # Utility to load file "config" in the process,
# if the process does not already hold a module named "label"
# Example:
# _load_if_missing(process, 'SomeESProducer', 'SubSystem.Package.SomeESProducer_cfi')
def _load_if_missing(process, label, config, check = True):
if label not in process.__dict__:
process.load(config)
if check and label not in process.__dict__:
raise Exception('process does not have a module labelled "'+label+'" after loading "'+config+'"')
# Utility to add "member" to "obj" (if "member" is missing),
# using a clone of module "label" from file "config"
# (if "label" is not specified, it is set equal to "member")
# Example:
# _clone_if_missing(process, 'hltMyFilter', 'SubSystem.Package.hltSomeFilter_cfi', 'hltSomeFilter', src = 'mySrc')
def _clone_if_missing(obj, member, config, label = None, **kwargs):
if label is None:
label = member
if not hasattr(obj, member):
module = __import__(config, globals(), locals(), [ label ], 0)
setattr(obj, member, getattr(module, label).clone(**kwargs)) The last function is slightly changed wrt to the original suggestion (also, from your snippet I didn't grasp if starting the function arguments with _clone_if_missing(process, 'hltOnlineBeamSpotToCUDA', 'RecoVertex.BeamSpotProducer.offlineBeamSpotToCUDA_cfi', 'offlineBeamSpotToCUDA',
src = "hltOnlineBeamSpot"
) and _clone_if_missing(process.hltSiPixelDigis, 'cuda', 'EventFilter.SiPixelRawToDigi.siPixelDigiErrorsFromSoA_cfi', 'siPixelDigiErrorsFromSoA',
digiErrorSoASrc = "hltSiPixelDigiErrorsSoA",
UsePhase1 = True
) .. so, one part of the SwitchProducer customisations. |
that's to make it less likely that a function argument would clash with an argument intended for |
I'd suggest
to make the naming more consistent among the two functions. |
1556946
to
e3f38a0
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36721/27996
|
Pull request #36721 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36721/28233
|
Pull request #36721 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again. |
please test Rebased, and improved handling of parameters for timing of ECAL RecHits (thanks to suggestions from Silvio and Andrea M.), in view of the upcoming updates in CMSHLT-2211. @amassiro (cc: @fwyzard, @silviodonato), please have a look at 579db0b, and let me know if you have comments/corrections. Note that, in this customisation, |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b93920/22313/summary.html GPU Comparison SummarySummary:
Comparison SummarySummary:
|
please test re-running the tests, as the latest IBs include updates to the HLT menu (wrt the last tests of this PR) |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b93920/22363/summary.html GPU Comparison SummarySummary:
Comparison SummarySummary:
|
+hlt
|
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, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
This PR updates
customizeHLTforPatatrack
to limit cases where the customisation overwrites modules that may already exist in the HLT menu (e.g. thecpu
'branch' of certain SwitchProducers).Reminder : currently, the HLT menu in
cmssw:master
contains the CPU part of the Patatrack developments (in other words, it contains SwitchProducers that only have acpu
branch, not acuda
one).With this update, if a certain object exists already, it is not overwritten anymore, giving precedence to what is in the input configuration (usually, the HLT menu from
ConfDB
).In particular, this resolves an action item from CMSHLT-2187, regarding the value of the parameter
hltPixelTracksSoA.cpu.idealConditions
; the latter is set toFalse
inConfDB
, but is currently changed toTrue
incustomizeHLTforPatatrack
; with this PR, the parameter remains as in the HLT menu if it is already present (i.e.False
with the latest menus).The PR also includes
customisePixelGainForRun2Input
, to ensure that the parameter(SiPixelRawToClusterCUDA).isRun2
is set toTrue
when Run-2 inputs are used (this would be needed once instances ofSiPixelRawToClusterCUDA
will come directly from the HLT config inConfDB
, withisRun2
set toFalse
);process.hltEcalRecHit.cuda
(the bug was introduced in makecustomizeHLTforPatatrack
even more robust #36536).Changes in outputs are expected for wfs where
customizeHLTforPatatrack
is applied to theGRun
menu, e.g. wf11634.{506,512,522}
(for example, because ofhltPixelTracksSoA.cpu.idealConditions
changing fromTrue
toFalse
).Profited from suggestions by @fwyzard.
FYI: @silviodonato
PR validation:
runTheMatrix.py -w gpu -l 11634.506,11634.512,11634.522
, plus manual tests withhltGetConfiguration [..] --customise [..]
.If this PR is a backport, please specify the original PR and why you need to backport that PR:
N/A