tilelang.contrib.cutedsl.cpasync¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extract the tensormap pointer from a TMA Copy Atom. |
|
Load data from global memory to shared memory using TMA (Tensor Memory Access). |
|
Load one tile from global memory into every CTA of a cluster at once. |
|
Load four rows of one 2-D tile with |
|
Store data from shared memory to global memory using TMA (Tensor Memory Access). |
|
Store four rows of one 2-D tile with |
|
Copy a byte range into a peer CTA's shared memory with |
|
Reduce data from shared memory to global memory using TMA with atomic ADD reduction. |
|
Indicate arrival of warp issuing TMA_STORE. |
|
Wait for TMA_STORE operations to complete. |
|
Asynchronously copy data from global memory to shared memory. |
|
Prefetch a TMA descriptor. |
|
Waits on a mbarrier with a specified phase (blocking loop). |
|
|
Module Contents¶
- tilelang.contrib.cutedsl.cpasync.cp_async_commit(*, loc=None, ip=None)¶
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.cp_async_wait(n, *, loc=None, ip=None)¶
- Parameters:
n (cutlass.cute.typing.Int)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.mbarrier_init(mbar_ptr, arrive_count, *, loc=None, ip=None)¶
- Parameters:
mbar_ptr (cutlass.cute.typing.Pointer)
arrive_count (cutlass.cute.typing.Int)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.mbarrier_expect_tx(mbar_ptr, tx_count, *, loc=None, ip=None)¶
- Parameters:
mbar_ptr (cutlass.cute.typing.Pointer)
tx_count (cutlass.cute.typing.Int)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.arrive_and_expect_tx(mbar_ptr, tx_count, *, loc=None, ip=None)¶
- Parameters:
mbar_ptr (cutlass.cute.typing.Pointer)
tx_count (cutlass.cute.typing.Int)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.mbarrier_arrive(mbar_ptr, cta_id=None, *, loc=None, ip=None)¶
- Parameters:
mbar_ptr (cutlass.cute.typing.Pointer)
cta_id (cutlass.cute.typing.Int | None)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.mbarrier_cp_async_arrive_noinc(mbar_ptr, *, loc=None, ip=None)¶
- Parameters:
mbar_ptr (cutlass.cute.typing.Pointer)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.cp_async_gs(size, dst, src)¶
- tilelang.contrib.cutedsl.cpasync.cp_async_gs_conditional(size, dst, src, cond)¶
- tilelang.contrib.cutedsl.cpasync.extract_tensormap_ptr(tma_atom, *, loc=None, ip=None)¶
extract the tensormap pointer from a TMA Copy Atom. :param tma_atom: The TMA Copy Atom :type tma_atom: CopyAtom
- Parameters:
tma_atom (cutlass.cute.CopyAtom)
- Return type:
cutlass.cute.Pointer
- tilelang.contrib.cutedsl.cpasync.tma_load(tma_desc, mbar, smem_ptr, crd, use_2cta=False, im2col_offsets=None, *, eviction_kind='EVICT_NORMAL', loc=None, ip=None)¶
Load data from global memory to shared memory using TMA (Tensor Memory Access).
- Parameters:
tma_desc (CopyAtom or tensormap_ptr or Tensor of tensormap_ptr) – TMA descriptor for the tensor
mbar (Pointer) – Mbarrier pointer in shared memory
smem_ptr (Pointer) – Destination pointer in shared memory
crd (tuple[Int, ...]) – Coordinates tuple for the tensor access
eviction_kind (str) – L2 eviction policy: EVICT_NORMAL, EVICT_FIRST or EVICT_LAST
use_2cta (cutlass.cutlass_dsl.Constexpr[bool])
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_load_multicast(tma_desc, mbar, smem_ptr, multicast_mask, crd, *, eviction_kind='EVICT_NORMAL', loc=None, ip=None)¶
Load one tile from global memory into every CTA of a cluster at once.
Every receiving CTA waits on its own mbarrier at the same shared-memory offset, which the hardware signals with
complete_tx.- Parameters:
multicast_mask (Int) – bit per CTA rank selecting the receivers
mbar (cutlass.cute.Pointer)
smem_ptr (cutlass.cute.Pointer)
crd (cutlass.cute.typing.Int | tuple[cutlass.cute.typing.Int, Ellipsis])
eviction_kind (cutlass.cutlass_dsl.Constexpr[str])
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_load_gather4(tma_desc, mbar, smem_ptr, col, rows, *, eviction_kind='EVICT_NORMAL', loc=None, ip=None)¶
Load four rows of one 2-D tile with
.tile::gather4(sm_100+).- Parameters:
mbar (cutlass.cute.Pointer)
smem_ptr (cutlass.cute.Pointer)
col (cutlass.cute.typing.Int)
rows (tuple[cutlass.cute.typing.Int, cutlass.cute.typing.Int, cutlass.cute.typing.Int, cutlass.cute.typing.Int])
eviction_kind (cutlass.cutlass_dsl.Constexpr[str])
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_store(tma_desc, smem_ptr, crd, *, eviction_kind='EVICT_NORMAL', loc=None, ip=None)¶
Store data from shared memory to global memory using TMA (Tensor Memory Access).
- Parameters:
tma_desc (TMA descriptor) – TMA descriptor for the tensor
smem_ptr (Pointer) – Source pointer in shared memory
crd (tuple[Int, ...]) – Coordinates tuple for the tensor access
eviction_kind (str) – L2 eviction policy: EVICT_NORMAL, EVICT_FIRST or EVICT_LAST
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_store_scatter4(tma_desc, smem_ptr, col, rows, *, eviction_kind='EVICT_NORMAL', loc=None, ip=None)¶
Store four rows of one 2-D tile with
.tile::scatter4(sm_100a+).- Parameters:
smem_ptr (cutlass.cute.Pointer)
col (cutlass.cute.typing.Int)
rows (tuple[cutlass.cute.typing.Int, cutlass.cute.typing.Int, cutlass.cute.typing.Int, cutlass.cute.typing.Int])
eviction_kind (cutlass.cutlass_dsl.Constexpr[str])
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_store_cluster(dst, src, dst_cta, size_bytes, mbar, *, loc=None, ip=None)¶
Copy a byte range into a peer CTA’s shared memory with
cp.async.bulk.The completion barrier announced to the peer is the one at the same shared-memory offset as
mbar. Call from a single thread.- Parameters:
dst (cutlass.cute.Pointer)
src (cutlass.cute.Pointer)
dst_cta (cutlass.cute.typing.Int)
size_bytes (cutlass.cute.typing.Int32)
mbar (cutlass.cute.Pointer)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_reduce(tma_desc, smem_ptr, crd, *, eviction_kind='EVICT_NORMAL', loc=None, ip=None)¶
Reduce data from shared memory to global memory using TMA with atomic ADD reduction.
This performs an atomic add of shared memory data to global memory using the TMA unit’s reduce capability.
- Parameters:
tma_desc (TMA descriptor) – TMA descriptor for the tensor
smem_ptr (Pointer) – Source pointer in shared memory
crd (tuple[Int, ...]) – Coordinates tuple for the tensor access
eviction_kind (cutlass.cutlass_dsl.Constexpr[str])
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_store_arrive(*, loc=None, ip=None)¶
Indicate arrival of warp issuing TMA_STORE. Corresponds to PTX instruction: cp.async.bulk.commit_group;
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.tma_store_wait(count, *, read=None, loc=None, ip=None)¶
Wait for TMA_STORE operations to complete. Corresponds to PTX instruction: cp.async.bulk.wait_group{.read} <count>;
- Parameters:
count (Int) – The number of outstanding bulk async groups to wait for
read (Optional[bool]) – Whether to use the PTX .read modifier
- Return type:
None
Asynchronously copy data from global memory to shared memory.
- Parameters:
dst (Pointer) – Destination pointer in shared memory
src (Pointer) – Source pointer in global memory
size (Int) – Size of the copy in bytes
modifier (Int) – Cache modifier
cp_size (Int) – Optional copy size override
src_size (cutlass.cute.typing.Int)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.prefetch_tma_descriptor(tma_desc, *, loc=None, ip=None)¶
Prefetch a TMA descriptor. Corresponds to PTX instruction: prefetch.tensormap;
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.mbarrier_wait(mbar_ptr, phase, timeout_ns=10000000)¶
Waits on a mbarrier with a specified phase (blocking loop).
Uses the primitive try-wait wrapper in a spin loop.
- Parameters:
mbar_ptr (cutlass.cute.typing.Pointer)
phase (cutlass.cute.typing.Int)
timeout_ns (int)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.mbarrier_cp_async_arrive(mbar_ptr, *, loc=None, ip=None)¶
- Parameters:
mbar_ptr (cutlass.cute.typing.Pointer)
- Return type:
None
- tilelang.contrib.cutedsl.cpasync.fence_proxy_async()¶
- tilelang.contrib.cutedsl.cpasync.fence_barrier_init()¶