From ff49594a3198b2e288c03ab517ca6b06cecf17f6 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Wed, 28 Feb 2018 17:50:03 +0100 Subject: [PATCH] Add workflows for Riemann fit and GPU (#20) * add `riemannFit` and `gpu` modifiers and workflows for Riemann fit and GPU modules * switch GPU modules with `gpu` modifier --- .../ProcessModifiers/python/gpu_cff.py | 5 +++++ .../ProcessModifiers/python/riemannFit_cff.py | 5 +++++ .../PyReleaseValidation/python/relval_2017.py | 2 +- .../python/relval_steps.py | 16 ++++++++++++++ .../python/relval_upgrade.py | 7 ++++-- .../python/upgradeWorkflowComponents.py | 22 +++++++++++++++++++ .../python/SiPixelRawToDigi_cfi.py | 5 +++++ .../python/SiPixelClusterizer_cfi.py | 4 ++++ .../python/SiPixelRecHits_cfi.py | 4 ++++ 9 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 Configuration/ProcessModifiers/python/gpu_cff.py create mode 100644 Configuration/ProcessModifiers/python/riemannFit_cff.py diff --git a/Configuration/ProcessModifiers/python/gpu_cff.py b/Configuration/ProcessModifiers/python/gpu_cff.py new file mode 100644 index 0000000000000..993f71804fbc1 --- /dev/null +++ b/Configuration/ProcessModifiers/python/gpu_cff.py @@ -0,0 +1,5 @@ +import FWCore.ParameterSet.Config as cms + +# This modifier is for replacing CPU modules with GPU counterparts + +gpu = cms.Modifier() diff --git a/Configuration/ProcessModifiers/python/riemannFit_cff.py b/Configuration/ProcessModifiers/python/riemannFit_cff.py new file mode 100644 index 0000000000000..f97f50df63fb6 --- /dev/null +++ b/Configuration/ProcessModifiers/python/riemannFit_cff.py @@ -0,0 +1,5 @@ +import FWCore.ParameterSet.Config as cms + +# This modifier is for replacing the default pixel track "fitting" with Riemann fit + +riemannFit = cms.Modifier() diff --git a/Configuration/PyReleaseValidation/python/relval_2017.py b/Configuration/PyReleaseValidation/python/relval_2017.py index 92a39b4fd5620..d2adb4235a00f 100644 --- a/Configuration/PyReleaseValidation/python/relval_2017.py +++ b/Configuration/PyReleaseValidation/python/relval_2017.py @@ -27,7 +27,7 @@ 10024.1,10024.2,10024.3,10024.4,10024.5, 10801.0,10802.0,10803.0,10804.0,10805.0,10806.0,10807.0,10808.0,10809.0,10859.0,10871.0, 10842.0,10824.0,10825.0,10826.0,10823.0,11024.0,11025.0,11224.0, - 10824.1,10824.5, + 10824.1,10824.5,10824.7,10824.8, 10824.6,11024.6,11224.6, 11642.0,11624.0,11625.0,11626.0,11623.0,11824.0,11825.0,12024.0] for numWF in numWFIB: diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index e280432ad5743..720384f73433e 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -1518,6 +1518,12 @@ def gen2018HiMix(fragment,howMuch): '--datatier': 'GEN-SIM-RECO,DQMIO', '--eventcontent': 'RECOSIM,DQM', } +step3_riemannFit = { + '--procModifiers': 'riemannFit', +} +step3_gpu = { + '--procModifiers': 'gpu', +} step3_trackingLowPU = { '--era': 'Run2_2016_trackingLowPU' } @@ -2387,6 +2393,16 @@ def gen2018HiMix(fragment,howMuch): if 'Reco' in step: upgradeStepDict[stepName][k] = merge([step3_pixelTrackingOnly, upgradeStepDict[step][k]]) elif 'HARVEST' in step: upgradeStepDict[stepName][k] = merge([{'-s': 'HARVESTING:@trackingOnlyValidation'}, upgradeStepDict[step][k]]) + for step in upgradeSteps['pixelTrackingOnlyRiemannFit']['steps']: + stepName = step + upgradeSteps['pixelTrackingOnlyRiemannFit']['suffix'] + if 'Reco' in step: upgradeStepDict[stepName][k] = merge([step3_riemannFit, step3_pixelTrackingOnly, upgradeStepDict[step][k]]) + elif 'HARVEST' in step: upgradeStepDict[stepName][k] = merge([{'-s': 'HARVESTING:@trackingOnlyValidation'}, upgradeStepDict[step][k]]) + + for step in upgradeSteps['pixelTrackingOnlyGPU']['steps']: + stepName = step + upgradeSteps['pixelTrackingOnlyGPU']['suffix'] + if 'Reco' in step: upgradeStepDict[stepName][k] = merge([step3_gpu, step3_pixelTrackingOnly, upgradeStepDict[step][k]]) + elif 'HARVEST' in step: upgradeStepDict[stepName][k] = merge([{'-s': 'HARVESTING:@trackingOnlyValidation'}, upgradeStepDict[step][k]]) + for step in upgradeSteps['trackingRun2']['steps']: stepName = step + upgradeSteps['trackingRun2']['suffix'] if 'Reco' in step and upgradeStepDict[step][k]['--era']=='Run2_2017': diff --git a/Configuration/PyReleaseValidation/python/relval_upgrade.py b/Configuration/PyReleaseValidation/python/relval_upgrade.py index a98c1d027dc7a..be9eaef447e01 100644 --- a/Configuration/PyReleaseValidation/python/relval_upgrade.py +++ b/Configuration/PyReleaseValidation/python/relval_upgrade.py @@ -57,7 +57,7 @@ def makeStepName(key,frag,step,suffix): # special workflows for tracker if (upgradeDatasetFromFragment[frag]=="TTbar_13" or upgradeDatasetFromFragment[frag]=="TTbar_14TeV") and not 'PU' in key and hasHarvest: # skip ALCA - trackingVariations = ['trackingOnly','trackingRun2','trackingOnlyRun2','trackingLowPU','pixelTrackingOnly'] + trackingVariations = ['trackingOnly','trackingRun2','trackingOnlyRun2','trackingLowPU','pixelTrackingOnly','pixelTrackingOnlyRiemannFit','pixelTrackingOnlyGPU'] for tv in trackingVariations: stepList[tv] = filter(lambda s : "ALCA" not in s, stepList[tv]) workflows[numWF+upgradeSteps['trackingOnly']['offset']] = [ upgradeDatasetFromFragment[frag], stepList['trackingOnly']] @@ -65,7 +65,10 @@ def makeStepName(key,frag,step,suffix): for tv in trackingVariations[1:]: workflows[numWF+upgradeSteps[tv]['offset']] = [ upgradeDatasetFromFragment[frag], stepList[tv]] elif '2018' in key: - workflows[numWF+upgradeSteps['pixelTrackingOnly']['offset']] = [ upgradeDatasetFromFragment[frag], stepList['pixelTrackingOnly']] + for tv in trackingVariations: + if not "pixelTrackingOnly" in tv: + continue + workflows[numWF+upgradeSteps[tv]['offset']] = [ upgradeDatasetFromFragment[frag], stepList[tv]] # special workflows for HE if upgradeDatasetFromFragment[frag]=="TTbar_13" and '2018' in key: diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 32a5aa7e1825a..3c38d703faec3 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -130,6 +130,28 @@ 'suffix' : '_pixelTrackingOnly', 'offset' : 0.5, } +upgradeSteps['pixelTrackingOnlyRiemannFit'] = { + 'steps' : [ + 'RecoFull', + 'HARVESTFull', + 'RecoFullGlobal', + 'HARVESTFullGlobal', + ], + 'PU' : [], + 'suffix' : '_pixelTrackingOnlyRiemannFit', + 'offset' : 0.7, +} +upgradeSteps['pixelTrackingOnlyGPU'] = { + 'steps' : [ + 'RecoFull', + 'HARVESTFull', + 'RecoFullGlobal', + 'HARVESTFullGlobal', + ], + 'PU' : [], + 'suffix' : '_pixelTrackingOnlyGPU', + 'offset' : 0.8, +} upgradeSteps['Timing'] = { 'steps' : upgradeSteps['baseline']['steps'], 'PU' : upgradeSteps['baseline']['PU'], diff --git a/EventFilter/SiPixelRawToDigi/python/SiPixelRawToDigi_cfi.py b/EventFilter/SiPixelRawToDigi/python/SiPixelRawToDigi_cfi.py index 68ae0c1706807..538fd3dc97588 100644 --- a/EventFilter/SiPixelRawToDigi/python/SiPixelRawToDigi_cfi.py +++ b/EventFilter/SiPixelRawToDigi/python/SiPixelRawToDigi_cfi.py @@ -41,3 +41,8 @@ phase1Pixel.toModify(siPixelDigis, UsePhase1=True) phase1Pixel.toModify(siPixelDigisGPU, UsePhase1=True) +# In principle I would like to hide the name 'siPixelDigisGPU', but it +# is used in test/runRawToDigi_GPU_phase1.py which I also don't want +# to break +from Configuration.ProcessModifiers.gpu_cff import gpu +gpu.toReplaceWith(siPixelDigis, siPixelDigisGPU) diff --git a/RecoLocalTracker/SiPixelClusterizer/python/SiPixelClusterizer_cfi.py b/RecoLocalTracker/SiPixelClusterizer/python/SiPixelClusterizer_cfi.py index b0c4f59d6b5fa..56a91bd86716b 100644 --- a/RecoLocalTracker/SiPixelClusterizer/python/SiPixelClusterizer_cfi.py +++ b/RecoLocalTracker/SiPixelClusterizer/python/SiPixelClusterizer_cfi.py @@ -48,3 +48,7 @@ MissCalibrate = False, ElectronPerADCGain = cms.double(600.) # it can be changed to something else (e.g. 135e) if needed ) + +# to ensure reproducibility +from Configuration.ProcessModifiers.gpu_cff import gpu +gpu.toModify(siPixelClusters, payloadType = "HLT") diff --git a/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py b/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py index 4697f508948a6..495d6a5c84f55 100644 --- a/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py +++ b/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py @@ -1,5 +1,6 @@ import FWCore.ParameterSet.Config as cms +from RecoLocalTracker.SiPixelRecHits.SiPixelRecHitsGPU_cfi import siPixelRecHits as _siPixelRecHitsGPU siPixelRecHits = cms.EDProducer("SiPixelRecHitConverter", src = cms.InputTag("siPixelClusters"), CPE = cms.string('PixelCPEGeneric'), @@ -7,6 +8,9 @@ ) +from Configuration.ProcessModifiers.gpu_cff import gpu +gpu.toReplaceWith(siPixelRecHits, _siPixelRecHitsGPU) + siPixelRecHitsPreSplitting = siPixelRecHits.clone( src = 'siPixelClustersPreSplitting' )