For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo module
tmem
Defines layout atoms for Blackwell Tensor Memory (TMEM).
TMemLoad and TMemStore wrap tcgen05.ld and tcgen05.st in the
32x32b shape as load and store atoms, issued through TMemEngine. A warp
issues each one together. In tcgen05 addresses, thread t of warp
w reaches TMEM lane 32 (w % 4) + t, and its value v is column v past
the address: the TMEM map fixes lane, warp and value bits, and nothing free
may reach the two lane bits the warp picks. The register side is cols
registers in each of the warp's 32 threads.
Neither atom waits. Their completions are counters: TMemLoadWait is
tcgen05.wait::ld and TMemStoreWait is tcgen05.wait::st, each of which
waits for all of this thread's outstanding loads or stores. As with
TMemEngine.copy_to_async and copy_from_async, the register operand must
be a register tile, a loaded fragment is valid only after the load wait, and
a stored fragment must not change before the store wait.
You can import these APIs from the layout.atoms.tmem module:
from layout.atoms.tmem import TMemLoad, TMemLoadWait, TMemStore, TMemStoreWaitStructs
-
TMemLoad:tcgen05.ld.32x32b.x{cols}: a warp loads its TMEM quadrant'scolscolumns, each thread its own lane. -
TMemLoadWait:tcgen05.wait::ld: waits for all of this thread's TMEM loads. -
TMemStore:tcgen05.st.32x32b.x{cols}: a warp storescolscolumns into its TMEM quadrant, each thread its own lane. -
TMemStoreWait:tcgen05.wait::st: waits for all of this thread's TMEM stores.
Functions
-
tmem_32x32b_map: Returns the TMEM operand of a32x32baccess ofcolscolumns.