Skip to content

feat(rocSHMEM): add TDM in the IPC backend, #AIROCSHMEM-515 - #12568

Merged
amirsojoodi merged 14 commits into
developfrom
users/asojoodi/rocshmem-tdm
Oct 26, 2026
Merged

amirsojoodi merged 14 commits into
developfrom
users/asojoodi/rocshmem-tdm

Conversation

@amirsojoodi

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in USE_TDM build option that lets work-group put/get on gfx1250 stage IPC transfers through LDS using the hardware Tensor Data Mover, instead of the existing lane-copy path. Disabled by default and a safe no-op everywhere it isn't applicable.

Technical Details

  • New public API: rocshmem_set_tdm_lds() lets a kernel hand rocSHMEM a scratch LDS buffer; rocshmem_query_tdm_lds_bytes() reports the size to allocate. Without registration, put/get always take the existing plain-copy path.
  • New env var: ROCSHMEM_TDM_TILE_BYTES (default 0 = auto-size the tile from the device's available LDS per block).
  • Core implementation: src/tdm.hpp wraps the tensor_load_to_lds/tensor_store_from_lds intrinsics (descriptor construction, cache-policy encoding, double-buffered tile-copy helpers); wired into the IPC work-group copy path in util.hpp/ipc_policy.hpp.
  • rocSHMEM's own getmem/putmem/putmem_signal kernels auto-opt-in using their own dynamic LDS.
  • New unit tests (tdm_raw_put_gtest, tdm_struct_put_gtest), built only when USE_IPC AND USE_TDM.

Test Result

  • -DGPU_TARGETS="gfx1250" (no USE_TDM) builds clean.
  • -DUSE_TDM=1 -DGPU_TARGETS="gfx1250" builds and runs with no issues. Perf numbers will be reported

Issue Tracking

JIRA ID: AIROCSHMEM-515

Copilot AI balanced review requested due to automatic review settings September 30, 2026 19:09
@amirsojoodi
amirsojoodi requested a review from a team as a code owner September 30, 2026 19:09
@amirsojoodi amirsojoodi changed the title feat(rocSHMEM): add TDM in the IPC backend feat(rocSHMEM): add TDM in the IPC backend, #AIROCSHMEM-515 Sep 30, 2026
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Optional registration can consume uninitialized LDS state, tile alignment can corrupt transfers, and the new tests currently exercise only fallback behavior.

Review effort: Balanced
Findings: 3 High severity · 1 Medium severity · 6 Low severity

Open (10)
What changed in this PR

Adds optional gfx1250 Tensor Data Mover acceleration for rocSHMEM IPC work-group transfers.

Changes:

  • Adds TDM descriptor, cache-policy, LDS staging, and configuration support.
  • Integrates TDM with IPC operations and host-launched kernels.
  • Adds functional integration and raw/structured transfer tests.
File Description
projects/​rocshmem/​CMakeLists.txt Adds USE_TDM.
projects/​rocshmem/​cmake/​rocshmem_config.h.in Exposes the build option.
projects/​rocshmem/​src/​tdm.hpp Implements TDM operations and LDS registration.
projects/​rocshmem/​src/​util.hpp Adds TDM-staged work-group copying.
projects/​rocshmem/​src/​ipc_policy.hpp Routes IPC work-group copies through TDM.
projects/​rocshmem/​src/​constmem.hpp Adds TDM constant-memory configuration.
projects/​rocshmem/​src/​constmem.cpp Resolves runtime tile sizing.
projects/​rocshmem/​src/​envvar.hpp Declares the TDM environment category.
projects/​rocshmem/​src/​envvar.cpp Adds tile-size configuration.
projects/​rocshmem/​src/​rocshmem.cpp Implements the host LDS-size query.
projects/​rocshmem/​src/​rocshmem_gpu.cpp Implements device APIs and kernel opt-in.
projects/​rocshmem/​src/​host/​host.cpp Allocates dynamic LDS for stream operations.
projects/​rocshmem/​include/​rocshmem/​rocshmem.hpp Declares and documents public TDM APIs.
projects/​rocshmem/​include/​rocshmem/​rocshmem_RMA_X.hpp Documents TDM-enabled RMA behavior.
projects/​rocshmem/​tests/​functional_tests/​workgroup_primitives.cpp Enables TDM in work-group tests.
projects/​rocshmem/​tests/​functional_tests/​team_reduction_tester.cpp Registers dynamic LDS in reduction tests.
projects/​rocshmem/​tests/​unit_tests/​CMakeLists.txt Registers TDM unit tests.
projects/​rocshmem/​tests/​unit_tests/​tdm_raw_put_gtest.hpp Implements raw-transfer fixtures.
projects/​rocshmem/​tests/​unit_tests/​tdm_raw_put_gtest.cpp Defines raw-transfer cases.
projects/​rocshmem/​tests/​unit_tests/​tdm_struct_put_gtest.hpp Implements structured-transfer fixtures.
projects/​rocshmem/​tests/​unit_tests/​tdm_struct_put_gtest.cpp Defines structured-transfer cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread projects/rocshmem/src/tdm.hpp Resolved
Comment thread projects/rocshmem/src/util.hpp Resolved
Comment thread projects/rocshmem/src/util.hpp Resolved
Comment thread projects/rocshmem/src/ipc_policy.hpp Resolved
Comment thread projects/rocshmem/src/envvar.cpp Resolved
Comment thread projects/rocshmem/src/tdm.hpp Resolved
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 1, 2026
@amirsojoodi
amirsojoodi force-pushed the users/asojoodi/rocshmem-tdm branch from 6982686 to bc78308 Compare October 19, 2026 19:34
@amirsojoodi
amirsojoodi force-pushed the users/asojoodi/rocshmem-tdm branch from bc78308 to 8f00567 Compare October 22, 2026 15:23
Comment thread projects/rocshmem/src/constmem.hpp Resolved
Comment thread projects/rocshmem/src/ipc_policy.hpp Resolved
Comment thread projects/rocshmem/src/rocshmem_gpu.cpp Resolved
Comment thread projects/rocshmem/src/tdm.hpp Resolved
Comment thread projects/rocshmem/src/util.hpp Resolved
@amirsojoodi
amirsojoodi merged commit 13c7605 into develop Oct 26, 2026
66 of 68 checks passed
@amirsojoodi
amirsojoodi deleted the users/asojoodi/rocshmem-tdm branch October 26, 2026 05:11
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation organization: ROCm project: rocshmem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants