Skip to content

[Relax] Fix matmul and reductions with zero-size dimension return uninitialized memory#19680

Draft
cchung100m wants to merge 9 commits into
apache:mainfrom
cchung100m:issue-19578
Draft

[Relax] Fix matmul and reductions with zero-size dimension return uninitialized memory#19680
cchung100m wants to merge 9 commits into
apache:mainfrom
cchung100m:issue-19578

Conversation

@cchung100m
Copy link
Copy Markdown
Contributor

Hi Committers,

This PR fixes issues #19578. Any suggestions would be appreciated if you are available.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces handling for zero-size dimensions during the legalization of matmul and statistical operators (such as product and sum) by returning filled tensors with appropriate identity values. However, several critical runtime issues were identified in the implementation, including typos ("trix" instead of "tirx"), a missing import for "ShapeExpr", and the use of lowercase "false" instead of "False", all of which would result in "NameError" exceptions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread python/tvm/relax/transform/legalize_ops/linear_algebra.py Outdated
Comment thread python/tvm/relax/transform/legalize_ops/statistical.py Outdated
Comment thread python/tvm/relax/transform/legalize_ops/statistical.py Outdated
Comment thread python/tvm/relax/transform/legalize_ops/statistical.py Outdated
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