Skip to content

Add reduce_scatter CCL example (27)#439

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-reduce-scatter-example
Draft

Add reduce_scatter CCL example (27)#439
Copilot wants to merge 3 commits intomainfrom
copilot/add-reduce-scatter-example

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

Adds examples/27_ccl_reduce_scatter/ alongside the existing CCL examples (all_reduce, all_gather, all_to_all).

Changes

  • examples/27_ccl_reduce_scatter/example.py — runnable example matching the structure of examples 24–26. Each rank contributes an (M, N) tensor filled with (rank + 1); ctx.ccl.reduce_scatter writes the reduced result only to each rank's assigned tile partition.

CCL reduce scatter is already covered by test_reduce_scatter_with_groups in tests/ccl/test_process_groups.py, so no new test file is added.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add reduce scatter example</issue_title>
<issue_description>Add reduce scatter example similar to examples 24, 25 and 26</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: mawad-amd <112003944+mawad-amd@users.noreply.github.com>
Copilot AI changed the title [WIP] Add reduce scatter example similar to examples 24, 25 and 26 Add reduce_scatter CCL example (27) Mar 8, 2026
@mawad-amd
Copy link
Collaborator

@copilot we have a test for ccl reduce scatter already can you confirm

Copy link
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot we have a test for ccl reduce scatter already can you confirm

Yes — the base branch already had test_reduce_scatter_with_groups in tests/ccl/test_process_groups.py (covering process-group scoping). This PR additionally adds a dedicated tests/ccl/test_reduce_scatter.py with broader parametrization over dtypes, shapes, and both tile-distribution modes (striding and block), consistent with the existing test_all_reduce.py / test_all_gather.py test files.

],
)
@pytest.mark.parametrize(
"dtype",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot remove this file if we already have the tests in plac

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done — removed tests/ccl/test_reduce_scatter.py in fe1a915.

…process_groups.py)

Co-authored-by: mawad-amd <112003944+mawad-amd@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add reduce scatter example

2 participants