[GitHub] [incubator-tvm] mbrookhart commented on a change in pull request #5646: Add a check Callback to the Pattern Paritioner

2020-05-21 Thread GitBox


mbrookhart commented on a change in pull request #5646:
URL: https://github.com/apache/incubator-tvm/pull/5646#discussion_r428945054



##
File path: tests/python/relay/test_dataflow_pattern.py
##
@@ -959,4 +984,5 @@ def test_parition_double_batchnorm():
 test_quadruple_partition_dominator()
 test_parition_batchnorm()
 test_parition_double_batchnorm()
+test_parition_check()

Review comment:
   Ooo, I should fix a few of those, thanks for noticing!





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-tvm] mbrookhart commented on a change in pull request #5646: Add a check Callback to the Pattern Paritioner

2020-05-21 Thread GitBox


mbrookhart commented on a change in pull request #5646:
URL: https://github.com/apache/incubator-tvm/pull/5646#discussion_r428944946



##
File path: src/relay/ir/dataflow_matcher.cc
##
@@ -728,16 +729,17 @@ class PatternPartitioner : protected MixedModeMutator {
   Map attrs_;
   std::vector groups_;
   std::unordered_map gid_assignments_;
+  PackedFunc check_;
 };
 
-Expr PartitionPattern(DFPattern pattern, Expr expr, Map attrs) {
-  return PatternPartitioner().Partition(pattern, expr, attrs);
+Expr PartitionPattern(DFPattern pattern, Expr expr, Map attrs,
+  PackedFunc check) {
+  return PatternPartitioner().Partition(pattern, expr, attrs, check);
 }
 
 TVM_REGISTER_GLOBAL("relay.dataflow_pattern.partition")
-.set_body_typed([](DFPattern pattern, Expr expr, Map attrs) {
-  return PartitionPattern(pattern, expr, attrs);
-});
+.set_body_typed([](DFPattern pattern, Expr expr, Map attrs,
+   PackedFunc check) { return PartitionPattern(pattern, 
expr, attrs, check); });

Review comment:
   Tianqi added clang-format-10 to the lint checker, this is the output of 
that version of clang-format.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-tvm] mbrookhart commented on a change in pull request #5646: Add a check Callback to the Pattern Paritioner

2020-05-21 Thread GitBox


mbrookhart commented on a change in pull request #5646:
URL: https://github.com/apache/incubator-tvm/pull/5646#discussion_r428944740



##
File path: include/tvm/relay/dataflow_matcher.h
##
@@ -90,7 +91,8 @@ Expr RewritePatterns(Array callbacks, Expr 
expr);
  *
  * \return Return the paritioned Expr.
  */
-Expr PartitionPattern(DFPattern pattern, Expr expr);

Review comment:
   Yes, missed it in the last PR yesterday :(. Kind of surprised I didn't 
get a compiler warning.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org