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

Alternative options for creating a serial copy of alpaka modules #43803

Closed
wants to merge 9 commits into from

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Jan 27, 2024

No description provided.

AdrianoDee and others added 9 commits January 25, 2024 16:48
Co-authored-by: Breno Orzari <breno.orzari@hotmail.com>
Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
Co-authored-by: Breno Orzari <breno.orzari@hotmail.com>
Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
Rename "gpu" to "device" and "cpu" to "host".

Co-authored-by: Breno Orzari <breno.orzari@hotmail.com>
Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
Co-authored-by: Andrea Bocci <andrea.bocci@cern.ch>
Co-authored-by: Breno Orzari <breno.orzari@hotmail.com>
Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
If `module` is an alpaka-based module, `makeSerialClone(module, **args)`
will make a copy of `module`, apply the changes in `**args`, and force
the copy to run using the "serial_sync" CPU backend.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@makortel what do you think ?

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 this is much better than spreading around the direct modification copy._TypedParameterizable__type, and a reasonable way for immediate needs. For the longer term I'd still like to solve the problem in different way, with which I'll follow up in #43780

@cmsbuild
Copy link
Contributor

cms-bot internal usage

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43803/38592

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @fwyzard (Andrea Bocci) for master.

It involves the following packages:

  • Configuration/ProcessModifiers (operations)
  • Configuration/PyReleaseValidation (upgrade, pdmv)
  • DQM/SiPixelHeterogeneous (dqm)
  • DataFormats/TrackSoA (reconstruction, heterogeneous)
  • DataFormats/VertexSoA (reconstruction, heterogeneous)
  • HLTrigger/Configuration (hlt)
  • HeterogeneousCore/AlpakaCore (heterogeneous)
  • HeterogeneousCore/AlpakaTest (heterogeneous)
  • RecoLocalTracker/SiPixelClusterizer (reconstruction)
  • RecoLocalTracker/SiPixelRecHits (reconstruction)
  • RecoTracker/Configuration (reconstruction)
  • RecoTracker/PixelSeeding (reconstruction)
  • RecoTracker/PixelTrackFitting (reconstruction)
  • RecoTracker/PixelVertexFinding (reconstruction)
  • RecoVertex/BeamSpotProducer (alca, reconstruction)

@fwyzard, @subirsarkar, @antoniovilela, @srimanob, @fabiocos, @miquork, @cmsbuild, @davidlange6, @sunilUIET, @syuvivida, @makortel, @rvenditti, @tjavaid, @mandrenguyen, @rappoccio, @perrotta, @antoniovagnerini, @consuegs, @AdrianoDee, @jfernan2, @mmusich, @saumyaphor4252, @nothingface0, @Martin-Grunewald can you please review it and eventually sign? Thanks.
@tocheng, @rsreds, @VourMa, @silviodonato, @GiacomoSguazzoni, @yuanchao, @fabiocos, @dkotlins, @gpetruc, @makortel, @dgulhan, @fioriNTU, @VinInn, @idebruyn, @tvami, @francescobrivio, @threus, @JanFSchulte, @ferencek, @mroguljic, @missirol, @mtosi, @ebrondol, @jandrea, @mmusich, @slomeo, @felicepantaleo, @Martin-Grunewald, @rovere this is something you requested to watch as well.
@antoniovilela, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

Comment on lines +6 to +8
elif type.startswith('alpaka_serial_sync::'):
# alpaka module with explicit serial_sync backend
base = type.removeprefix('alpaka_serial_sync::')
Copy link
Contributor

Choose a reason for hiding this comment

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

The alpaka_serial_sync case could just return module.clone(**kwargs).

Comment on lines +6 to +14
elif type.startswith('alpaka_serial_sync::'):
# alpaka module with explicit serial_sync backend
base = type.removeprefix('alpaka_serial_sync::')
elif type.startswith('alpaka_cuda_async::'):
# alpaka module with explicit cuda_async backend
base = type.removeprefix('alpaka_cuda_async::')
elif type.startswith('alpaka_rocm_async::'):
# alpaka module with explicit rocm_async backend
base = type.removeprefix('alpaka_rocm_async::')
Copy link
Contributor

Choose a reason for hiding this comment

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

The if-else chain could be replaced with e.g. a regex to remove the alpaka_[^:]*:: part.

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.

4 participants