Skip to content

Conversation

@Electricks94
Copy link
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
Contributor

cmsbuild commented Jan 7, 2026

cms-bot internal usage

@Electricks94
Copy link
Contributor Author

type ngt

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

cmsbuild commented Jan 7, 2026

+code-checks

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

@cmsbuild
Copy link
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
Contributor

mmusich commented Jan 7, 2026

enable gpu

@mmusich
Copy link
Contributor

mmusich commented Jan 7, 2026

test parameters:

  • workflows = ph2_hlt

```
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
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
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
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
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
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
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
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
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
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
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
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
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
Contributor

Choose a reason for hiding this comment

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

Suggested change
;

@jfernan2
Copy link
Contributor

+1

@kpedro88
Copy link
Contributor

+simulation

@gabrielmscampos
Copy link
Member

+dqm

@cmsbuild
Copy link
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
Contributor

+1

@makortel
Copy link
Contributor

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

@fwyzard
Copy link
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
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