Skip to content

[OpenMP][offload] Grid size selection convergence - #5000

Merged
ronlieb merged 4 commits into
amd-stagingfrom
amd/dev/ro-i/ol-grid-conv
Oct 21, 2026
Merged

ronlieb merged 4 commits into
amd-stagingfrom
amd/dev/ro-i/ol-grid-conv

Conversation

@ro-i

@ro-i ro-i commented Oct 16, 2026

Copy link
Copy Markdown

No description provided.

@ro-i
ro-i force-pushed the amd/dev/ro-i/ol-grid-conv branch from fcffb20 to 876335e Compare October 16, 2026 20:05
ro-i added 4 commits October 20, 2026 07:55
Large reductions (> 32 B per team) get one block per CU, scalar ones
16 waves per CU, on every AMDGPU device.
…c code

Default to 6 blocks/CU on AMDGPU, and trade threads for blocks while
the distribute loop has iterations for them, as the AMDGPU plugin does.
Only big-jump-loop kernels keep AMDGPU-specific heuristics. Remove the
AMDGPU knobs for the replaced ones: occupancy-based team counts, low
trip count blocks/threads, ADJUST_TEAMS, and the xteam reduction knobs.
Give big-jump-loop kernels one thread per iteration, like No-Loop ones,
capped at 1M blocks as before. This removes the AMDGPU launch geometry
hook and the LIBOMPTARGET_AMDGPU_BIG_JUMP_LOOP_MAX_TOTAL_TEAMS envar.
@ro-i
ro-i force-pushed the amd/dev/ro-i/ol-grid-conv branch from 876335e to 28f91ca Compare October 20, 2026 14:04
@ro-i

ro-i commented Oct 20, 2026

Copy link
Copy Markdown
Author

This is the downstream part for converging grid size selection up- and downstream. For upstream, corresponding patches are planned and going to be posted as soon as this PR has landed downstream

@ro-i
ro-i marked this pull request as ready for review October 20, 2026 14:06
@ro-i
ro-i requested a review from jhuber6 as a code owner October 20, 2026 14:06
@ro-i
ro-i requested a review from ronlieb October 20, 2026 14:06
@ronlieb

ronlieb commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

!PSDB

@ronlieb

ronlieb commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

also landing ROCm/aomp#2633 (review)

@ronlieb
ronlieb merged commit 4fa790b into amd-staging Oct 21, 2026
158 of 165 checks passed
@ronlieb
ronlieb deleted the amd/dev/ro-i/ol-grid-conv branch October 21, 2026 10:52
ronlieb added a commit that referenced this pull request Oct 23, 2026
- restore downstream LIBOMPTARGET_AMDGPU_LOW_TRIPCOUNT and
LIBOMPTARGET_BLOCKS_FOR_LOW_TRIP_COUNT
- restore handling of short xteam reductions that don't use the whole
device to be handled like regular SPMD loops
- restore handling of no-loop and big-jump-loop kernels that don't use
the whole device so that they get less threads and more blocks, like
regular SPMD kernels

---------

Co-authored-by: theRonShark <rlieberm@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants