DistributedClosestPoint GPU-related optimizations - #1974
Open
publixsubfan wants to merge 12 commits into
Open
Conversation
HIP architectures appear to do temporal coalescing; that is, memory
accesses for array-of-struct types that would be individually strided
can be coalesced so long as the loads are all issued before the next
wait ("s_waitcnt vmcnt(*)"). In some cases, that makes loading the whole
struct faster than through a struct-of-arrays layout.
We should revisit this when we get a chance on Nvidia platforms.
Use fmin/fmax to perform clamping operation. This avoids extra instructions that are generated to perform a generic ternary-based clamp operation.
publixsubfan
requested review from
Arlie-Capps,
BradWhitlock,
bmhan12,
jcs15c,
kennyweiss and
rhornung67
September 1, 2026 18:06
Contributor
|
@publixsubfan , the first line of your performance table is labeled "Clean." Does this mean "before optimizations?" |
Arlie-Capps
approved these changes
Sep 1, 2026
Contributor
Author
@Arlie-Capps, yes -- I think that would be a better wording. |
Member
|
@publixsubfan does this PR address any of the memory issues (i.e., "leaked" memory) observed by user applications? |
Contributor
Author
|
Unfortunately no, this PR won't improve that situation. There's some other potential optimizations I'm looking at that may help with the memory usage. |
Member
Thanks. Just checking. |
rhornung67
approved these changes
Sep 2, 2026
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.
Summary
This is a grab-bag of various optimizations to improve DistributedClosestPoint query performance:
BVH2Nodestruct for representing internal nodes. Since HIP architectures appear to do temporal coalescing, this may be more efficient than having separate arrays for the bounding boxes and child node indices by reducing the number of memory waits (s_waitcnt vmcnt(*))traverseTreeShared()which uses GPU shared memory to cache the most-recently used entries in the BVH stackfmax/fminfor clamp operation insidesquared_distance(Point, BoundingBox)This seems to improve GPU codegen compared to the generic
axom::utilities::clampVal()function.Performance results
I rebased this branch onto Kenny's branch in #1952, and ran a test with the following setup: