Skip to content

fix: Align matmul batch broadcasting semantics#372

Draft
sjain-stanford wants to merge 1 commit intomainfrom
users/sambhav/matmul-semantics
Draft

fix: Align matmul batch broadcasting semantics#372
sjain-stanford wants to merge 1 commit intomainfrom
users/sambhav/matmul-semantics

Conversation

@sjain-stanford
Copy link
Copy Markdown
Member

Summary

  • Align matmul batch validation with PyTorch-style right-aligned broadcasting while preserving Fusilli's rank >= 2 tensor contract.
  • Reject divisible-but-invalid batch shapes and fix default C stride inference to use finalized output dimensions.
  • Add regression coverage for unequal batch ranks, invalid divisible batches, and under-specified C stride.

Use PyTorch-style right-aligned broadcasting for matmul batch dimensions while preserving the existing rank >= 2 tensor contract.

Reject divisible but non-broadcastable batch dimensions, allow unequal batch-rank inputs, and infer default output strides from the finalized output dimensions.

Co-Authored-By: GPT 5.5 <codex@openai.com>
Signed-off-by: Sambhav Jain <sambhav@alumni.stanford.edu>
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.

1 participant