Fix iris.store hint: use (1, BLOCK_N) instead of (BLOCK_M, BLOCK_N) across all CCL/X collectives#437
Merged
mawad-amd merged 2 commits intomuhaawad/hintsfrom Mar 7, 2026
Merged
Conversation
… all store calls Co-authored-by: mawad-amd <112003944+mawad-amd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add hints in CCL and X implementations
Fix iris.store hint: use (1, BLOCK_N) instead of (BLOCK_M, BLOCK_N) across all CCL/X collectives
Mar 7, 2026
mawad-amd
approved these changes
Mar 7, 2026
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.
hint=(BLOCK_SIZE_M, BLOCK_SIZE_N)asserts 2D cross-row contiguity, which is only valid whenBLOCK_N == N. WhenBLOCK_N < N,stride_m > BLOCK_Nso rows aren't contiguous —getOrderFromContiguitypicks dim-0 for vectorization and emits scalar writes to wrong addresses, leaving zeros in the output (e.g., 256×128 tensor with block 32×16).The fix from PR #434 (
x.all_gather) was not applied consistently; the same bug existed in all other collectiveiris.storecall sites.Changes
iris/ccl/all_gather.py(2 sites) —hint=(BLOCK_SIZE_M, BLOCK_SIZE_N)→hint=(1, BLOCK_SIZE_N)iris/ccl/all_reduce.py(4 sites) —hint=(BLOCK_SIZE_M, BLOCK_SIZE_N)→hint=(1, BLOCK_SIZE_N)iris/ccl/all_to_all.py(2 sites) —hint=(BLOCK_SIZE_M, BLOCK_SIZE_N)→hint=(1, BLOCK_SIZE_N)iris/x/all_reduce.py(1 site) —hint=(tile.block_m, tile.block_n)→hint=(1, tile.block_n)hint=(1, BLOCK_N)asserts only per-row contiguity (BLOCK_N consecutive elements within a row), which holds unconditionally regardless of tile shape.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.