Skip to content
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 issues regarding the Pixel local reconstruction on GPU #32483

Open
1 of 16 tasks
fwyzard opened this issue Dec 14, 2020 · 15 comments
Open
1 of 16 tasks

Open issues regarding the Pixel local reconstruction on GPU #32483

fwyzard opened this issue Dec 14, 2020 · 15 comments

Comments

@fwyzard
Copy link
Contributor

fwyzard commented Dec 14, 2020

Open issues regarding the Pixel local reconstruction on GPU

  • high level: add support for the Phase 2 geometry
    • make the CPU and GPU buffers used for the pixel local reconstruction configurable at runtime
    • extend or duplicate PixelCPEFast for the Phase 2 geometry (see #31721 (comment))
    • once support for the Phase 2 geometry is available, rename Phase 1-only modules accordingly
  • high level: reduce code duplication
  • reduce the number of dedicated namespacess for Pixel reconstruction on GPU
  • add more comments to the code
  • use gpuClustering::maxNumModules where appropriate: done in Clean up the pixel local reconstruction code cms-patatrack/cmssw#593 / cms-patatrack@f6924bb
  • use phase1PixelTopology::numberOfLayers where appropriate
  • make the pixel cluster thresholds configurable
  • avoid explicit memory operations (cudaMalloc, cudaFree, cudaMemcpy, cudaMemcpyAsync, etc.) in favour of the make_device_unique, copyAsync, etc. wrappers
  • implement proper encapsulation for pixelCPEforGPU::ParamsOnGPU
  • decide if there is better place and mechanism for storing the beamspot-corrected geometry
@cmsbuild
Copy link
Contributor

A new Issue was created by @fwyzard Andrea Bocci.

@Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 14, 2020

make the CPU and GPU buffers used for the pixel local reconstruction configurable at runtime

See https://github.com/cms-sw/cmssw/pull/31721/files#r521009826 for an initial discussion.

The dimensions defined in CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h should eventually be changes to accommodate the Phase 2 and Heavy Ions conditions.

This is possible in different ways:

  • making 2-3 variants of the classes (e.g. templating them) for few well-defined use cases, and pick a different implementation at runtime based on the configuration
  • making the buffer sizes dependent on the job configuration, and allocate them at module construction time
  • making the buffers fully resizable at runtime (or at least event by event) (unlikely to be useful)
  • etc.

Some preliminary work was done in cms-patatrack#545, cms-patatrack#583, cms-patatrack#590 .

A likely requirement is a more user-friendly SoA interface (see cms-patatrack#272).

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 14, 2020

assign reconstruction

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 14, 2020

assign heterogeneous

@cmsbuild
Copy link
Contributor

New categories assigned: heterogeneous,reconstruction

@slava77,@perrotta,@makortel,@jpata,@fwyzard you have been requested to review this Pull request/Issue and eventually sign? Thanks

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 14, 2020

@tsusa @mmusich @VinInn FYI

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 14, 2020

Add more comments to the code

@fwyzard

This comment has been minimized.

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 15, 2020

Use phase1PixelTopology::numberOfLayers where appropriate

In

  • Geometry/TrackerGeometryBuilder/test/phase1PixelTopology_t.cpp
  • RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitSoAFromLegacy.cc

use phase1PixelTopology::numberOfLayers (+ 1) in place of 10 (11).

@VinInn
Copy link
Contributor

VinInn commented Dec 15, 2020

not these one

RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelDigisClustersFromSoA.cc:

   /// this is an algorithm constant defined by Danek
    auto clusterThreshold = (layer == 1) ? 2000 : 4000;


RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelRawToClusterGPUKernel.h:

// this is a property of FED/ROC and already proposed to be increased for HI
const uint32_t MAX_WORD = 2000;

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 15, 2020

Make the pixel cluster thresholds configurable

RecoLocalTracker/SiPixelClusterizer/plugins/gpuClusterChargeCut.h and RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelDigisClustersFromSoA.cc use hard-coded cuts of 2000 and 4000, while the CPU code at RecoLocalTracker/SiPixelClusterizer/plugins/PixelThresholdClusterizer.cc takes the same values from the runtime configuration.

The GPU code could be updated to do the same.

@czangela
Copy link
Contributor

I would like to reiterate and start a conversation on the matter of namespaces, listed in this previous comment.

Some previous conversations about this went on at #31721 and can be found at comment 1, comment 2. Please add more if you know of any. (threads, comments, hypernews, anything)

As far as I understand, (correct me @mmusich if I'm wrong) one namespace should do.

Ideas on what this should be are welcome.

@VinInn
Copy link
Contributor

VinInn commented Mar 22, 2021

namespaces are used to group "items" no more no less than structs or classes. The same OOD criteria apply.
One structural difference is that declarations in namespaces may span multiple files.
phase1PixelTopology is the kind of entity that in the old days would have been modeled using a struct.
I find a namespace more appropriate (and in CMSSW we had campaigns to move "struct" to "namespace").
Still, as we deplorate multi-purpose classes, we shall not, in my opinion, clusterize everything is a single namespace just for the sake of "economy".
In summary: just use your best OOD judgment.

czangela added a commit to czangela/cmssw that referenced this issue Mar 24, 2021
Since these are used in the gpuClustering::clusterChargeCut function, it makes sense to set them here (than make them configurable for the SiPixelDigisClustersFromSoA class)
See cms-sw#32483 (comment cms-sw#1 cms-sw#32483 (comment), comment cms-sw#2 cms-sw#32483 (comment))
czangela added a commit to czangela/cmssw that referenced this issue Mar 24, 2021
@mmusich
Copy link
Contributor

mmusich commented Apr 5, 2021

@jpata, can you please move the open issues connected to pixel tracking and vertexing to a separate issue?
As far as I can tell (based on the title) this issue is reserved to pixel local reconstruction.
Thanks.

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

No branches or pull requests

5 participants