[Relay] IndexedGraph improvements in preparation for Collage#11481
[Relay] IndexedGraph improvements in preparation for Collage#11481jwfromm merged 5 commits intoapache:mainfrom
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. |
mbaret
left a comment
There was a problem hiding this comment.
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
jwfromm
left a comment
There was a problem hiding this comment.
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.