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 2021/07/21 17:42:07 UTC

[GitHub] [tvm] zxy844288792 commented on a change in pull request #8523: [Bugfix] Preserve IRModule type definition and imports in NameMangleExtFuncs

zxy844288792 commented on a change in pull request #8523:
URL: https://github.com/apache/tvm/pull/8523#discussion_r674199240



##########
File path: tests/python/relay/test_tensor_array.py
##########
@@ -780,5 +780,32 @@ def run(dtype, shape):
     run("int32", [2, 3])
 
 
+@tvm.testing.uses_gpu
+def test_static_tensor_array_gather_partition():
+    def run(dtype, shape):
+        mod = tvm.IRModule()
+        p = Prelude(mod)
+        static_tensor_array_ops = StaticTensorArrayOps(p, dtype, shape)
+        static_tensor_array_ops.register()
+
+        tensor_array = p.get_global_var_static("tensor_array", dtype, shape)
+        tensor = p.get_tensor_ctor_static("tensor_constructor", dtype, shape)
+        write = p.get_global_var_static("tensor_array_write", dtype, shape)
+        gather = p.get_global_var_static("tensor_array_gather", dtype, shape)
+        v = relay.var("v")
+        indice = relay.var("indice")
+        init_tensor_array = tensor_array(relay.const(3))
+        tensor_array1 = write(init_tensor_array, relay.const(0), tensor(v))
+        tensor_array2 = write(tensor_array1, relay.const(1), tensor(v))
+        tensor_array3 = write(tensor_array2, relay.const(2), tensor(v))
+        out = gather(tensor_array3, indice)
+        mod["main"] = relay.Function([v, indice], out)
+        from tvm.relay.op.contrib.tensorrt import partition_for_tensorrt

Review comment:
       > 1. Move to the beginning to this function.
   > 2. Add a guard to make sure TRT is enabled.
   > 3. Add a comment saying what to test. For example, you can say this is to make sure type definition and imports are preserved during the BYOC pipeline.
   
   Since we are not actually running through trt but just check graph_partition pass work, do we still need to make sure TRT is ebabled?




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