Dot product for matmul#97
Draft
mstn wants to merge 17 commits into
Draft
Conversation
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
Partial application
Notes
Generic Partial Application
The issue with generic
partial.apply-leftis that its type witness does not constrain the inlined generic type strongly enough.We defined it roughly as:
For matmul, we need:
Conceptually this is correct. But after inlining, the checker does not use:
to force every generic
Binside the inlined body to become:So the structural closure-building path ends up with fresh metavariables like:
instead of the concrete
ix b.The first symptom was that two helper closures inside
partial.apply-leftwere instantiated at different fresh types:Combining those helpers into one def fixed that part by making both use the same variable:
But it still did not connect that variable to the concrete type required by:
name.matmul-f32-product-at : ({lhs,rhs} * ix b) -> f32So the remaining mismatch became:
In short:
ty(B)is currently just an object flowing through the graph. It is not treated by the checker as a singleton proof that unifiesBwith the concrete type carried by the witness. Once the generic helper is inlined, the intended relationship between the witness and the type parameter is lost or too weak.