You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/05/29 02:43:41 UTC

[GitHub] [incubator-tvm] mbrookhart opened a new pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

mbrookhart opened a new pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693


   Following up from conversation in #5689, this PR implements these rules for lifting or embedding constants in Partitioned Functions:
   
   - Pattern input ExprPattern(relay.const):
        - Only match constant nodes that contain the same constant value and embed them in the partitioned functions. In this case, the arguments of partitioned functions will be reduced.
   - Pattern input ConstantPattern:
        - Only match constant nodes and embed them in the partitioned functions. In this case, the arguments of partitioned functions will be reduced.
   - Pattern input VarPattern('x'):
        - Match only the var node with an optional specified name hint. In this case, the arguments of partitioned function is fixed.
   - Pattern input wildcard:
        - Match anything. In this case, the arguments of partitioned function is fixed.
   - Pattern AltPattern:
        - Match either lhs or rhs. depending on which side matched, recursively apply this matching logic and embed constants appropriately based on the contained pattern.
   
   cc @comaniac @mbaret @masahi 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] mbrookhart commented on pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

Posted by GitBox <gi...@apache.org>.
mbrookhart commented on pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693#issuecomment-636192395


   The MacOS build says it failed, but the job just says "failed", no other information. I'm thinking about debasing and kicking off another job


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] mbrookhart edited a comment on pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

Posted by GitBox <gi...@apache.org>.
mbrookhart edited a comment on pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693#issuecomment-636192395


   The MacOS build says it failed, but the job just says "failed", no other information. I'm thinking about rebasing and kicking off another job


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] masahi commented on pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693#issuecomment-636194198


   I confirmed that DNNL codegen test works as expected, and constants are available during codegen. On mobilenet test, it took 45 sec (each for vm and graph, total 90 sec) to compile generated C code on my laptop @comaniac .


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] masahi merged pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

Posted by GitBox <gi...@apache.org>.
masahi merged pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] masahi commented on pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693#issuecomment-636180452


   The Github UI is showing me that some checks are not successful. But I don't see what the issue is. 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] comaniac commented on a change in pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

Posted by GitBox <gi...@apache.org>.
comaniac commented on a change in pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693#discussion_r432604623



##########
File path: src/relay/ir/dataflow_matcher.cc
##########
@@ -613,6 +613,25 @@ class PatternGrouper {
     CHECK_EQ(groups_[gid_].gid, gid_);
   }
 
+  bool EmbedConst(const Expr& expr, const DFPattern pattern) {

Review comment:
       Maybe provide function description to explain the constant embedding rules?

##########
File path: python/tvm/relay/dataflow_pattern/__init__.py
##########
@@ -318,15 +318,14 @@ class VarPattern(DFPattern):
     Parameters
     ----------
     name_hint: str
-        The name of the variable.
-        This name only acts as a hint, and is not used
-        for equality.
+        The name of the variable. Optional, if not provided,
+        the pattern will match any VarNode

Review comment:
       period.

##########
File path: docs/langref/relay_pattern.rst
##########
@@ -266,10 +266,10 @@ Attribute Pattern
 
 Check that the operator matched by the pattern has an attribute with a particular value.
 
-Input
-*****
+Variable Pattern
+****************
 
-Check that the expression is an input, i.e has no parents and is a variable.
+Check that the expression is a relay Variable, and optional provide a name to match to the Variable name

Review comment:
       period.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] masahi commented on pull request #5693: [PatternLang]Conditionally Embedding Constants in Partitioned Functions

Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #5693:
URL: https://github.com/apache/incubator-tvm/pull/5693#issuecomment-636252052


   Thanks @mbrookhart @comaniac 


----------------------------------------------------------------
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:
users@infra.apache.org