Repository navigation
Conversation
Member
Author
|
@davidrohr our understanding of your comments. Notice the accounting for CPU running in what is considered (shared) device memory. |
davidrohr
requested changes
Nov 26, 2026
davidrohr
left a comment
Collaborator
There was a problem hiding this comment.
This looks quite good and is pretty much what I had in mind. There is one issue with converting const ptr to non-const, that should be fixed. And 2 minor comments:
The sorts of the TPC merger, which CUDA and HIP run with thrust, run on a single GPU thread on the other backends. A backend whose memory is shared with the host can sort there instead, with the CPU code of the kernels, once its stream is drained. The new parameter UNIFIED_MEM_SORT_ON_HOST selects this for the sorts of the merged tracks, of the looper candidates, of the O2 output and of the border ranges, through the new kernel device type HostOnDeviceMemory. It differs from CPU, whose kernels work on the host processors and their host memory: these kernels run on a copy of the device processors, which points at the host view of the device memory (mDeviceMemoryHostView, set by the backend if that is at another address), with the host's parameters and calibration objects. Pointer arguments are moved to the host view as well. The parameter is 0 for all backends.
On a single GPU thread, the sorts of the merged tracks by quality and by q/pT, of the looper candidates and of the O2 output tracks took about 730 ms per event on a 30-collision Pb-Pb time frame, at up to 140 times the CPU's time, and the 360 border-range sorts per time frame another 312 ms. The GPU memory is shared with the host, so sort there with UNIFIED_MEM_SORT_ON_HOST, which also orders the elements that compare equal as on the CPU.
…s sharing their memory The candidate search of the border track merging, 180 launches per time frame of a few thousand tracks each, took 46 ms per event (kernels serialized) on a 30-collision Pb-Pb time frame on the Metal GPU, where each thread first walks the sorted ranges from the start. On the host, right after the range sorts which already drained the stream, it takes 4.6 ms, including pointing the processors at the host view of the shared memory for each launch. One block, so that the merging across the central electrode stays as on the CPU. Benchmark, 6 interleaved rounds of 10 events: -6 +- 2 ms per event. The new parameter UNIFIED_MEM_MERGE_BORDERS_ON_HOST selects it at the call site, as UNIFIED_MEM_SORT_ON_HOST does for the sorts: the CPU code runs on the device processors in the memory shared with the host. On for Metal only.
Member
Author
|
@davidrohr I think I have taken into account all your comments. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The candidate search of the border track merging, 180 launches per time
frame of a few thousand tracks each, took 46 ms per event (kernels
serialized) on a 30-collision Pb-Pb time frame on the Metal GPU, where
each thread first walks the sorted ranges from the start. On the host,
right after the range sorts which already drained the stream, it takes
4.6 ms, including pointing the processors at the host view of the shared
memory for each launch. One block, so that the merging across the central
electrode stays as on the CPU. Benchmark, 6 interleaved rounds of 10
events: -6 +- 2 ms per event.
The new parameter UNIFIED_MEM_MERGE_BORDERS_ON_HOST selects it at the call
site, as UNIFIED_MEM_SORT_ON_HOST does for the sorts: the CPU code runs on
the device processors in the memory shared with the host. On for Metal
only.