fix MATVEC pattern: reject equal-range elementwise reduces#16111
Closed
kimjune01 wants to merge 3 commits intotinygrad:masterfrom
Closed
fix MATVEC pattern: reject equal-range elementwise reduces#16111kimjune01 wants to merge 3 commits intotinygrad:masterfrom
kimjune01 wants to merge 3 commits intotinygrad:masterfrom
Conversation
The subset check `all(r in idx1.ranges for r in idx0.ranges)` is trivially true when both buffers share identical ranges (e.g. (a*b).sum()). A true matvec has asymmetric access: vector ranges are a strict subset of matrix ranges. Evidence: kimjune01/tinygrad-abduction-engine §H5.2
61e1997 to
34fab7c
Compare
Contributor
Changes |
Collaborator
|
I don't even understand what this does. I'm not reading anything written by AI |
This was referenced May 8, 2026
Closed
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.
The MATVEC subset check
all(r in idx1.ranges for r in idx0.ranges)is trivially true when both buffers share identical ranges (e.g.(a*b).sum()). A true matvec has asymmetric access — vector ranges are a strict subset of matrix ranges. Addingset(idx0.ranges) != set(idx1.ranges)rejects the equal case.Evidence & provenance: HYPOTHESIS_GRAPH.md §H5.2