Skip to content

Commit

Permalink
Merge pull request #45151 from vince502/CMSSW_14_1_0_pre2
Browse files Browse the repository at this point in the history
Include HIon type traits for Alpaka pixel tracking
  • Loading branch information
cmsbuild authored Jun 25, 2024
2 parents 3d3ceb0 + c5df667 commit ae6add4
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 3 deletions.
2 changes: 2 additions & 0 deletions DataFormats/TrackSoA/interface/TracksDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ namespace pixelTrack {
template <typename TDev>
using TracksDevicePhase1 = TracksDevice<pixelTopology::Phase1, TDev>;
template <typename TDev>
using TracksDeviceHIonPhase1 = TracksDevice<pixelTopology::HIonPhase1, TDev>;
template <typename TDev>
using TracksDevicePhase2 = TracksDevice<pixelTopology::Phase2, TDev>;

} // namespace pixelTrack
Expand Down
5 changes: 5 additions & 0 deletions DataFormats/TrackSoA/src/alpaka/classes_cuda_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<class name="edm::DeviceProduct<alpaka_cuda_async::pixelTrack::TracksSoACollectionPhase1>" persistent="false"/>
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::pixelTrack::TracksSoACollectionPhase1>>" persistent="false"/>

<class name="alpaka_cuda_async::PortableCollection<reco::TrackLayout<pixelTopology::HIonPhase1>>" persistent="false"/>
<class name="alpaka_cuda_async::pixelTrack::TracksSoACollectionHIonPhase1" persistent="false"/>
<class name="edm::DeviceProduct<alpaka_cuda_async::pixelTrack::TracksSoACollectionHIonPhase1>" persistent="false"/>
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::pixelTrack::TracksSoACollectionHIonPhase1>>" persistent="false"/>

<class name="alpaka_cuda_async::PortableCollection<reco::TrackLayout<pixelTopology::Phase2>>" persistent="false"/>
<class name="alpaka_cuda_async::pixelTrack::TracksSoACollectionPhase2" persistent="false"/>
<class name="edm::DeviceProduct<alpaka_cuda_async::pixelTrack::TracksSoACollectionPhase2>" persistent="false"/>
Expand Down
5 changes: 5 additions & 0 deletions DataFormats/TrackSoA/src/alpaka/classes_rocm_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<class name="edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase1>" persistent="false"/>
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase1>>" persistent="false"/>

<class name="alpaka_rocm_async::PortableCollection<reco::TrackLayout<pixelTopology::HIonPhase1>>" persistent="false"/>
<class name="alpaka_rocm_async::pixelTrack::TracksSoACollectionHIonPhase1" persistent="false"/>
<class name="edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionHIonPhase1>" persistent="false"/>
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionHIonPhase1>>" persistent="false"/>

<class name="alpaka_rocm_async::PortableCollection<reco::TrackLayout<pixelTopology::Phase2>>" persistent="false"/>
<class name="alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase2" persistent="false"/>
<class name="edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase2>" persistent="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ def _addProcessCalibTrackerAlpakaES(process):

# reconstruct the pixel digis and clusters with alpaka on the device
from RecoLocalTracker.SiPixelClusterizer.siPixelRawToClusterPhase1_cfi import siPixelRawToClusterPhase1 as _siPixelRawToClusterAlpaka
from RecoLocalTracker.SiPixelClusterizer.siPixelRawToClusterHIonPhase1_cfi import siPixelRawToClusterHIonPhase1 as _siPixelRawToClusterAlpakaHIonPhase1

siPixelClustersPreSplittingAlpaka = _siPixelRawToClusterAlpaka.clone()

(alpaka & pp_on_AA & ~phase2_tracker).toReplaceWith(siPixelClustersPreSplittingAlpaka,_siPixelRawToClusterAlpakaHIonPhase1.clone())

