-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Relay] IndexedGraph improvements in preparation for Collage #11481
Conversation
Are the properties in |
I'd forgotten I'd adjusted the visit order in IndexedGraph to respect idx(x) < idx(y) => y does not depend on x with let-bound vars. That deserves proper unit testing. Stand by. |
466acce
to
3031c73
Compare
3031c73
to
ab76f30
Compare
This is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just some comments on the PR structure. The changes to IndexedGraph look superficially good to me, but I'm not that familiar with the code there. It'd be great for @mbrookhart to take a look over those elements specifically.
ab76f30
to
64ed6e9
Compare
Thanks @mbaret , PTAL. Unfortunately Matthew is out for a while so it's up to us to build up expertise ourselves. |
- Complete the implementation of WithFields. (Unfortunately they appear to be without unit tests and I continue this tradition...) - InferTypeExpr for InferTypeLocal but return the expression rather than the type. - Remove python binding of InlineComposites since C++ impl was removed some time ago. - Make IndexedGraph<Expr/DFPattern> more robust as stand-alone datastructure, and avoid unnecessary copies. This will become a fundamental datastructure in Collage rather than just a helper for DFPatternMatcher. - Extend IndexedGraph with a notion of 'basic block' on every dataflow node. Needed by Collage to avoid impossible partitions.
- More tests
- More tests
7b37d9a
to
bd7200c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work @mbs-octoml and the review @mbaret. This LGTM so I'm going to go ahead and merge it.
I goofed in apache#11481 in moving a dominates check to an ICHECK (and I'm confused how it got through ci?). It is ok to match a sub-graph which has dataflow outside of the sub-graph, provided all such flows eventually come into the sub-graph.
Shoot I goofed and will need #11616 to fix it. |
…11481) * [Relay] Odd's 'n ends changes to help Collage. - Complete the implementation of WithFields. (Unfortunately they appear to be without unit tests and I continue this tradition...) - InferTypeExpr for InferTypeLocal but return the expression rather than the type. - Remove python binding of InlineComposites since C++ impl was removed some time ago. - Make IndexedGraph<Expr/DFPattern> more robust as stand-alone datastructure, and avoid unnecessary copies. This will become a fundamental datastructure in Collage rather than just a helper for DFPatternMatcher. - Extend IndexedGraph with a notion of 'basic block' on every dataflow node. Needed by Collage to avoid impossible partitions. * - Revert non IndexedGraph changes. * - Stick to 'Indexed graph' terminology - More tests * - Stick to 'Indexed graph' terminology - More tests * - Remove silly unit test
IndexedGraph turns out to be a fundamental datastructure in Collage. This PR gives it some polish.