Skip to content

GPU TPC clusterizer: wait for the gather of the previous sector before clearing the maps - #16100

Closed
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16100
Closed

ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16100

Conversation

@ktf

@ktf ktf commented Nov 11, 2026

Copy link
Copy Markdown
Member

A lane reuses its scratch memory for its next sector. At the first
fragment the charge and peak maps were cleared without waiting for the
gather of the previous sector, which runs on another stream, and the maps
can overlap that sector's clusterByRow: on pbpb30 the peak map of sector 3
ends at row 0 of sector 0. When the gather starts late, row 0 of the
previous sector is gathered as zeros: on a 20 kHz Pb-Pb time frame on
Metal, the first run in a process found 0.42 % fewer sector tracks.

The existing wait on the gather sat on the clusterInRow clear, after the
map clears. Move it to the first map clear at fragment 0.

…e clearing the maps

A lane reuses its scratch memory for its next sector. At the first
fragment the charge and peak maps were cleared without waiting for the
gather of the previous sector, which runs on another stream, and the maps
can overlap that sector's clusterByRow: on pbpb30 the peak map of sector 3
ends at row 0 of sector 0. When the gather starts late, row 0 of the
previous sector is gathered as zeros: on a 20 kHz Pb-Pb time frame on
Metal, the first run in a process found 0.42 % fewer sector tracks.

The existing wait on the gather sat on the clusterInRow clear, after the
map clears. Move it to the first map clear at fragment 0.
@ktf
ktf requested a review from davidrohr as a code owner November 11, 2026 07:42
@ktf

ktf commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

@davidrohr on metal this seems to be a genuine issue, with less tracks consistently missing when running on the 20 kHz reference data. Could you have a look if it makes sense?

@davidrohr

Copy link
Copy Markdown
Collaborator

I think the error is genuine, but I do not like the fix, since it adds synchronization and affects GPU performance. Interesting that I never saw this problem on AMD / NVIDIA. But that is the advantage of testing on different hardware :).
@fweig is in vacation, so I attempted a fix in #16103. Could you check if that works for you?

@ktf

ktf commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Yours works and it's obviously better. Closing.

@ktf ktf closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants