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

[GitHub] [tvm] Lunderberg commented on a diff in pull request #14770: [Vulkan] Add `VK_NV_cooperative_matrix` support

Lunderberg commented on code in PR #14770:
URL: https://github.com/apache/tvm/pull/14770#discussion_r1186473675


##########
tests/python/unittest/test_target_codegen_vulkan.py:
##########
@@ -600,5 +602,387 @@ def func(A: T.Buffer((N, 2), "int32")):
     np.testing.assert_array_equal(a[:, 1], (np.arange(N) - offset) % divisor)
 
 
+@T.prim_func

Review Comment:
   Can this `@T.prim_func` definition be moved inside the test that uses it?  Otherwise, any failure to generate the PrimFunc prevents the entire test suite from being run.



##########
python/tvm/tir/op.py:
##########
@@ -3037,6 +3037,148 @@ def TVMBackendFreeWorkspace(device_type, device_id, ptr):
     return call_intrin("int32", "tir.TVMBackendFreeWorkspace", device_type, device_id, ptr)
 
 
+# Intrinsics for the VK_NV_cooperative_matrix Vulkan extension.
+
+
+def cooperative_matrix_load_NV(buffer_mat, offset, src, rows, cols, stride, column_major):

Review Comment:
   The parameters for this intrinsic look very similar to those of [BufferRegion](https://github.com/apache/tvm/blob/main/include/tvm/tir/stmt.h#L1099), but I can't think of any way to use it in this context.  If we could, that would be a nice way to name as many parameters as possible.



##########
python/tvm/tir/op.py:
##########
@@ -3037,6 +3037,148 @@ def TVMBackendFreeWorkspace(device_type, device_id, ptr):
     return call_intrin("int32", "tir.TVMBackendFreeWorkspace", device_type, device_id, ptr)
 
 
+# Intrinsics for the VK_NV_cooperative_matrix Vulkan extension.
+
+
+def cooperative_matrix_load_NV(buffer_mat, offset, src, rows, cols, stride, column_major):
+    """The intrinsic corresponding to the OpCooperativeMatrixLoadNV instruction.
+
+    Parameters
+    ----------
+    buffer_mat: Var
+        The destination buffer with "cooperative_matrix_nv" scope.
+
+    offset: IntImm
+        The element offset for the matrix to be loaded in the destination buffer.
+
+    src: Expr
+        The source pointer expression.
+
+    rows: int
+        The number of rows in the matrix.
+
+    cols: int
+        The number of columns in the matrix.
+
+    stride: Expr

Review Comment:
   Can we specify that this is stride is the number of elements?  Otherwise, there's potential confusion with a stride specified in number of bytes.



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