Skip to content

Fix matmul_reduce_scatter wrapper passing unsupported bias argument#530

Open
mawad-amd wants to merge 2 commits intomainfrom
muhaawad/fix-ops-wrapper
Open

Fix matmul_reduce_scatter wrapper passing unsupported bias argument#530
mawad-amd wants to merge 2 commits intomainfrom
muhaawad/fix-ops-wrapper

Conversation

@mawad-amd
Copy link
Copy Markdown
Collaborator

Summary

  • OpsNamespace.matmul_reduce_scatter() was passing bias as the 5th positional argument to matmul_reduce_scatter(), which doesn't have a bias parameter
  • This shifted all arguments: bias became async_op, async_op became config, etc.
  • Calling ctx.ops.matmul_reduce_scatter() raised TypeError: matmul_reduce_scatter() takes from 4 to 7 positional arguments but 8 were given
  • Fix: remove bias from the call, matching how matmul_all_reduce wrapper already works

Test plan

  • Existing tests pass (they import the function directly, bypassing the wrapper)
  • The wrapper now matches the underlying function signature

🤖 Generated with Claude Code

The OpsNamespace.matmul_reduce_scatter() wrapper was passing `bias` as a
positional argument to the underlying function which doesn't accept it.
This caused TypeError when calling ctx.ops.matmul_reduce_scatter().

The bias parameter was being passed as async_op, shifting all subsequent
arguments by one position.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 2, 2026 15:36
@mawad-amd mawad-amd requested review from BKP and neoblizz as code owners May 2, 2026 15:36
@github-actions github-actions Bot added in-progress We are working on it iris Iris project issue labels May 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR fixes the OpsNamespace.matmul_reduce_scatter() wrapper so it no longer forwards an extra positional argument to the underlying matmul_reduce_scatter() implementation, which previously caused wrapper calls to fail with a TypeError.

Changes:

  • Remove the unsupported bias argument from the wrapper's delegated call.
  • Realign forwarded arguments with the underlying function's supported parameter order.

Comment thread iris/ops/__init__.py
>>> shmem.ops.matmul_reduce_scatter(output, A, B)
"""
return matmul_reduce_scatter(self._shmem, output_tensor, A, B, bias, async_op, config, workspace)
return matmul_reduce_scatter(self._shmem, output_tensor, A, B, async_op, config, workspace)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. Fixed in 6798ff6 — removed bias from both matmul_all_reduce and matmul_reduce_scatter wrapper signatures. The underlying functions don't support bias; only all_gather_matmul and matmul_all_gather do.

…educe_scatter wrappers

Neither matmul_all_reduce() nor matmul_reduce_scatter() accepts a bias
argument. The wrapper signatures falsely exposed bias=None, silently
dropping it. Remove from both signatures and docstrings.

all_gather_matmul and matmul_all_gather correctly support bias.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants