Skip to content

Remove PortableHostMultiCollection and PortableDeviceMultiCollection#49734

Merged
cmsbuild merged 10 commits intocms-sw:masterfrom
Electricks94:RemovePortableMultiCollections
Jan 21, 2026
Merged

Remove PortableHostMultiCollection and PortableDeviceMultiCollection#49734
cmsbuild merged 10 commits intocms-sw:masterfrom
Electricks94:RemovePortableMultiCollections

Conversation

@Electricks94
Copy link
Copy Markdown
Contributor

@Electricks94 Electricks94 commented Jan 7, 2026

This PR removes PortableHostMultiCollection and PortableDeviceMultiCollection and replaces them with SoABlocks (see #48629).

This has two major advantages:

  1. Simplifications of dictionaries because variadic templates are not necessary anymore
  2. Code simplifications because BlocksView holds views to all sublayouts

In a future PRs the code can be simplified even more because with kernels that use a BlocksView as input can work on the entire data. Hence, it is not necessarry anymore to have every sub-view as input. In this PR, however, I tried to make as few changes as possible to not blow up the PR too much.

@felicepantaleo @leobeltra fyi

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Jan 7, 2026

cms-bot internal usage

@Electricks94
Copy link
Copy Markdown
Contributor Author

type ngt

@cmsbuild cmsbuild added the ngt label Jan 7, 2026
@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Jan 7, 2026

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49734/47318

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Jan 7, 2026

A new Pull Request was created by @Electricks94 for master.

It involves the following packages:

  • DQM/SiPixelHeterogeneous (dqm)
  • DataFormats/HGCalDigi (simulation)
  • DataFormats/Portable (heterogeneous)
  • DataFormats/PortableTestObjects (heterogeneous)
  • DataFormats/SoATemplate (heterogeneous)
  • DataFormats/TrackSoA (heterogeneous, reconstruction)
  • DataFormats/TrackingRecHitSoA (heterogeneous, reconstruction)
  • DataFormats/VertexSoA (heterogeneous, reconstruction)
  • HeterogeneousCore/AlpakaTest (heterogeneous)
  • RecoLocalTracker/Phase2TrackerRecHits (reconstruction)
  • RecoLocalTracker/SiPixelRecHits (reconstruction)
  • RecoTauTag/HLTProducers (hlt)
  • RecoTracker/LST (reconstruction)
  • RecoTracker/LSTCore (reconstruction)
  • RecoTracker/PixelSeeding (reconstruction)
  • RecoTracker/PixelTrackFitting (reconstruction)
  • RecoVertex/PixelVertexFinding (reconstruction)

@Martin-Grunewald, @Moanwar, @civanch, @cmsbuild, @ctarricone, @fwyzard, @gabrielmscampos, @jfernan2, @kpedro88, @makortel, @mandrenguyen, @mdhildreth, @mmusich, @nothingface0, @rseidita, @srimanob can you please review it and eventually sign? Thanks.
@GiacomoSguazzoni, @IzaakWN, @VinInn, @VourMa, @azotz, @dgulhan, @dkotlins, @elusian, @fabiocos, @felicepantaleo, @ferencek, @fioriNTU, @gpetruc, @idebruyn, @jandrea, @makortel, @martinamalberti, @mbluj, @missirol, @mmasciov, @mmusich, @mroguljic, @mtosi, @pfs, @rovere, @threus, @tsusa this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@mmusich
Copy link
Copy Markdown
Contributor

mmusich commented Jan 7, 2026

enable gpu

@mmusich
Copy link
Copy Markdown
Contributor

mmusich commented Jan 7, 2026

test parameters:

  • workflows = ph2_hlt

Comment thread DataFormats/Portable/README.md Outdated
```
The layouts should not be added as parameters for the device collection. Those script can be use equally with the
single layout collections or multi layout collections.
Multi layout collections have been removed and replaced by `SoABlocks`. See the `DataFormats/SoATemplate`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems broken off ?


collectionName = sys.argv[1]

# TODO: do we need to change something here becuase of the removal of PortableMultiCollection?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this ever supported PortableMultiCollections.
Do we need a special syntax for the SoA blocks ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the SoA blocks no special syntax is needed. It is equivalent to a normal PortableCollection. I adapted the file to be consistent with #48824. Which means first Collection declaration. Then Collection::Layout followed by the SoALayout that is aliased by Collection::Layout. Lastly the definition with edm::Wrapper

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, can you remove the TODO ?


import sys

# TODO: do we need to change something here becuase of the removal of PortableMultiCollection?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should remove the part if len(layouts) > 1:


using TestSoA3 = TestSoALayout3<>;

GENERATE_SOA_BLOCKS(SoABlocks2, SOA_BLOCK(firstLayout, TestSoALayout), SOA_BLOCK(secondLayout, TestSoALayout2))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just

Suggested change
GENERATE_SOA_BLOCKS(SoABlocks2, SOA_BLOCK(firstLayout, TestSoALayout), SOA_BLOCK(secondLayout, TestSoALayout2))
GENERATE_SOA_BLOCKS(SoABlocks2, SOA_BLOCK(first, TestSoALayout), SOA_BLOCK(second, TestSoALayout2))

?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same below.

// Either int32_t for normal layouts or std::array<int32_t, N> for SoABlocks layouts
auto size() const {
return layout_.metadata().size();
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
;


// generic SoA-based product in host memory
// TODO: Should we define a size alias for the number of elements? Also should be switch to unsigned and/or 64 bit?
// Exeeding the size of int32_t fails without clear error messages.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be an int32_t (actually a plain int) because of how ROOT stores the columns 🤷🏻‍♂️ .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand. How about allowing any integral type for the constructor of the PortableCollections and then implementing a check if the value can be savely casted to int? If it is save to cast we would do so and pass it on to the Layout, otherwise we throw an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realised that the PortableCollections have already a constructor that takes std::integral as input type for the elements. So the idea would be just to align all other constructors as well and add a check for the cast.

alpaka::memset(std::forward<TQueue>(queue), *buffer_, 0x00);
}

// part of the ROOT read streamer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the comment ?

// Either int32_t for normal layouts or std::array<int32_t, N> for SoABlocks layouts
auto size() const {
return layout_.metadata().size();
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
;

@cmsbuild
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

@makortel makortel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I ask you to double check the changes to the classes_def.xml files, after the rebase over #48824 ?

Done. I found one case that needs to be adjusted, the others looked fine by eye.

Comment on lines 6 to -8
<class name="reco::HitPortableCollectionHost"/>
<!-- needed to avoid auto parsing by ROOT. Order in the file matters -->
<class name="reco::HitPortableCollectionHost::Implementation"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An entry for

  <class name="reco::HitPortableCollectionHost::Layout"/>

is needed, and it needs to be placed before entry of reco::TrackingBlocksLayout. I'd suggest to place it (maybe both of these lines) before all the Layout entries. I'd also suggest to include a comment that it needs to be placed before the aliased-to type (like in other files).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@cmsbuild
Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49734/47484

@cmsbuild
Copy link
Copy Markdown
Contributor

@Electricks94
Copy link
Copy Markdown
Contributor Author

please test

@cmsbuild
Copy link
Copy Markdown
Contributor

-1

Failed Tests: RelVals RelVals-AMD_W7900
Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82823b/50625/summary.html
COMMIT: 5d8b297
CMSSW: CMSSW_16_1_X_2026-01-14-1100/el8_amd64_gcc13
Additional Tests: GPU,AMD_MI300X,AMD_W7900,NVIDIA_H100,NVIDIA_L40S,NVIDIA_T4
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/49734/50625/install.sh to create a dev area with all the needed externals and cmssw changes.

Failed RelVals

----- Begin Fatal Exception 14-Jan-2026 18:01:35 CET-----------------------
An exception of category 'OutOfBound' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 4 stream: 0
   [1] Running path 'HLTriggerFinalPath'
   [2] Prefetching for module TriggerSummaryProducerAOD/'hltTriggerSummaryAOD'
   [3] Prefetching for module L1HPSPFTauProducer/'l1tHPSPFTauProducer'
   [4] Prefetching for module L1TPFCandMultiMerger/'l1tLayer1'
   [5] Prefetching for module L1TCorrelatorLayer1Producer/'l1tLayer1HGCal'
   [6] Calling method for module HGCalBackendLayer2Producer/'l1tHGCalBackEndLayer2Producer'
Exception Message:
TC X1 = 0.0713466 out of the seeding histogram bounds 0.076 - 0.58
----- End Fatal Exception -------------------------------------------------

Failed RelVals-AMD_W7900

  • 34634.40334634.403_TTbar_14TeV+Run4D121PU_Patatrack_PixelOnlyAlpaka_Validation/step2_TTbar_14TeV+Run4D121PU_Patatrack_PixelOnlyAlpaka_Validation.log
  • 34634.40234634.402_TTbar_14TeV+Run4D121PU_Patatrack_PixelOnlyAlpaka/step2_TTbar_14TeV+Run4D121PU_Patatrack_PixelOnlyAlpaka.log
  • 34634.75134634.751_TTbar_14TeV+Run4D121PU_HLT75e33TimingAlpaka/step2_TTbar_14TeV+Run4D121PU_HLT75e33TimingAlpaka.log
Expand to see more relval errors ...

@fwyzard
Copy link
Copy Markdown
Contributor

fwyzard commented Jan 20, 2026

+heterogeneous

@fwyzard
Copy link
Copy Markdown
Contributor

fwyzard commented Jan 20, 2026

ignore tests-rejected with ib-failure

@mmusich
Copy link
Copy Markdown
Contributor

mmusich commented Jan 20, 2026

+hlt

  • for the changes in RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc

@fwyzard
Copy link
Copy Markdown
Contributor

fwyzard commented Jan 20, 2026

@Electricks94 can you open a backport for 16.0.x ?

@jfernan2
Copy link
Copy Markdown
Contributor

+1

@kpedro88
Copy link
Copy Markdown
Contributor

+simulation

@gabrielmscampos
Copy link
Copy Markdown
Member

+dqm

@cmsbuild
Copy link
Copy Markdown
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (test failures were overridden). This pull request will now be reviewed by the release team before it's merged. @mandrenguyen, @ftenchini, @sextonkennedy (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Copy Markdown
Contributor

+1

@makortel
Copy link
Copy Markdown
Contributor

This PR caused 4 DQM integration test to fail, see #49892

@fwyzard
Copy link
Copy Markdown
Contributor

fwyzard commented Jan 21, 2026

I guess it's to be expected if the DQM tests reuse old streamer files as input ?

As far as I know there is no guarantee that streamer files are readable with any release different from what was used to write them.

@makortel
Copy link
Copy Markdown
Contributor

As far as I know there is no guarantee that streamer files are readable with any release different from what was used to write them.

Correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants