GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GPU: skip the rows out of reach of a looper in a loop of their own by ktf · Pull Request #16112 · AliceO2Group/AliceO2

Conversation

@ktf

@ktf ktf commented Nov 12, 2026

Copy link
Copy Markdown
Member

AttachClustersLooperFollow scans all rows after each propagation step
and attaches clusters in the two to four rows within 1.5 cm of the
track. On a GPU the threads of a warp sit at different radii, so each
of them finds its rows at different iterations of the scan, and the
warp runs the attachment once per row that any of its threads is close
to, with one or two threads active each time.

Skip the rows out of reach in an inner loop without attachment, so that
all threads of a warp reach AttachClusters in the same iteration.

The inner loop only advances j over rows for which the condition of the
attachment is false, evaluated with the same expression and the same
track position (AttachClusters does not change it), and stops at the
last row, which the unchanged condition below still tests. Each thread
therefore calls AttachClusters for the same rows, in the same order and
with the same arguments as before.

GPUTPCGMMergerFollowLoopers on an M1 Max with Metal, 1/4 of a 30 kHz
Pb-Pb time frame: 217 ms -> 77 ms. The code is not specific to Metal.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ktf
GPU: skip the rows out of reach of a looper in a loop of their own
3e69d68
AttachClustersLooperFollow scans all rows after each propagation step
and attaches clusters in the two to four rows within 1.5 cm of the
track. On a GPU the threads of a warp sit at different radii, so each
of them finds its rows at different iterations of the scan, and the
warp runs the attachment once per row that any of its threads is close
to, with one or two threads active each time.

Skip the rows out of reach in an inner loop without attachment, so that
all threads of a warp reach AttachClusters in the same iteration.

The inner loop only advances j over rows for which the condition of the
attachment is false, evaluated with the same expression and the same
track position (AttachClusters does not change it), and stops at the
last row, which the unchanged condition below still tests. Each thread
therefore calls AttachClusters for the same rows, in the same order and
with the same arguments as before.

GPUTPCGMMergerFollowLoopers on an M1 Max with Metal, 1/4 of a 30 kHz
Pb-Pb time frame: 217 ms -> 77 ms. The code is not specific to Metal.
@ktf
ktf requested a review from davidrohr as a code owner November 12, 2026 13:18
@ktf

ktf commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

@davidrohr this has an incredible effect on my laptop. It's probably worth checking if it improves CUDA / HIP as well.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davidrohr

davidrohr commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

This makes a lot of sense. There is actually a TODO for exactly this in the code :). But this function is anyway rewritten in the new tracking devlopment. Please leave the PR open, I'll see if I can merge it as is or if it needs changing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@davidrohr davidrohr Awaiting requested review from davidrohr davidrohr is a code owner

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ktf @davidrohr
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.