MCPcopy Create free account
hub / github.com/tile-ai/tilelang / _test_kernel

Function _test_kernel

testing/python/issue/test_tilelang_issue_1263.py:5–24  ·  view source on GitHub ↗
(M, N)

Source from the content-addressed store, hash-verified

3
4
5def _test_kernel(M, N):
6 dtype = "bfloat16"
7
8 @T.prim_func
9 def fwd_main(
10 KV: T.Tensor((M, N), dtype),
11 ids: T.Tensor((4,), "int32"),
12 ids2: T.Tensor((4,), "int32"),
13 ):
14 with T.Kernel(4, threads=1):
15 A = T.alloc_shared([N], dtype)
16 B = T.alloc_shared([N], dtype)
17
18 for i in T.Pipelined(4, num_stages=1):
19 id = ids[i]
20 id2 = ids2[id]
21 T.copy(KV[id2, :], A)
22 T.clear(B)
23
24 return fwd_main
25
26
27def _test_kernel_if_cond(M, N):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…