You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "MayYouBeProsperous (via GitHub)" <gi...@apache.org> on 2023/04/11 07:32:40 UTC

[GitHub] [tvm] MayYouBeProsperous opened a new pull request, #14575: [Frontend][Paddle] [PaddlePaddle Hackathon 4]add attribute support for some ops

MayYouBeProsperous opened a new pull request, #14575:
URL: https://github.com/apache/tvm/pull/14575

   add `dropout_prob` attribute for `dropout` op.
   add `approximate` attribute for `gelu` op.
   add `offset` attribute  for `hard_sigmoid` op.
   add `data_format` attribute for `pixel_shuffle` op.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] jiangjiajun commented on a diff in pull request #14575: [Frontend][Paddle] [PaddlePaddle Hackathon 4]add attribute support for dropout/gelu/hard_sigmoid/pixel_shuffle

Posted by "jiangjiajun (via GitHub)" <gi...@apache.org>.
jiangjiajun commented on code in PR #14575:
URL: https://github.com/apache/tvm/pull/14575#discussion_r1163528537


##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -502,7 +502,9 @@ def convert_dropout(g, op, block):
     """Operator converter for dropout."""
 
     x = g.get_node(op.input("X")[0])
-    g.add_node(op.output("Out")[0], x)
+    dropout_prob = op.attr("dropout_prob")
+    out = _op.nn.dropout(x, dropout_prob)
+    g.add_node(op.output("Out")[0], out)

Review Comment:
   There're two mode in dropout, refer https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/Dropout_cn.html#dropout for more details
   
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] tvm-bot commented on pull request #14575: [Frontend][Paddle] [PaddlePaddle Hackathon 4]add attribute support for some ops

Posted by "tvm-bot (via GitHub)" <gi...@apache.org>.
tvm-bot commented on PR #14575:
URL: https://github.com/apache/tvm/pull/14575#issuecomment-1502833519

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-ccs-start-->
    * cc @heliqi, @jiangjiajun <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] MayYouBeProsperous commented on a diff in pull request #14575: [Frontend][Paddle] [PaddlePaddle Hackathon 4]add attribute support for dropout/hard_sigmoid/pixel_shuffle

Posted by "MayYouBeProsperous (via GitHub)" <gi...@apache.org>.
MayYouBeProsperous commented on code in PR #14575:
URL: https://github.com/apache/tvm/pull/14575#discussion_r1163809783


##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -827,10 +829,26 @@ def convert_gelu(g, op, block):
     """Operator converter for gelu."""
 
     x = g.get_node(op.input("X")[0])
-    out = x * (
-        _expr.const(0.5, dtype="float32")
-        + _op.erf(x * _expr.const(0.5**0.5, dtype="float32")) * _expr.const(0.5, dtype="float32")
-    )
+    approximate = op.attr("approximate")

Review Comment:
   Done.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] masahi merged pull request #14575: [Frontend][Paddle] [PaddlePaddle Hackathon 4]add attribute support for dropout/hard_sigmoid/pixel_shuffle

Posted by "masahi (via GitHub)" <gi...@apache.org>.
masahi merged PR #14575:
URL: https://github.com/apache/tvm/pull/14575


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] jiangjiajun commented on a diff in pull request #14575: [Frontend][Paddle] [PaddlePaddle Hackathon 4]add attribute support for dropout/gelu/hard_sigmoid/pixel_shuffle

Posted by "jiangjiajun (via GitHub)" <gi...@apache.org>.
jiangjiajun commented on code in PR #14575:
URL: https://github.com/apache/tvm/pull/14575#discussion_r1163528537


##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -502,7 +502,9 @@ def convert_dropout(g, op, block):
     """Operator converter for dropout."""
 
     x = g.get_node(op.input("X")[0])
-    g.add_node(op.output("Out")[0], x)
+    dropout_prob = op.attr("dropout_prob")
+    out = _op.nn.dropout(x, dropout_prob)
+    g.add_node(op.output("Out")[0], out)

Review Comment:
   There's two mode in dropout, refer https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/Dropout_cn.html#dropout for more details
   
   



##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -827,10 +829,26 @@ def convert_gelu(g, op, block):
     """Operator converter for gelu."""
 
     x = g.get_node(op.input("X")[0])
-    out = x * (
-        _expr.const(0.5, dtype="float32")
-        + _op.erf(x * _expr.const(0.5**0.5, dtype="float32")) * _expr.const(0.5, dtype="float32")
-    )
+    approximate = op.attr("approximate")

Review Comment:
   There's no need to implement `approximate` strategy, it's just a strategy to boost computation in Paddle



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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


[GitHub] [tvm] MayYouBeProsperous commented on a diff in pull request #14575: [Frontend][Paddle] [PaddlePaddle Hackathon 4]add attribute support for dropout/hard_sigmoid/pixel_shuffle

Posted by "MayYouBeProsperous (via GitHub)" <gi...@apache.org>.
MayYouBeProsperous commented on code in PR #14575:
URL: https://github.com/apache/tvm/pull/14575#discussion_r1163809209


##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -502,7 +502,9 @@ def convert_dropout(g, op, block):
     """Operator converter for dropout."""
 
     x = g.get_node(op.input("X")[0])
-    g.add_node(op.output("Out")[0], x)
+    dropout_prob = op.attr("dropout_prob")
+    out = _op.nn.dropout(x, dropout_prob)
+    g.add_node(op.output("Out")[0], out)

Review Comment:
   Done.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

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