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/06/11 23:44:19 UTC

[GitHub] [incubator-tvm] antinucleon opened a new pull request #5782: [topi] fix strategy for sparse dense cuda

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


   


----------------------------------------------------------------
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] antinucleon commented on pull request #5782: [topi] fix strategy for sparse dense cuda

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


   Updated


----------------------------------------------------------------
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] vinx13 commented on a change in pull request #5782: [topi] fix strategy for sparse dense cuda

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



##########
File path: python/tvm/relay/op/strategy/x86.py
##########
@@ -294,11 +294,16 @@ def batch_matmul_strategy_cpu(attrs, inputs, out_type, target):
                                     plevel=15)
     return strategy
 
-@schedule_sparse_dense.register("cpu")
-def schedule_sparse_dense_cpu(attrs, outs, target):
-    """schedule sparse_dense for x86"""
-    with target:
-        return topi.x86.schedule_sparse_dense(outs)
+@sparse_dense_strategy.register("cpu")
+def sparse_dense_strategy_cpu(attrs, inputs, out_type, target):
+    """batch_matmul x86 strategy"""

Review comment:
       ```suggestion
       """sparse_dense x86 strategy"""
   ```




----------------------------------------------------------------
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] junrushao1994 commented on a change in pull request #5782: [topi] fix strategy for sparse dense cuda

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



##########
File path: python/tvm/relay/op/strategy/generic.py
##########
@@ -599,12 +599,30 @@ def batch_matmul_strategy(attrs, inputs, out_type, target):
                                 name="batch_matmul.generic")
     return strategy
 
-# sparse_dense
-@generic_func
-def schedule_sparse_dense(attrs, outs, target):
-    """schedule sparse_dense"""
-    with target:
-        return topi.generic.schedule_sparse_dense(outs)
+# sparse dense
+def wrap_compute_sparse_dense(topi_compute):
+    """wrap sparse dense topi compute"""
+    def _compute_sparse_dense(attrs, inputs, out_type):
+        return [topi_compute(inputs[0], inputs[1], inputs[2], inputs[3])]
+    return _compute_sparse_dense
+
+@override_native_generic_func("sparse_dense_strategy")
+def sparse_dense_strategy(attrs, inputs, out_type, target):
+    """sparse dense generic strategy"""
+    logger.warning("sparse dense is not optimized for this platform.")
+    strategy = _op.OpStrategy()
+    strategy.add_implementation(wrap_compute_sparse_dense(topi.nn.sparse_dense),
+                                wrap_topi_schedule(topi.generic.schedule_sparse_dense),
+                                name="sparse_dense.generic")
+    return strategy
+
+
+# # sparse_dense

Review comment:
       remove those lines?




----------------------------------------------------------------
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] vinx13 merged pull request #5782: [topi] fix strategy for sparse dense cuda

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


   


----------------------------------------------------------------
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] antinucleon edited a comment on pull request #5782: [topi] fix strategy for sparse dense cuda

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


   @vinx13 @ceruleangu 
   
   I fixed the strategy so it is able to lower now. However, the schedule is not working with the current master. Could you fix it?
   
   To verify it, please enable CUDA test at:
   https://github.com/apache/incubator-tvm/blob/master/tests/python/relay/test_sparse_dense_convert.py#L50
   
   Maybe you can take away this PR and send new PR to address these issues. Once it is fixed I will close this PR.


----------------------------------------------------------------
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] tqchen commented on pull request #5782: [topi] fix strategy for sparse dense cuda

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


   @antinucleon please updater as per comment


----------------------------------------------------------------
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] antinucleon commented on pull request #5782: [topi] fix strategy for sparse dense cuda

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


   @vinx13 @ceruleangu 
   
   I fixed the strategy so it is able to lower now. However, the schedule is not working with the current master. Could you fix it?
   
   To verify it, please enable CUDA test at:
   https://github.com/apache/incubator-tvm/blob/master/tests/python/relay/test_sparse_dense_convert.py#L50


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