# TritonGPUOps ### `ttg.async_commit_group` (triton::gpu::AsyncCommitGroupOp) _Commit pending async copies into an async group that can be waited on_ Syntax: ``` operation ::= `ttg.async_commit_group` (`tokens` $inputTokens^)? attr-dict ``` Closes the current batch of async_copy_* operations and allows for them to be waited on with `ttg.async_wait`. This is required in order to ensure async copy operations can be waited on. Traits: `VerifyMemDescLayoutsTrait`, `VerifyTensorLayoutsTrait` Interfaces: `InferTypeOpInterface` #### Operands: | Operand | Description | | :-----: | ----------- | | `inputTokens` | variadic of async token type | #### Results: | Result | Description | | :----: | ----------- | | `asyncToken` | async token type | ### `ttg.async_copy_global_to_local` (triton::gpu::AsyncCopyGlobalToLocalOp) _Copy data from global memory to local memory asynchronously_ Syntax: ``` operation ::= `ttg.async_copy_global_to_local` $src `,` $result (`mask` $mask^)? (`other` $other^)? attr-dict `:` type($src) `->` type($result) ``` This operation copies data from global memory to local memory asynchronously. This is analogue to `tt.load` except the data are copied to local memory pointed to by the memory descriptor instead of a distributed tensor. The rest of the operands are the same as `tt.load`. Contiguity is the maximum number of elements that can be loaded in a single vector with the given layout and mask. This allows op to use `async_copy_global_to_local` even if the alignment cannot be proven based on IR. The data will only be available in local memory after `ttg.async_wait` is issued to wait on the completion of `async_copy_global_to_local`. The async copy operations must be committed using `ttg.async_commit_group` to close the batch and allow for them to be waited on. Traits: `AttrSizedOperandSegments`, `GlobalToLocalCopyTrait`, `VerifyMemDescLayoutsTrait`, `VerifyTensorLayoutsTrait` Interfaces: `InferTypeOpInterface`, `PredicatedOpInterface` #### Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
cachePolicy | ::mlir::Attribute | any attribute |
isVolatile | ::mlir::BoolAttr | bool attribute |
contiguity | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
num | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
addrSpace | ::mlir::triton::gpu::AddrSpaceAttr | |
scope | ::mlir::triton::gpu::BarrierScopeAttr | barrier synchronization scope |
| Attribute | MLIR Type | Description |
|---|---|---|
force_warp_shuffle | ::mlir::UnitAttr | unit attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
axis | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
nbytes | ::mlir::IntegerAttr | 32-bit signless integer attribute |
alignment | ::mlir::IntegerAttr | 32-bit signless integer attribute |
third_party_allocation | ::mlir::UnitAttr | unit attribute |
shared_cluster_state | ::mlir::UnitAttr | unit attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
asm_string | ::mlir::StringAttr | string attribute |
constraints | ::mlir::StringAttr | string attribute |
pure | ::mlir::BoolAttr | bool attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
alignment | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
atomic_rmw_op | ::mlir::triton::RMWOpAttr | allowed 32-bit signless integer cases: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
axis | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
axis | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
axis | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
offsets | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
order | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
maxStage | ::mlir::IntegerAttr | 32-bit signless integer attribute |
stage | ::mlir::IntegerAttr | 32-bit signless integer attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
source | ::mlir::triton::gpu::ThreadDomainAttr | {{% markdown %}} TritonGPU tensors differ from usual tensors in that they contain a _layout_ attribute which determines how the data should be partitioned across CUDA threads. Formally speaking, we define a layout as a function \mathcal{L} that maps a multi-dimensional tensor index $i \in \mathbb{Z}^d$ to a set of integers T corresponding to the indices of the CUDA threads allowed to access some data at index $i$. For example, let us consider the layout function: \mathcal{L}(0, 0) = {0, 4} \mathcal{L}(0, 1) = {1, 5} \mathcal{L}(1, 0) = {2, 6} \mathcal{L}(1, 1) = {3, 7} Then, attaching $\mathcal{L} to a tensor $T$ would mean that: - T[0,0] is owned by both cuda thread 0 and 4 - T[0,1] is owned by both cuda thread 1 and 5 - T[1,0] is owned by both cuda thread 2 and 6 - T[1,1] is owned by both cuda thread 3 and 7 Right now, Triton implements two main classes of layouts: shared, and distributed. {{% /markdown %}} |
destination | ::mlir::triton::gpu::ThreadDomainAttr | {{% markdown %}} TritonGPU tensors differ from usual tensors in that they contain a _layout_ attribute which determines how the data should be partitioned across CUDA threads. Formally speaking, we define a layout as a function \mathcal{L} that maps a multi-dimensional tensor index $i \in \mathbb{Z}^d$ to a set of integers T corresponding to the indices of the CUDA threads allowed to access some data at index $i$. For example, let us consider the layout function: \mathcal{L}(0, 0) = {0, 4} \mathcal{L}(0, 1) = {1, 5} \mathcal{L}(1, 0) = {2, 6} \mathcal{L}(1, 1) = {3, 7} Then, attaching $\mathcal{L} to a tensor $T$ would mean that: - T[0,0] is owned by both cuda thread 0 and 4 - T[0,1] is owned by both cuda thread 1 and 5 - T[1,0] is owned by both cuda thread 2 and 6 - T[1,1] is owned by both cuda thread 3 and 7 Right now, Triton implements two main classes of layouts: shared, and distributed. {{% /markdown %}} |
| Attribute | MLIR Type | Description |
|---|---|---|
domain | ::mlir::triton::gpu::ThreadDomainAttr | {{% markdown %}} TritonGPU tensors differ from usual tensors in that they contain a _layout_ attribute which determines how the data should be partitioned across CUDA threads. Formally speaking, we define a layout as a function \mathcal{L} that maps a multi-dimensional tensor index $i \in \mathbb{Z}^d$ to a set of integers T corresponding to the indices of the CUDA threads allowed to access some data at index $i$. For example, let us consider the layout function: \mathcal{L}(0, 0) = {0, 4} \mathcal{L}(0, 1) = {1, 5} \mathcal{L}(1, 0) = {2, 6} \mathcal{L}(1, 1) = {3, 7} Then, attaching $\mathcal{L} to a tensor $T$ would mean that: - T[0,0] is owned by both cuda thread 0 and 4 - T[0,1] is owned by both cuda thread 1 and 5 - T[1,0] is owned by both cuda thread 2 and 6 - T[1,1] is owned by both cuda thread 3 and 7 Right now, Triton implements two main classes of layouts: shared, and distributed. {{% /markdown %}} |
| Attribute | MLIR Type | Description |
|---|---|---|
omitUniformHint | ::mlir::UnitAttr | unit attribute |
| Attribute | MLIR Type | Description |
|---|---|---|
partitionNumWarps | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
warpGroupStartIds | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
requestedRegisters | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
actualRegisters | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |