masahi commented on a change in pull request #4550: [Perf] Add CublasLt extern 
support for better Igemm performance
URL: https://github.com/apache/incubator-tvm/pull/4550#discussion_r360645034
 
 

 ##########
 File path: tests/python/contrib/test_cublas.py
 ##########
 @@ -44,6 +45,64 @@ def verify(target="cuda"):
             c.asnumpy(), np.dot(a.asnumpy().astype(C.dtype), 
b.asnumpy().astype(C.dtype)), rtol=rtol)
     verify()
 
+def roundoff(v, d):
+    return int(np.floor((v + d - 1) / d) * d)
+
+def verify_matmul_add_igemm(in_dtype, out_dtype, rtol=1e-5):
+    n = 1024
+    l = 1024
+    m = 1024
+    L = roundoff(l, 32)
+    N = roundoff(n, 8)
+    N_out = roundoff(n, 32)
+
+    A = tvm.placeholder((N, L), name='A', dtype=in_dtype)
+    B = tvm.placeholder((m, L), name='B', dtype=in_dtype)
+    # C has CUBLASLT_ORDER_COL32 layout, thus a different shape
+    C = cublaslt.matmul(A, B, False, True, m, N_out, dtype=out_dtype)
+    s = tvm.create_schedule(C.op)
+
+    def verify(target="cuda"):
+        if not tvm.module.enabled(target):
+            print("skip because %s is not enabled..." % target)
+            return
+        if not tvm.get_global_func("tvm.contrib.cublas.matmul", True):
 
 Review comment:
   Should be tvm.contrib.cublaslt.matmul
   The CI seems to be with CUDA 10.0, this will skip testing on CI
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to