Skip to content

Adding C Wrappers for alltoall and broadcast - #12668

Merged
mberenjk merged 6 commits into
developfrom
users/mberenjk/add_func_c_wrapper
Oct 9, 2026
Merged

mberenjk merged 6 commits into
developfrom
users/mberenjk/add_func_c_wrapper

Conversation

@mberenjk

@mberenjk mberenjk commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add C wrappers for alltoall and broadcast.

Technical Details

C wrappers are needed by PyTorch to enable these APIs for Triton ROCSHMEM:

  • rocshmem_ctx_alltoallmem_wg

  • rocshmem_ctx_broadcastmem_wg

Issue Tracking

JIRA ID: AIROCSHMEM-546

Test Plan

Disassemble build/librocshmem_device_gfx950.bc to LLVM IR text and verify that all expected wrapper functions are present as unmangled C symbols.

Test Result

From the full symbol list above, all wrappers are visible as plain, unmangled C names. Additionally, at least one test for alltoall and one test for broadcast have been added to tests/functional_tests/device_bitcode_tester.cpp.

Submission Checklist

@mberenjk
mberenjk requested a review from a team as a code owner October 1, 2026 21:19
@therock-pr-bot

therock-pr-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/rocshmem/src/device/rocshmem_wrapper.cc; no test file found
🚫 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?

@therock-pr-bot

therock-pr-bot Bot commented Oct 1, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

Remove wrappers that expose non-ctx symbols (e.g. rocshmem_int_alltoall_wave,
rocshmem_int_broadcast_wg) that have no corresponding public API declarations
in rocshmem_COLL.hpp. Only ctx versions exist for these in the public headers.

Removed wrappers:
- alltoall typed wave (rocshmem_TYPE_alltoall_wave)
- alltoall untyped mem (rocshmem_alltoallmem_wg/wave)
- broadcast typed wg (rocshmem_TYPE_broadcast_wg)
- broadcast typed wave (rocshmem_TYPE_broadcast_wave)
- broadcast untyped mem (rocshmem_broadcastmem_wg/wave)

Retained wrappers with valid public API:
- alltoall typed wg (rocshmem_TYPE_alltoall_wg)
- tile_broadcast variants (rocshmem_tile_broadcast{,_wave,_wg})

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@abouteiller abouteiller 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.

minor comment issue, needs merge

@mberenjk
mberenjk merged commit 71609b8 into develop Oct 9, 2026
81 of 83 checks passed
@mberenjk
mberenjk deleted the users/mberenjk/add_func_c_wrapper branch October 9, 2026 00:28
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

anujshuk-amd pushed a commit that referenced this pull request Oct 12, 2026
## Motivation

Add C wrappers for alltoall and broadcast.

## Technical Details

C wrappers are needed by PyTorch to enable these APIs for Triton
ROCSHMEM:

- rocshmem_ctx_alltoallmem_wg

- rocshmem_ctx_broadcastmem_wg

## Issue Tracking
JIRA ID: AIROCSHMEM-546


## Test Plan

Disassemble build/librocshmem_device_gfx950.bc to LLVM IR text and
verify that all expected wrapper functions are present as unmangled C
symbols.

## Test Result

From the full symbol list above, all wrappers are visible as plain,
unmangled C names. Additionally, at least one test for alltoall and one
test for broadcast have been added to
tests/functional_tests/device_bitcode_tester.cpp.

## Submission Checklist

---------

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants