-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Conversation
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
cms-bot internal usage |
A new Pull Request was created by @fwyzard (Andrea Bocci) for master. It involves the following packages:
@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. cms-bot commands are listed here |
elif type.startswith('alpaka_serial_sync::'): | ||
# alpaka module with explicit serial_sync backend | ||
base = type.removeprefix('alpaka_serial_sync::') |
There was a problem hiding this comment.
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)
.
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::') |
There was a problem hiding this comment.
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.
No description provided.