Skip to content

[AMDGPU] comgr: Preserve drain s_wait_dscnt in bumpNextWaitDscnt#2584

Merged
xintin merged 2 commits into
ROCm:amd-stagingfrom
xintin:hotswap-ds-drain-wait-fix
May 20, 2026
Merged

[AMDGPU] comgr: Preserve drain s_wait_dscnt in bumpNextWaitDscnt#2584
xintin merged 2 commits into
ROCm:amd-stagingfrom
xintin:hotswap-ds-drain-wait-fix

Conversation

@xintin
Copy link
Copy Markdown

@xintin xintin commented May 18, 2026

Follow-up to #2369. The split-aware wait bump was incrementing drains (s_wait_dscnt 0) along with bounded waits, relaxing them and letting split halves escape into a downstream data hazard.
Skip the bump when imm == 0; non-drain waits still bump by +1.

This will unlock PR #2281.

(follow-up #2585): a small dataflow pass at the wait site computing the bump from (outstanding-count-at-wait, K). It would subsume the drain special-case naturally and remove the // TODO: marker left in bumpNextWaitDscnt.

@xintin xintin requested review from jmmartinez and yxsamliu May 18, 2026 13:02
@xintin xintin requested review from chinmaydd and lamb-j as code owners May 18, 2026 13:02
@xintin xintin added comgr Related to Code Object Manager hotswap Related to the Comgr Hotswap feature labels May 18, 2026
@xintin xintin force-pushed the hotswap-ds-drain-wait-fix branch from 839a3c6 to 89555a7 Compare May 18, 2026 13:11
Follow-up to llvm#2369. The split-aware wait bump was incrementing drains
(s_wait_dscnt 0) along with bounded waits, relaxing them and letting
split halves escape into a downstream data hazard. Skip the bump when
imm == 0; non-drain waits still bump by +1.

Signed-off-by: xintin <gaurav.verma@amd.com>
@xintin xintin force-pushed the hotswap-ds-drain-wait-fix branch from 89555a7 to 3f5e244 Compare May 18, 2026 15:33
Copy link
Copy Markdown

@jmmartinez jmmartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, otherwise it looks good to me.

Comment thread amd/comgr/src/comgr-hotswap-patch-trampoline.cpp Outdated
Comment thread amd/comgr/test-unit/HotswapElfTest.cpp
Copy link
Copy Markdown

@chinmaydd chinmaydd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo Juan's nits

Signed-off-by: xintin <gaurav.verma@amd.com
@xintin xintin enabled auto-merge (squash) May 20, 2026 07:06
@xintin xintin merged commit 3b177f1 into ROCm:amd-staging May 20, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comgr Related to Code Object Manager hotswap Related to the Comgr Hotswap feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants