-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Heterogeneous Alpaka implementation of electron pixel seed-matching #51200
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
Open
ckoraka
wants to merge
10
commits into
cms-sw:master
Choose a base branch
from
ckoraka:pixelSeedingAlpaka_20_1_X
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,353
−0
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aea0791
Alpaka based electron seed matching rebased to 20_1
ckoraka 32df19c
Add customization function and remove print statement
ckoraka aaff93a
Fix issues with headers
ckoraka ec2b011
replaced methods with free functions, renamed methods following ROOT …
ckoraka a612100
Move Phys3DVector.h under EgammaElectronAlgos, address other comments
ckoraka eac3795
corrected code formatting
ckoraka fe6f2e5
Add egammaPixelSeedingPortable process modifier. Fix HeaderConsistency
ckoraka d757232
Add HLT75e33TimingAlpakaEgammaSeeding relval workflow (34434.7511)
ckoraka 712fd42
Add Layout aliases and rntupleStreamerMode to EgammaReco classes_def
ckoraka 863c01f
Drop alpaka modifier from wf 34434.7511 add it in the matrix with des…
ckoraka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Configuration/ProcessModifiers/python/egammaPixelSeedingPortable_cff.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| # This modifier enables the portable (alpaka) HLT electron pixel-seed matching, | ||
| # replacing ElectronNHitSeedProducer with the ElectronNHitSeedAlpakaProducer + | ||
| # ElectronSeedConverter pair. | ||
| egammaPixelSeedingPortable = cms.Modifier() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
DataFormats/EgammaReco/interface/ElectronSeedHostCollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #ifndef DataFormats_EgammaReco_interface_ElectronSeedHostCollection_h | ||
| #define DataFormats_EgammaReco_interface_ElectronSeedHostCollection_h | ||
|
|
||
| #include <Eigen/Core> | ||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "DataFormats/PortableTestObjects/interface/TestSoA.h" | ||
| #include "DataFormats/EgammaReco/interface/ElectronSeedSoA.h" | ||
|
|
||
| namespace reco { | ||
| using ElectronSeedHostCollection = PortableHostCollection<ElectronSeedSoA>; | ||
| } // namespace reco | ||
|
|
||
| #endif // DataFormats_EgammaReco_interface_ElectronSeedHostCollection_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #ifndef DataFormats_EgammaReco_interface_ElectronSeedSoA_h | ||
| #define DataFormats_EgammaReco_interface_ElectronSeedSoA_h | ||
|
|
||
| #include <Eigen/Core> | ||
| #include <cstdint> | ||
| #include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
|
|
||
| namespace reco { | ||
|
|
||
| using Vector3d = Eigen::Matrix<double, 3, 1>; | ||
| using Vector3f = Eigen::Matrix<float, 3, 1>; | ||
|
|
||
| GENERATE_SOA_LAYOUT(ElectronSeedLayout, | ||
| SOA_COLUMN(int8_t, nHits), | ||
| SOA_COLUMN(int8_t, isMatched), | ||
| SOA_COLUMN(int16_t, matchedScID), | ||
| SOA_COLUMN(int32_t, id), | ||
| SOA_COLUMN(int16_t, hit0detectorID), | ||
| SOA_COLUMN(int16_t, hit0isValid), | ||
| SOA_COLUMN(int16_t, hit1detectorID), | ||
| SOA_COLUMN(int16_t, hit1isValid), | ||
| SOA_COLUMN(int16_t, hit2detectorID), | ||
| SOA_COLUMN(int16_t, hit2isValid), | ||
| SOA_EIGEN_COLUMN(Vector3d, hit0Pos), | ||
| SOA_EIGEN_COLUMN(Vector3d, surf0Pos), | ||
| SOA_EIGEN_COLUMN(Vector3d, surf0Rot), | ||
| SOA_EIGEN_COLUMN(Vector3d, hit1Pos), | ||
| SOA_EIGEN_COLUMN(Vector3d, surf1Pos), | ||
| SOA_EIGEN_COLUMN(Vector3d, surf1Rot), | ||
| SOA_EIGEN_COLUMN(Vector3d, hit2Pos), | ||
| SOA_EIGEN_COLUMN(Vector3d, surf2Pos), | ||
| SOA_EIGEN_COLUMN(Vector3d, surf2Rot), | ||
| SOA_EIGEN_COLUMN(Vector3f, PMVars_dRZPos), | ||
| SOA_EIGEN_COLUMN(Vector3f, PMVars_dRZNeg), | ||
| SOA_EIGEN_COLUMN(Vector3f, PMVars_dPhiPos), | ||
| SOA_EIGEN_COLUMN(Vector3f, PMVars_dPhiNeg)) | ||
| using ElectronSeedSoA = ElectronSeedLayout<>; | ||
| } // namespace reco | ||
|
|
||
| #endif | ||
14 changes: 14 additions & 0 deletions
14
DataFormats/EgammaReco/interface/SuperClusterHostCollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #ifndef DataFormats_EgammaReco_interface_SuperClusterHostCollection_h | ||
| #define DataFormats_EgammaReco_interface_SuperClusterHostCollection_h | ||
|
|
||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "DataFormats/EgammaReco/interface/SuperClusterSoA.h" | ||
|
|
||
| namespace reco { | ||
|
|
||
| // SoA with x, y, z, id fields in host memory | ||
| using SuperClusterHostCollection = PortableHostCollection<SuperClusterSoA>; | ||
|
|
||
| } // namespace reco | ||
|
|
||
| #endif // DataFormats_EgammaReco_interface_SuperClusterHostCollection_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #ifndef DataFormats_EgammaReco_interface_SuperClusterSoA_h | ||
| #define DataFormats_EgammaReco_interface_SuperClusterSoA_h | ||
|
|
||
| #include <cstdint> | ||
| #include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
|
|
||
| namespace reco { | ||
|
|
||
| // SoA layout for supercluster | ||
| GENERATE_SOA_LAYOUT(SuperClusterSoALayout, | ||
| // columns: one value per element | ||
| SOA_COLUMN(double, scSeedTheta), | ||
| SOA_COLUMN(double, scPhi), | ||
| SOA_COLUMN(double, scR), | ||
| SOA_COLUMN(double, scEnergy), | ||
|
Comment on lines
+13
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these need to be |
||
| SOA_COLUMN(int32_t, id)) | ||
| using SuperClusterSoA = SuperClusterSoALayout<>; | ||
| } // namespace reco | ||
|
|
||
| #endif | ||
16 changes: 16 additions & 0 deletions
16
DataFormats/EgammaReco/interface/alpaka/ElectronSeedDeviceCollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #ifndef DataFormats_EgammaReco_interface_alpaka_ElectronSeedDeviceCollection_h | ||
| #define DataFormats_EgammaReco_interface_alpaka_ElectronSeedDeviceCollection_h | ||
|
|
||
| #include <Eigen/Core> | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/PortableTestObjects/interface/TestSoA.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
|
||
| #include "DataFormats/EgammaReco/interface/ElectronSeedSoA.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE::reco { | ||
| using namespace ::reco; | ||
| using ElectronSeedDeviceCollection = PortableCollection<ElectronSeedSoA>; | ||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE::reco | ||
|
|
||
| #endif // DataFormats_EgammaReco_interface_alpaka_ElectronSeedDeviceCollection_h |
19 changes: 19 additions & 0 deletions
19
DataFormats/EgammaReco/interface/alpaka/SuperClusterDeviceCollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #ifndef DataFormats_EgammaReco_interface_alpaka_SuperClusterDeviceCollection_h | ||
| #define DataFormats_EgammaReco_interface_alpaka_SuperClusterDeviceCollection_h | ||
|
|
||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "DataFormats/EgammaReco/interface/SuperClusterSoA.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
|
||
| namespace reco { | ||
|
|
||
| using namespace ::reco; | ||
| using SuperClusterDeviceCollection = PortableCollection<SuperClusterSoA>; | ||
|
|
||
| } // namespace reco | ||
|
|
||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
| #endif // DataFormats_EgammaReco_interface_alpaka_SuperClusterDeviceCollection_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #include <Eigen/Core> | ||
| #include "DataFormats/Common/interface/DeviceProduct.h" | ||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
|
|
||
| #include "DataFormats/EgammaReco/interface/SuperClusterSoA.h" | ||
| #include "DataFormats/EgammaReco/interface/alpaka/SuperClusterDeviceCollection.h" | ||
|
|
||
| #include "DataFormats/EgammaReco/interface/ElectronSeedSoA.h" | ||
| #include "DataFormats/EgammaReco/interface/alpaka/ElectronSeedDeviceCollection.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <lcgdict> | ||
| <class name="alpaka_cuda_async::reco::SuperClusterDeviceCollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_cuda_async::reco::SuperClusterDeviceCollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::reco::SuperClusterDeviceCollection>>" persistent="false"/> | ||
|
|
||
| <class name="alpaka_cuda_async::reco::ElectronSeedDeviceCollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_cuda_async::reco::ElectronSeedDeviceCollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::reco::ElectronSeedDeviceCollection>>" persistent="false"/> | ||
| </lcgdict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #include <Eigen/Core> | ||
|
|
||
| #include "DataFormats/Common/interface/DeviceProduct.h" | ||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
|
|
||
| #include "DataFormats/EgammaReco/interface/SuperClusterSoA.h" | ||
| #include "DataFormats/EgammaReco/interface/alpaka/SuperClusterDeviceCollection.h" | ||
|
|
||
| #include "DataFormats/EgammaReco/interface/ElectronSeedSoA.h" | ||
| #include "DataFormats/EgammaReco/interface/alpaka/ElectronSeedDeviceCollection.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <lcgdict> | ||
| <class name="alpaka_rocm_async::reco::SuperClusterDeviceCollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_rocm_async::reco::SuperClusterDeviceCollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::reco::SuperClusterDeviceCollection>>" persistent="false"/> | ||
|
|
||
| <class name="alpaka_rocm_async::reco::ElectronSeedDeviceCollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_rocm_async::reco::ElectronSeedDeviceCollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::reco::ElectronSeedDeviceCollection>>" persistent="false"/> | ||
| </lcgdict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #include <Eigen/Core> | ||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
| #include "DataFormats/EgammaReco/interface/SuperClusterHostCollection.h" | ||
| #include "DataFormats/EgammaReco/interface/SuperClusterSoA.h" | ||
| #include "DataFormats/EgammaReco/interface/ElectronSeedHostCollection.h" | ||
| #include "DataFormats/EgammaReco/interface/ElectronSeedSoA.h" | ||
| #include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" | ||
|
|
||
| SET_PORTABLEHOSTCOLLECTION_READ_RULES(reco::SuperClusterHostCollection); | ||
| SET_PORTABLEHOSTCOLLECTION_READ_RULES(reco::ElectronSeedHostCollection); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
HLTrigger/Configuration/python/HLT_75e33/modules/hltEgammaElectronPixelSeedsPortable_cfi.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| hltEgammaElectronPixelSeedsPortable = cms.EDProducer("ElectronNHitSeedAlpakaProducer@alpaka", | ||
| beamSpot = cms.InputTag("hltOnlineBeamSpot"), | ||
| initialSeeds = cms.InputTag("hltElePixelSeedsCombinedL1Seeded"), | ||
| superClusters = cms.InputTag("hltEgammaSuperClustersToPixelMatchL1Seeded") | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
doublevsfloat?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.
At least for the
PMVars_*I can say that they currently are used created asfloatonly, and theEDFiltersmaking a decision based only compare thePMVarswithfloat. That's why I implemented them asfloatinstead ofdouble.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.
Sorry, I wasn't very clear.
floatis much better from the performance point of view, and somewhat better from the memory usage point of view.doubleis what we tend to use "by default", at leas in legacy CPU code.I would ask to evaluate what is the impact on the physics results and on the stability and reproducibility of doing the computation in single precision, or even doing some computations in double precision but storing the variable in single precision.