SegmentLinking / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1 stars 1 forks source link

Switch between CPU and CUDA backends without need to recompile the standalone #15

Closed VourMa closed 8 months ago

VourMa commented 8 months ago

Updates to make the lstProducer use the appropriate LST library based on the backend in use. It should be merged together with SegmentLinking/TrackLooper#341 that creates both CPU and CUDA libraries with one command, with the proper naming.

Also small updates to use the latest CMSSW alpaka interface.

VourMa commented 8 months ago

@YonsiG Could you follow your updated instructions in SegmentLinking/TrackLooper#341 and verify that this works?

YonsiG commented 8 months ago

Hi Manos, I cloned a new repository and pulled this branch CMSSW_13_3_0_pre3_LST_X_LoadTwoSDLlibs. When I do cmsRun, it tells me "----- Begin Fatal Exception 19-Oct-2023 03:10:08 PDT----------------------- An exception of category 'PluginNotFound' occurred while [0] Constructing the EventProcessor Exception Message: Unable to find plugin 'LSTProducer@alpaka' in category 'CMS EDM Framework Module'. Please check spelling of name. ----- End Fatal Exception -------------------------------------------------"

I remember we see this issue yesterday, how did you solve this issue?

VourMa commented 8 months ago

I remember we see this issue yesterday, how did you solve this issue?

Sorry, I forgot to mention what needs to be done to solve this. Instead of

process.AlpakaServiceCudaAsync = cms.Service('AlpakaServiceCudaAsync')
process.AlpakaServiceSerialSync = cms.Service('AlpakaServiceSerialSync')

one needs to include in the step3 configuration

process.load("HeterogeneousCore.AlpakaCore.ProcessAcceleratorAlpaka_cfi")

Please update the TrackLooper README accordingly.

YonsiG commented 8 months ago

Validated together with TrackLooper PR https://github.com/SegmentLinking/TrackLooper/pull/341. Now the cpu version and gpu version can be compiled together, while switching flags when running. mtv plots are here for out of the box. http://uaf-10.t2.ucsd.edu/~yagu/SDL_GPU_plots/CMSSW_mtv/compileCPU_GPU/plots_final/plots_ootb/effandfakePtEtaPhi.pdf The cpu version and gpu version does not look exactly the same, but this is expected due to thread competence

YonsiG commented 8 months ago

Additional comparison with the original master branch: CPU vs master CPU(same): http://uaf-10.t2.ucsd.edu/~yagu/SDL_GPU_plots/CMSSW_mtv/compileCPU_GPU/plots_master_compare/plots_cpu_compare/plots_ootb/effandfakePtEtaPhi.pdf GPU vs master GPU(a bit fluctuations): http://uaf-10.t2.ucsd.edu/~yagu/SDL_GPU_plots/CMSSW_mtv/compileCPU_GPU/plots_master_compare/plots_gpu_compare/plots_ootb/effandfakePtEtaPhi.pdf