Skip to content

[AMDGPU][COMGR] Add hotswap text displacement infrastructure#3000

Draft
harsh-amd wants to merge 10 commits into
ROCm:amd-stagingfrom
harsh-amd:hotswap-entry-trampolines
Draft

[AMDGPU][COMGR] Add hotswap text displacement infrastructure#3000
harsh-amd wants to merge 10 commits into
ROCm:amd-stagingfrom
harsh-amd:hotswap-entry-trampolines

Conversation

@harsh-amd

@harsh-amd harsh-amd commented Jun 21, 2026

Copy link
Copy Markdown

Summary

  • Add COMGR hotswap text-displacement infrastructure for cases where a patch grows .text directly instead of using only appended trampolines.
  • Update hotswap patch emission to use displacement edits when the replacement needs to grow instruction bytes in place.
  • Add displacement planning, section/symbol adjustment, branch re-encoding, relocation rejection, and kernel-descriptor entry update coverage.
  • Update existing hotswap lit checks for displacement-aware output.

Stack

  1. [AMDGPU][COMGR] Remove COMGR hotswap HSA tool #3007: COMGR hotswap tool removal.
  2. AMDGPU: add hotswap entry trampoline core #3008: trampoline implementation.
  3. This PR: displacement infrastructure.

GitHub cannot use fork-only branches as ROCm PR bases, so this PR still targets amd-staging. The layer-only diff is harsh-amd:comgr-hotswap-entry-trampolines...harsh-amd:hotswap-entry-trampolines.

Testing

  • git diff --check comgr-hotswap-entry-trampolines..comgr-hotswap-displacement
  • make -j$(nproc) HotswapElfTests HotswapMCTests hotswap-rewrite in build-comgr-displacement-shared
  • build-comgr-displacement-shared/test-unit/HotswapElfTests
  • build-comgr-displacement-shared/test-unit/HotswapMCTests
  • make -j$(nproc) test-lit in build-comgr-displacement-shared (70 passed / 11 unsupported)

harsh-amd added a commit to harsh-amd/TheRock that referenced this pull request Jun 21, 2026
ISSUE ID: ROCm/llvm-project#3000

Build on PR ROCm#6007 by pinning amd-llvm to a commit that includes the COMGR hotswap kernel-entry trampoline implementation and rocm-systems to the paired loader-side revert.
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from 4905511 to 02c967b Compare June 21, 2026 15:52
harsh-amd added a commit to harsh-amd/TheRock that referenced this pull request Jun 21, 2026
ISSUE ID: ROCm/llvm-project#3000

Build on PR ROCm#6007 by pinning amd-llvm to a commit that includes the COMGR hotswap kernel-entry trampoline implementation and rocm-systems to the paired loader-side revert.
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from 02c967b to fe6deae Compare June 21, 2026 16:10
harsh-amd added a commit to harsh-amd/TheRock that referenced this pull request Jun 21, 2026
ISSUE ID: ROCm/llvm-project#3000

Build on PR ROCm#6007 by pinning amd-llvm to a commit that includes the COMGR hotswap kernel-entry trampoline implementation and rocm-systems to the paired loader-side revert.
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from fe6deae to 3c1d9b2 Compare June 21, 2026 16:41
harsh-amd added a commit to harsh-amd/TheRock that referenced this pull request Jun 21, 2026
ISSUE ID: ROCm/llvm-project#3000

Build on PR ROCm#6007 by pinning amd-llvm to a commit that includes the COMGR hotswap kernel-entry trampoline implementation and rocm-systems to the paired loader-side revert.
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from 3c1d9b2 to 9eba7e5 Compare June 21, 2026 17:39
harsh-amd added a commit to harsh-amd/TheRock that referenced this pull request Jun 21, 2026
ISSUE ID: ROCm/llvm-project#3000

Build on PR ROCm#6007 by pinning amd-llvm to a commit that includes the COMGR hotswap kernel-entry trampoline implementation and rocm-systems to the paired loader-side revert.
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from de81d5f to d037ab1 Compare June 22, 2026 12:22
harsh-amd added a commit to harsh-amd/TheRock that referenced this pull request Jun 22, 2026
ISSUE ID: ROCm/llvm-project#3000

Build on PR ROCm#6007 by pinning amd-llvm to a commit that includes the COMGR hotswap kernel-entry trampoline implementation and rocm-systems to the paired loader-side revert.
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from d037ab1 to 971b27d Compare June 22, 2026 12:50
@harsh-amd harsh-amd changed the title [AMDGPU][COMGR] Install gfx125x entry trampolines with hotswap [AMDGPU][COMGR] Add hotswap text displacement infrastructure Jun 22, 2026
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from 971b27d to 6904b53 Compare June 22, 2026 17:27
@harsh-amd harsh-amd force-pushed the hotswap-entry-trampolines branch from 6904b53 to 15a9271 Compare June 22, 2026 17:31
@lamb-j lamb-j added the hotswap Related to the Comgr Hotswap feature label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotswap Related to the Comgr Hotswap feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants