TritonInstrumentOps

tti.experimental_assert_uniform (triton::instrument::ExperimentalAssertUniformOp)

Assert the uniform condition

Syntax:

operation ::= `tti.experimental_assert_uniform` $condition `,` $message attr-dict-with-keyword

Assert that the condition is true given all threads in the warp group have the same value, so only one thread needs to evaluate the assert and print the message.

Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{MemoryEffects::Write on ::mlir::triton::GlobalMemory}

Attributes:

AttributeMLIR TypeDescription
message::mlir::StringAttrstring attribute

Operands:

Operand

Description

condition

1-bit signless integer

tti.experimental_buffer_descriptors (triton::instrument::ExperimentalBufferDescriptorsOp)

Define an array of buffer descriptors

Syntax:

operation ::= `tti.experimental_buffer_descriptors` $offsets `,` $lengths `,` $memType attr-dict `:` type($result)

Create a tensor of buffer descriptors packing 32-bit pointer offsets and 32-bit lengths into 64-bit elements.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
offsets::mlir::DenseI32ArrayAttri32 dense array attribute
lengths::mlir::DenseI32ArrayAttri32 dense array attribute
memType::mlir::triton::instrument::MemTypeAttrallowed 32-bit signless integer cases: 0, 1

Results:

Result

Description

result

ranked tensor of floating-point or integer or ptr values

tti.experimental_cluster_cta_id (triton::instrument::ExperimentalClusterCTAIdOp)

Get the CTA id within the current cluster

Syntax:

operation ::= `tti.experimental_cluster_cta_id` attr-dict `:` type($result)

Return the cluster-local CTA id used to index ConSan’s multi-CTA scratch slabs. For single-CTA kernels this is always zero.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Results:

Result

Description

result

32-bit signless integer

tti.experimental_gsan_atomic_cas (triton::instrument::ExperimentalGSanAtomicCASOp)

Lower a GSan-instrumented atomic cas

Syntax:

operation ::= `tti.experimental_gsan_atomic_cas` $sem `,` $scope `,` $ptr `,` $cmp `,` $val attr-dict `:`
              functional-type(operands, $result)

Traits: SameOperandsAndResultEncoding, SameOperandsAndResultShape

Attributes:

AttributeMLIR TypeDescription
sem::mlir::triton::MemSemanticAttrallowed 32-bit signless integer cases: 1, 2, 3, 4
scope::mlir::triton::MemSyncScopeAttrallowed 32-bit signless integer cases: 1, 2, 3

Operands:

Operand

Description

ptr

ptr or ranked tensor of ptr values

cmp

floating-point or ranked tensor of floating-point values or integer or ranked tensor of integer values or ptr or ranked tensor of ptr values

val

floating-point or ranked tensor of floating-point values or integer or ranked tensor of integer values or ptr or ranked tensor of ptr values

Results:

Result

Description

result

floating-point or ranked tensor of floating-point values or integer or ranked tensor of integer values or ptr or ranked tensor of ptr values

tti.experimental_gsan_atomic_rmw (triton::instrument::ExperimentalGSanAtomicRMWOp)

Lower a GSan-instrumented atomic rmw

Syntax:

operation ::= `tti.experimental_gsan_atomic_rmw` $atomic_rmw_op `,` $sem `,` $scope `,` $ptr `,` $val (`,` $mask^)? attr-dict `:`
              functional-type(operands, $result)

Traits: SameOperandsAndResultEncoding, SameOperandsAndResultShape

Attributes:

AttributeMLIR TypeDescription
atomic_rmw_op::mlir::triton::RMWOpAttrallowed 32-bit signless integer cases: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
sem::mlir::triton::MemSemanticAttrallowed 32-bit signless integer cases: 1, 2, 3, 4
scope::mlir::triton::MemSyncScopeAttrallowed 32-bit signless integer cases: 1, 2, 3

Operands:

Operand

Description

ptr

ptr or ranked tensor of ptr values

val

floating-point or ranked tensor of floating-point values or integer or ranked tensor of integer values or ptr or ranked tensor of ptr values

mask

1-bit signless integer or ranked tensor of 1-bit signless integer values

Results:

Result

Description

result

floating-point or ranked tensor of floating-point values or integer or ranked tensor of integer values or ptr or ranked tensor of ptr values

tti.experimental_gsan_init (triton::instrument::ExperimentalGSanInitOp)

Initialize GSan thread

tti.experimental_gsan_tensor_access (triton::instrument::ExperimentalGSanTensorAccessOp)

Instrument a tensor load/store access for GSan

Syntax:

operation ::= `tti.experimental_gsan_tensor_access` $ptr `,` $isStore (`,` $mask^)? attr-dict `:` type($ptr)

Emits runtime instrumentation for a tensor pointer access. The pointer and optional mask are consumed by the GSan runtime.

Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{MemoryEffects::Write on ::mlir::triton::GlobalMemory, MemoryEffects::Write on ::mlir::triton::GlobalMemory}

Attributes:

AttributeMLIR TypeDescription
isStore::mlir::BoolAttrbool attribute

Operands:

Operand

Description

ptr

ptr or ranked tensor of ptr values

mask

1-bit signless integer or ranked tensor of 1-bit signless integer values

tti.experimental_gsan_tensordesc_info (triton::instrument::ExperimentalGSanTensorDescInfoOp)

Decode GSan descriptor metadata from a native tensor descriptor

Syntax:

operation ::= `tti.experimental_gsan_tensordesc_info` $desc attr-dict `:` qualified(type($desc)) `->` type($result)

Decodes a native tensor descriptor into the underlying base pointer, shape and stride values.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand

Description

desc

tensor descriptor type

Results:

Result

Description

result

variadic of any type

tti.experimental_lock_acquire (triton::instrument::ExperimentalLockAcquireOp)

Acquire a lock.

Syntax:

operation ::= `tti.experimental_lock_acquire` $lock (`,` $pred^)? attr-dict `:` type($lock)

Enter a critical section by acquiring a lock with single thread.

Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{MemoryEffects::Write on ::mlir::triton::GlobalMemory}

Operands:

Operand

Description

lock

ptr or ranked tensor of ptr values

pred

1-bit signless integer

tti.experimental_lock_release (triton::instrument::ExperimentalLockReleaseOp)

Release a lock.

Syntax:

operation ::= `tti.experimental_lock_release` $lock (`,` $pred^)? attr-dict `:` type($lock)

Leave a critical section by releasing a lock with single thread.

Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{MemoryEffects::Write on ::mlir::triton::GlobalMemory}

Operands:

Operand

Description

lock

ptr or ranked tensor of ptr values

pred

1-bit signless integer

tti.experimental_memdesc_to_i32 (triton::instrument::ExperimentalMemDescToI32Op)

Convert a memdesc into its base pointer as i32

Syntax:

operation ::= `tti.experimental_memdesc_to_i32` $memdesc attr-dict `:` type($memdesc)

Extract the base pointer from the given memdesc and return it as a 32-bit integer. This can be used to compare the memdesc against tensors of barrier pointers maintained by the concurrency sanitizer.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

Operand

Description

memdesc

memory descriptor type (::mlir::triton::gpu::MemDescType) in Triton IR type system

Results:

Result

Description

result

32-bit signless integer