Skip to content

Test one kernel driving two tensors through two peer tables - #552

Open
mawad-amd wants to merge 9 commits into
mainfrom
muhaawad/unify-test
Open

mawad-amd wants to merge 9 commits into
mainfrom
muhaawad/unify-test

Conversation

@mawad-amd

Copy link
Copy Markdown
Collaborator

Adds a single test parameterized over providers. It allocates two
symmetric tensors, takes each one's own peer table, and runs one kernel
that reads the peer's first tensor through the first table and writes the
peer's second tensor through the second.

Technical Details

Test Plan

Test Result

Submission Checklist

mawad-amd and others added 2 commits September 22, 2026 08:32
Adds a single test parameterized over providers. It allocates two
symmetric tensors, takes each one's own peer table, and runs one kernel
that reads the peer's first tensor through the first table and writes the
peer's second tensor through the second.

What that reaches which a single-tensor test cannot: each tensor resolves
only through its own table. Iris and rocSHMEM both allocate from one
symmetric heap, so the peer delta is a constant of the heap and any table
happens to translate any pointer. Torch Symmetric Memory is symmetric
memory rather than a symmetric heap -- each tensor is its own allocation
with its own peer mapping -- so it has one translation per tensor and the
deltas differ between allocations. A kernel reusing one table for two
tensors works on the heap providers and silently mistranslates on the
per-tensor one.

Adding a provider is one entry in PROVIDERS; Torch Symmetric Memory joins
when its provider lands.

Providers are built inside the fixture rather than at module scope so an
unavailable one skips its own parameters instead of collecting zero items,
which would make pytest exit 5 and fail the distributed run.
@mawad-amd
mawad-amd marked this pull request as draft September 22, 2026 15:56
@github-actions github-actions Bot added in-progress We are working on it iris Iris project issue labels Sep 22, 2026
The device-side contract is a plain int64 table, so it does not depend on
which backend consumes it. Adds a Gluon kernel that does the same manual
translation and parameterizes the test over both, so the same two tables
are asserted to drive either dialect to the same result.

Sizes the BlockedLayout from BLOCK_SIZE rather than hardcoding [1]: the
existing Gluon tests use blocks of 32 or fewer, where one element per lane
covers the block. At 256 it does not.
The Gluon BlockedLayout has to agree with the block, and the lane count in
it is not a constant: 64 on CDNA, 32 on NVIDIA and RDNA. Query it with
triton.runtime.driver.active.get_current_target().warp_size and pass it in
as a constexpr, rather than hardcoding the CDNA value.

Asserts the block divides evenly into warps, so a bad pairing fails with a
clear message rather than as a layout compile error.
peer_ptrs[r] is the tensor's address on rank r, so subtracting our own
entry from our own pointer is subtracting a number from itself. The
byte-cast and add cancelled with it. Carried over from the heap-anchored
kernel, where the anchor names the heap rather than the allocation and the
offset is real.

The kernel no longer needs its own rank, so CUR_RANK goes too.
Every method on it forwarded unchanged. Iris.allocate_symmetric,
get_rank, get_num_ranks and barrier already match what the rocSHMEM
provider exposes, signatures included, so the context goes into PROVIDERS
unwrapped.

Needing an adapter would have meant the two interfaces had not actually
converged. Also drops a .name attribute nothing read.
@mawad-amd
mawad-amd marked this pull request as ready for review September 22, 2026 21:45

This branch has not been deployed

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

Labels

in-progress We are working on it iris Iris project issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant