Repository navigation
Conversation
|
@davidrohr standalone optimisation, including your comments. @fweig I guess you want to check this one. |
|
Do we really need a third implementation of this kernel? It's hard enough to maintain as it already is. :/ |
|
Error while checking build/O2/fullCI_slc9 for b3ef699 at 2026-11-24 14:03: Full log here. |
|
On Metal the separate scan halves the kernel time (208 → 92 ms on my sample); folding it into the existing kernel only gets 9%. Could you try CF_CHECK_PAD_BASELINE_SEGMENTED=1 on CUDA/HIP before I drop the optimisation? |
|
The CI fails. I believe since you have not added the parameter to kernels.cmake. I'll have a look at CUDA and AMD performance once CI passes, and once I find some time. If there is a significant improvement, we should merge this. Let's see how it works on the other GPUs. |
…r it The new scan is in the shared TPC cluster finder code and is selected per backend, at compile time, by the new parameter CF_CHECK_PAD_BASELINE_SEGMENTED, which is 1 only for Metal. CUDA, HIP and OpenCL keep the existing scan, since its speed there could not be measured here. GPUTPCCFCheckPadBaseline runs one block of 576 threads per row, and without the HIP tail filter only the up to 138 threads that own a pad do work, each walking all time bins of its pad. Without the filter the baseline needs, per pad, only the number of time bins with charge, the longest run of them and the largest charge, and these combine over consecutive segments of time. So with the new parameter all four threads per pad scan a quarter of the time bins each, straight from the charge map, and the quarters are joined at the end. The block size, its static_assert, the grid and the noisy-pad flags are unchanged; with the HIP tail filter on, the existing scan runs. On an M1 Max the kernel takes 1.6 ms per call instead of 3.7 (median in a Metal System Trace), and the 30-collision Pb-Pb time frame 1088 ms per event instead of 1182 (3 interleaved rounds of 10 runs, load average 4 to 6). The clusters are byte-identical to the CPU's, also with noisy-pad thresholds tightened until 6 to 24% of the clusters are dropped, and the CPU backend's own output is unchanged.
|
Updated with the kernels.cmake. |
The new scan is in the shared TPC cluster finder code and is selected
per backend, at compile time, by the new parameter
CF_CHECK_PAD_BASELINE_SEGMENTED, which is 1 only for Metal. CUDA, HIP
and OpenCL keep the existing scan, since its speed there could not be
measured here.
GPUTPCCFCheckPadBaseline runs one block of 576 threads per row, and
without the HIP tail filter only the up to 138 threads that own a pad
do work, each walking all time bins of its pad. Without the filter the
baseline needs, per pad, only the number of time bins with charge,
the longest run of them and the largest charge, and these combine
over consecutive segments of time. So with the new parameter all four
threads per pad scan a quarter of the time bins each, straight from
the charge map, and the quarters are joined at the end. The block
size, its static_assert, the grid and the noisy-pad flags are
unchanged; with the HIP tail filter on, the existing scan runs.
On an M1 Max the kernel takes 1.6 ms per call instead of 3.7 (median
in a Metal System Trace), and the 30-collision Pb-Pb time frame 1088
ms per event instead of 1182 (3 interleaved rounds of 10 runs, load
average 4 to 6). The clusters are byte-identical to the CPU's, also
with noisy-pad thresholds tightened until 6 to 24% of the clusters
are dropped, and the CPU backend's own output is unchanged.