Fix matmul_reduce_scatter wrapper passing unsupported bias argument#530
Open
Fix matmul_reduce_scatter wrapper passing unsupported bias argument#530
Conversation
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>
Contributor
There was a problem hiding this comment.
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
biasargument from the wrapper's delegated call. - Realign forwarded arguments with the underlying function's supported parameter order.
| >>> 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) |
Collaborator
Author
There was a problem hiding this comment.
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>
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.
Summary
OpsNamespace.matmul_reduce_scatter()was passingbiasas the 5th positional argument tomatmul_reduce_scatter(), which doesn't have abiasparameterbiasbecameasync_op,async_opbecameconfig, etc.ctx.ops.matmul_reduce_scatter()raisedTypeError: matmul_reduce_scatter() takes from 4 to 7 positional arguments but 8 were givenbiasfrom the call, matching howmatmul_all_reducewrapper already worksTest plan
🤖 Generated with Claude Code