(alpaka & run3_common).toModify(siPixelClustersPreSplittingAlpaka,
# use the pixel channel calibrations scheme for Run 3
clusterThreshold_layer1 = 4000,
Expand All @@ -135,11 +139,16 @@ def _addProcessCalibTrackerAlpakaES(process):

from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase1_cfi import siPixelDigisClustersFromSoAAlpakaPhase1 as _siPixelDigisClustersFromSoAAlpakaPhase1
from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase2_cfi import siPixelDigisClustersFromSoAAlpakaPhase2 as _siPixelDigisClustersFromSoAAlpakaPhase2
from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaHIonPhase1_cfi import siPixelDigisClustersFromSoAAlpakaHIonPhase1 as _siPixelDigisClustersFromSoAAlpakaHIonPhase1

(alpaka & ~phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaPhase1.clone(
src = "siPixelClustersPreSplittingAlpaka"
))

(alpaka & pp_on_AA & ~phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaHIonPhase1.clone(
src = "siPixelClustersPreSplittingAlpaka"
))

(alpaka & phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaPhase2.clone(
clusterThreshold_layer1 = 4000,
clusterThreshold_otherLayers = 4000,
Expand All @@ -148,9 +157,6 @@ def _addProcessCalibTrackerAlpakaES(process):
produceDigis = False
))

from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase1_cfi import siPixelDigisClustersFromSoAAlpakaPhase1 as _siPixelDigisClustersFromSoAAlpakaPhase1
from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase2_cfi import siPixelDigisClustersFromSoAAlpakaPhase2 as _siPixelDigisClustersFromSoAAlpakaPhase2

alpaka.toModify(siPixelClustersPreSplitting,
cpu = cms.EDAlias(
siPixelDigisClustersPreSplitting = cms.VPSet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
PixelCPEFastParamsDevice<Device, TrackerTraits>>;

using PixelCPEFastParamsPhase1 = PixelCPEFastParams<pixelTopology::Phase1>;
using PixelCPEFastParamsHIonPhase1 = PixelCPEFastParams<pixelTopology::HIonPhase1>;
using PixelCPEFastParamsPhase2 = PixelCPEFastParams<pixelTopology::Phase2>;

} // namespace ALPAKA_ACCELERATOR_NAMESPACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
}

using PixelCPEFastParamsESProducerAlpakaPhase1 = PixelCPEFastParamsESProducerAlpaka<pixelTopology::Phase1>;
using PixelCPEFastParamsESProducerAlpakaHIonPhase1 = PixelCPEFastParamsESProducerAlpaka<pixelTopology::HIonPhase1>;
using PixelCPEFastParamsESProducerAlpakaPhase2 = PixelCPEFastParamsESProducerAlpaka<pixelTopology::Phase2>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE

DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(PixelCPEFastParamsESProducerAlpakaPhase1);
DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(PixelCPEFastParamsESProducerAlpakaHIonPhase1);
DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(PixelCPEFastParamsESProducerAlpakaPhase2);
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
Algo_.makeHitsAsync(digis, clusters, bs.data(), fcpe.const_buffer().data(), iEvent.queue()));
}
using SiPixelRecHitAlpakaPhase1 = SiPixelRecHitAlpaka<pixelTopology::Phase1>;
using SiPixelRecHitAlpakaHIonPhase1 = SiPixelRecHitAlpaka<pixelTopology::HIonPhase1>;
using SiPixelRecHitAlpakaPhase2 = SiPixelRecHitAlpaka<pixelTopology::Phase2>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE

#include "HeterogeneousCore/AlpakaCore/interface/alpaka/MakerMacros.h"
DEFINE_FWK_ALPAKA_MODULE(SiPixelRecHitAlpakaPhase1);
DEFINE_FWK_ALPAKA_MODULE(SiPixelRecHitAlpakaHIonPhase1);
DEFINE_FWK_ALPAKA_MODULE(SiPixelRecHitAlpakaPhase2);
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
def _addProcessCPEsAlpaka(process):
process.load("RecoLocalTracker.SiPixelRecHits.pixelCPEFastParamsESProducerAlpakaPhase1_cfi")
process.load("RecoLocalTracker.SiPixelRecHits.pixelCPEFastParamsESProducerAlpakaPhase2_cfi")
process.load("RecoLocalTracker.SiPixelRecHits.pixelCPEFastParamsESProducerAlpakaHIonPhase1_cfi")

modifyConfigurationForAlpakaCPEs_ = alpaka.makeProcessModifier(_addProcessCPEsAlpaka)

12 changes: 12 additions & 0 deletions RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
### Alpaka Pixel Hits Reco
from RecoLocalTracker.SiPixelRecHits.siPixelRecHitAlpakaPhase1_cfi import siPixelRecHitAlpakaPhase1 as _siPixelRecHitAlpakaPhase1
from RecoLocalTracker.SiPixelRecHits.siPixelRecHitAlpakaPhase2_cfi import siPixelRecHitAlpakaPhase2 as _siPixelRecHitAlpakaPhase2
from RecoLocalTracker.SiPixelRecHits.siPixelRecHitAlpakaHIonPhase1_cfi import siPixelRecHitAlpakaHIonPhase1 as _siPixelRecHitAlpakaHIonPhase1


