Fix stale output type bugs in rewrites#2204
Open
ricardoV94 wants to merge 1 commit into
Open
Conversation
Member
Author
Agent report |
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.
Follow up to #2169 (fixed by #2167).
I had claude do an exhaustive search of rewrites that may do similar fatal/wrong reasoning based on output.type that may become stale. Narrowed down to rewrites where it would return invalid results or raise errors.
It found two, which are fixed here with regression tests.
This is a symptom of a bad design. Broadcasting in always implicit from the input static types. If an input has static shape 1 along a dimension it is allowed to broadcast with other inputs by the Op. If it has None it is not. Rewrites though may replace a None dimension by a 1, and a graph that did not allow an input to broadcast now allows (see #408 for a suggested solution).
For rewrites, it means we can't do either of the following: