mirror of
https://github.com/tile-ai/tilelang.git
synced 2026-10-25 07:14:16 +08:00
* reimplement ThreadSync pass * fix bugs * remove old storage_access * remove deadcode for debugging * format * add WhileOp & expose MakeGuard in constr_visitor * bugfix * bugfix * bugfix * bugfix * trigger ci * add try for checking * bugfix * update tvm with better analyzer * update tvm * Log for debugging in thread_storage_sync * format * consider let node * typo * remove debugging log * consider while op in thread_sync & fix bug sbout letnode * add testing for thread_sync issues * update testing for thread_sync * format * consider T.Ramp expr * remove useless header * format --------- Co-authored-by: LeiWang1999 <leiwang1999@outlook.com>
39 lines
946 B
Python
39 lines
946 B
Python
import tilelang
|
|
import tilelang.testing
|
|
from tilelang import language as T
|
|
|
|
|
|
@tilelang.jit(
|
|
pass_configs={
|
|
tilelang.PassConfigKey.TL_DISABLE_WARP_SPECIALIZED: True,
|
|
tilelang.PassConfigKey.TL_DISABLE_TMA_LOWER: True,
|
|
},
|
|
)
|
|
def get_kernel(m: int):
|
|
dtype = "int32"
|
|
|
|
@T.prim_func
|
|
def test_kernel(a: T.Tensor[(m,), dtype], b: T.Tensor[(m,), dtype]):
|
|
with T.Kernel(1, threads=64) as (bx):
|
|
shared = T.alloc_shared((64,), dtype)
|
|
tx = T.get_thread_binding(0)
|
|
tid = tx + bx * 64
|
|
|
|
for i in T.serial((m // 2 - tx) // 64 + 1):
|
|
for j in T.vectorized(2):
|
|
shared[tx] += a[(i * 64 + tid) * 2 + j]
|
|
|
|
b[tid] = shared[tx]
|
|
|
|
return test_kernel
|
|
|
|
|
|
def test_issue_1106():
|
|
m = 200
|
|
kernel = get_kernel(m)
|
|
assert "__syncthreads" not in kernel.get_kernel_source()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
tilelang.testing.main()
|