# Hit SoA producer on the device
siPixelRecHitsPreSplittingAlpaka = _siPixelRecHitAlpakaPhase1.clone(
Expand All @@ -138,6 +140,9 @@
phase2_tracker.toReplaceWith(siPixelRecHitsPreSplittingAlpaka,_siPixelRecHitAlpakaPhase2.clone(
src = "siPixelClustersPreSplittingAlpaka"
))
(pp_on_AA & ~phase2_tracker).toReplaceWith(siPixelRecHitsPreSplittingAlpaka,_siPixelRecHitAlpakaHIonPhase1.clone(
src = "siPixelClustersPreSplittingAlpaka"
))

# Hit SoA producer on the cpu, for validation
siPixelRecHitsPreSplittingAlpakaSerial = makeSerialClone(siPixelRecHitsPreSplittingAlpaka,
Expand All @@ -146,6 +151,7 @@

from RecoLocalTracker.SiPixelRecHits.siPixelRecHitFromSoAAlpakaPhase1_cfi import siPixelRecHitFromSoAAlpakaPhase1 as _siPixelRecHitFromSoAAlpakaPhase1
from RecoLocalTracker.SiPixelRecHits.siPixelRecHitFromSoAAlpakaPhase2_cfi import siPixelRecHitFromSoAAlpakaPhase2 as _siPixelRecHitFromSoAAlpakaPhase2
from RecoLocalTracker.SiPixelRecHits.siPixelRecHitFromSoAAlpakaHIonPhase1_cfi import siPixelRecHitFromSoAAlpakaHIonPhase1 as _siPixelRecHitFromSoAAlpakaHIonPhase1

(alpaka & ~phase2_tracker).toModify(siPixelRecHitsPreSplitting,
cpu = _siPixelRecHitFromSoAAlpakaPhase1.clone(
Expand All @@ -159,6 +165,12 @@
src = cms.InputTag('siPixelClustersPreSplitting'))
)

(alpaka & pp_on_AA & ~phase2_tracker).toModify(siPixelRecHitsPreSplitting,
cpu = _siPixelRecHitFromSoAAlpakaHIonPhase1.clone(
pixelRecHitSrc = cms.InputTag('siPixelRecHitsPreSplittingAlpaka'),
src = cms.InputTag('siPixelClustersPreSplitting'))
)


alpaka.toReplaceWith(siPixelRecHitsPreSplittingTask, cms.Task(
# Reconstruct the pixel hits with alpaka on the device
Expand Down
2 changes: 2 additions & 0 deletions RecoLocalTracker/SiPixelRecHits/src/ES_PixelCPEFastParams.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"

using PixelCPEFastParamsHostPhase1 = PixelCPEFastParamsHost<pixelTopology::Phase1>;
using PixelCPEFastParamsHostHIonPhase1 = PixelCPEFastParamsHost<pixelTopology::HIonPhase1>;
using PixelCPEFastParamsHostPhase2 = PixelCPEFastParamsHost<pixelTopology::Phase2>;

TYPELOOKUP_DATA_REG(PixelCPEFastParamsHostPhase1);
TYPELOOKUP_DATA_REG(PixelCPEFastParamsHostHIonPhase1);
TYPELOOKUP_DATA_REG(PixelCPEFastParamsHostPhase2);
2 changes: 2 additions & 0 deletions RecoLocalTracker/SiPixelRecHits/src/PixelCPEFastParams.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"

using PixelCPEFastParamsPhase1 = PixelCPEFastParamsDevice<alpaka_common::DevHost, pixelTopology::Phase1>;
using PixelCPEFastParamsHIonPhase1 = PixelCPEFastParamsDevice<alpaka_common::DevHost, pixelTopology::HIonPhase1>;
using PixelCPEFastParamsPhase2 = PixelCPEFastParamsDevice<alpaka_common::DevHost, pixelTopology::Phase2>;

TYPELOOKUP_DATA_REG(PixelCPEFastParamsPhase1);
TYPELOOKUP_DATA_REG(PixelCPEFastParamsHIonPhase1);
TYPELOOKUP_DATA_REG(PixelCPEFastParamsPhase2);
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/typelookup.h"

TYPELOOKUP_ALPAKA_DATA_REG(PixelCPEFastParamsPhase1);
TYPELOOKUP_ALPAKA_DATA_REG(PixelCPEFastParamsHIonPhase1);
TYPELOOKUP_ALPAKA_DATA_REG(PixelCPEFastParamsPhase2);
2 changes: 2 additions & 0 deletions RecoTracker/Configuration/python/RecoPixelVertexing_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@
# pixel vertex SoA producer with alpaka on the device
from RecoTracker.PixelVertexFinding.pixelVertexProducerAlpakaPhase1_cfi import pixelVertexProducerAlpakaPhase1 as _pixelVerticesAlpakaPhase1
from RecoTracker.PixelVertexFinding.pixelVertexProducerAlpakaPhase2_cfi import pixelVertexProducerAlpakaPhase2 as _pixelVerticesAlpakaPhase2
from RecoTracker.PixelVertexFinding.pixelVertexProducerAlpakaHIonPhase1_cfi import pixelVertexProducerAlpakaHIonPhase1 as _pixelVerticesAlpakaHIonPhase1
pixelVerticesAlpaka = _pixelVerticesAlpakaPhase1.clone()
phase2_tracker.toReplaceWith(pixelVerticesAlpaka,_pixelVerticesAlpakaPhase2.clone())
(pp_on_AA & ~phase2_tracker).toReplaceWith(pixelVerticesAlpaka,_pixelVerticesAlpakaHIonPhase1.clone(doSplitting = False))

from RecoTracker.PixelVertexFinding.pixelVertexFromSoAAlpaka_cfi import pixelVertexFromSoAAlpaka as _pixelVertexFromSoAAlpaka
alpaka.toReplaceWith(pixelVertices, _pixelVertexFromSoAAlpaka.clone())
Expand Down
2 changes: 2 additions & 0 deletions RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
}

using CAHitNtupletAlpakaPhase1 = CAHitNtupletAlpaka<pixelTopology::Phase1>;
using CAHitNtupletAlpakaHIonPhase1 = CAHitNtupletAlpaka<pixelTopology::HIonPhase1>;
using CAHitNtupletAlpakaPhase2 = CAHitNtupletAlpaka<pixelTopology::Phase2>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE

#include "HeterogeneousCore/AlpakaCore/interface/alpaka/MakerMacros.h"

DEFINE_FWK_ALPAKA_MODULE(CAHitNtupletAlpakaPhase1);
DEFINE_FWK_ALPAKA_MODULE(CAHitNtupletAlpakaHIonPhase1);
DEFINE_FWK_ALPAKA_MODULE(CAHitNtupletAlpakaPhase2);
7 changes: 7 additions & 0 deletions RecoTracker/PixelTrackFitting/python/PixelTracks_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@
# pixel tracks SoA producer on the device
from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase1_cfi import caHitNtupletAlpakaPhase1 as _pixelTracksAlpakaPhase1
from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase2_cfi import caHitNtupletAlpakaPhase2 as _pixelTracksAlpakaPhase2
from RecoTracker.PixelSeeding.caHitNtupletAlpakaHIonPhase1_cfi import caHitNtupletAlpakaHIonPhase1 as _pixelTracksAlpakaHIonPhase1

pixelTracksAlpaka = _pixelTracksAlpakaPhase1.clone()
phase2_tracker.toReplaceWith(pixelTracksAlpaka,_pixelTracksAlpakaPhase2.clone())
(pp_on_AA & ~phase2_tracker).toReplaceWith(pixelTracksAlpaka, _pixelTracksAlpakaHIonPhase1.clone())

# pixel tracks SoA producer on the cpu, for validation
pixelTracksAlpakaSerial = makeSerialClone(pixelTracksAlpaka,
Expand All @@ -226,6 +228,7 @@
# legacy pixel tracks from SoA
from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAAlpakaPhase1_cfi import pixelTrackProducerFromSoAAlpakaPhase1 as _pixelTrackProducerFromSoAAlpakaPhase1
from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAAlpakaPhase2_cfi import pixelTrackProducerFromSoAAlpakaPhase2 as _pixelTrackProducerFromSoAAlpakaPhase2
from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAAlpakaHIonPhase1_cfi import pixelTrackProducerFromSoAAlpakaHIonPhase1 as _pixelTrackProducerFromSoAAlpakaHIonPhase1

(alpaka & ~phase2_tracker).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpakaPhase1.clone(
pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
Expand All @@ -235,6 +238,10 @@
pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
))

(alpaka & ~phase2_tracker & pp_on_AA).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpakaHIonPhase1.clone(
pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
))

alpaka.toReplaceWith(pixelTracksTask, cms.Task(
# Build the pixel ntuplets and the pixel tracks in SoA format with alpaka on the device
pixelTracksAlpaka,
Expand Down

0 comments on commit ae6add4

Please sign in to comment.