GEMM + ReduceScatter with Workgroup Specialization Example#317
Merged
GEMM + ReduceScatter with Workgroup Specialization Example#317
Conversation
mawad-amd
reviewed
Jan 14, 2026
examples/22_gemm_one_shot_reduce_scatter_wg_specialization/gemm_reduce_scatter.py
Outdated
Show resolved
Hide resolved
mawad-amd
reviewed
Jan 14, 2026
Collaborator
mawad-amd
left a comment
There was a problem hiding this comment.
Thanks for the PR, Kyle! I know it is a draft but I left a couple of comments.
examples/22_gemm_one_shot_reduce_scatter_wg_specialization/gemm_reduce_scatter.py
Outdated
Show resolved
Hide resolved
examples/22_gemm_one_shot_reduce_scatter_wg_specialization/benchmark.py
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Hi @mawad-amd , as you mentioned in #169, do I need to add a test for this like https://github.com/ROCm/iris/blob/main/tests/examples/test_all_load_bench.py? |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a GEMM + ReduceScatter example that uses workgroup specialization to overlap computation and communication on AMD GPUs. The implementation divides SMs into GEMM workgroups for matrix multiplication and communication workgroups for scatter operations.
Changes:
- Added validation function for reduce-scatter operations
- Implemented persistent GEMM kernel with integrated ReduceScatter using workgroup specialization
- Created benchmark infrastructure with timing, validation, and tracing capabilities
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| examples/common/validation.py | Added validate_reduce_scatter function to verify reduce-scatter correctness |
| examples/22_gemm_one_shot_reduce_scatter_wg_specialization/gemm_reduce_scatter.py | Core kernel implementing GEMM + ReduceScatter with SM specialization |
| examples/22_gemm_one_shot_reduce_scatter_wg_specialization/matmul_wrapper.py | PyTorch autograd wrapper for the GEMM kernel |
| examples/22_gemm_one_shot_reduce_scatter_wg_specialization/benchmark.py | Benchmark script with validation, timing, and distributed setup |
examples/22_gemm_one_shot_reduce_scatter_wg_specialization/benchmark.py
Outdated
Show resolved
Hide resolved
examples/22_gemm_one_shot_reduce_scatter_wg_specialization/matmul_wrapper.py
Outdated
Show resolved
Hide resolved
mawad-amd
approved these changes
Jan 20, 2026
Collaborator
mawad-amd
left a comment
There was a problem hiding this comment.
Looks good. Thanks, Kyle!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
To add an example of GEMM + ReduceScatter by workgroup specialization. Resolve #178
Technical Details
It's an one-shot GEMM + ReduceScatter kernel, using
atomic_addto do reduce in-place.Test Plan
As discussed, it's been tested locally.
Test Result
Submission Checklist