Skip to content

AMDGPU: apply hotswap gfx1250 TDM mask workarounds#3297

Draft
harsh-amd wants to merge 1 commit into
ROCm:amd-stagingfrom
harsh-amd:plat-204339-hotswap-mask-workaround
Draft

AMDGPU: apply hotswap gfx1250 TDM mask workarounds#3297
harsh-amd wants to merge 1 commit into
ROCm:amd-stagingfrom
harsh-amd:plat-204339-hotswap-mask-workaround

Conversation

@harsh-amd

@harsh-amd harsh-amd commented Jul 9, 2026

Copy link
Copy Markdown

Summary:

  • Apply PLAT-204339 strict-mode hotswap mask workarounds for gfx1250 A0 and B0 targets.
  • A0: clear tensor_load_to_lds D# Group 1 wg_mask bits and clear M0[15:0] around remaining cluster_load* instructions.
  • B0: clear tensor_load_to_lds only for cluster_id == 0 / non-cluster waves, using fixed .cluster_dims metadata when available and otherwise a dynamic IB_STS2.CLUSTER_ID check.
  • Leave B0 cluster_load* M0 unchanged; the PLAT-204339 M0 workaround is A0-only.
  • Fail the rewrite when a required strict-mode mask patch cannot allocate scratch or emit code.

Validation on mi300x:

  • cmake --build build --target amd_comgr hotswap-rewrite -j$(nproc)
  • build/bin/llvm-lit -sv build/tools/comgr/test-lit --filter "hotswap-trampoline-tensor|hotswap-trampoline-cluster|hotswap-inplace"
  • Result: 13/13 filtered tests passed.
  • cmake --build build-asan --target amd_comgr hotswap-rewrite -j$(nproc)
  • build-asan/bin/llvm-lit -sv build-asan/tools/comgr/test-lit --filter "hotswap-trampoline-tensor|hotswap-trampoline-cluster|hotswap-inplace"
  • Result: 13/13 filtered ASAN tests passed.

@harsh-amd harsh-amd force-pushed the plat-204339-hotswap-mask-workaround branch 4 times, most recently from f8191d6 to 169e3d6 Compare July 9, 2026 18:21
@harsh-amd harsh-amd added comgr Related to Code Object Manager hotswap Related to the Comgr Hotswap feature labels Jul 9, 2026
@harsh-amd harsh-amd force-pushed the plat-204339-hotswap-mask-workaround branch from 169e3d6 to 86a7bfa Compare July 9, 2026 18:46
@harsh-amd harsh-amd requested a review from scchan July 9, 2026 18:49
@harsh-amd harsh-amd force-pushed the plat-204339-hotswap-mask-workaround branch from 86a7bfa to fdafe44 Compare July 9, 2026 18:57
@chinmaydd

Copy link
Copy Markdown

Can we split this into 2 PRs - first one that adds the strict rewrite and the D# workaround sits on top of that ?

In strict-mode hotswap, apply the PLAT-204339 mask workarounds for both gfx1250 A0 and B0 targets.

A0 clears tensor_load_to_lds D# Group 1 wg_mask bits and wraps remaining cluster_load* instructions with M0 save/clear/restore. B0 clears tensor_load_to_lds only for non-cluster waves, using fixed .cluster_dims metadata when available and otherwise checking IB_STS2.CLUSTER_ID dynamically. B0 cluster loads are left unchanged.

Required mask patches now fail the rewrite if scratch allocation or emission fails, rather than returning unsafe code.

Validation on mi300x:

- cmake --build build --target amd_comgr hotswap-rewrite -j$(nproc)

- build/bin/llvm-lit -sv build/tools/comgr/test-lit --filter 'hotswap-trampoline-tensor|hotswap-trampoline-cluster|hotswap-inplace'

- cmake --build build-asan --target amd_comgr hotswap-rewrite -j$(nproc)

- build-asan/bin/llvm-lit -sv build-asan/tools/comgr/test-lit --filter 'hotswap-trampoline-tensor|hotswap-trampoline-cluster|hotswap-inplace'
@harsh-amd harsh-amd force-pushed the plat-204339-hotswap-mask-workaround branch from fdafe44 to f792b49 Compare July 9, 2026 20:31
@harsh-amd harsh-amd changed the title AMDGPU: apply hotswap A0 mask workarounds AMDGPU: apply hotswap gfx1250 TDM mask workarounds Jul 9, 2026
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.

2 participants