Skip to content

'vmvx' Dialectlink

Vector extensions to the IREE VM.

This is a reference dialect representing a simple IREE VM-based linear algebra module that is used as a library at runtime. The ops in this dialect map (roughly) 1:1 with the exported functions in the runtime module.

See vmvx.imports.mlir for the full list of exported functions.

Operationslink

ABI opslink

vmvx.binary (VMVX::BinaryOp)link

Performs a strided elementwise operation on two same-rank buffers

Syntax:

operation ::= `vmvx.binary` `op` `` `(` $opcode `:` $element_type `)`
              `lhs` `` `(` $lhs_buffer `offset` $lhs_offset `strides` `[` $lhs_strides `]` `:` type($lhs_buffer) `)`
              `rhs` `` `(` $rhs_buffer `offset` $rhs_offset `strides` `[` $rhs_strides `]` `:` type($rhs_buffer) `)`
              `out` `` `(` $out_buffer `offset` $out_offset `strides` `[` $out_strides `]` `:` type($out_buffer) `)`
              `sizes` `` `(` $sizes `)`
              attr-dict

Performs the operation in-place as if:

  OUT = OP(LHS, RHS)

Where OP is a concrete operation name as defined in ukernel/elementwise.h

Traits: SameVariadicOperandSize

Attributes:link
AttributeMLIR TypeDescription
opcode::mlir::StringAttrstring attribute
element_type::mlir::TypeAttrtype attribute of 8-bit signless integer or 16-bit signless integer or 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
Operands:link
Operand Description
lhs_buffer a reference counted byte buffer
lhs_offset index
lhs_strides variadic of index
rhs_buffer a reference counted byte buffer
rhs_offset index
rhs_strides variadic of index
out_buffer a reference counted byte buffer
out_offset index
out_strides variadic of index
sizes variadic of index

vmvx.copy (VMVX::CopyOp)link

Copy from one buffer to another

Syntax:

operation ::= `vmvx.copy` `in` `` `(` $in_buffer `offset` $in_offset `strides` `[` $in_strides `]` `:` type($in_buffer) `)`
              `out` `` `(` $out_buffer `offset` $out_offset `strides` `[` $out_strides `]` `:` type($out_buffer) `)`
              `sizes` `` `(` $sizes `)`
              `:` $element_type
              attr-dict

Traits: SameVariadicOperandSize

Attributes:link
AttributeMLIR TypeDescription
element_type::mlir::TypeAttrtype attribute of 8-bit signless integer or 16-bit signless integer or 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
Operands:link
Operand Description
in_buffer a reference counted byte buffer
in_offset index
in_strides variadic of index
out_buffer a reference counted byte buffer
out_offset index
out_strides variadic of index
sizes variadic of index

vmvx.fill2d (VMVX::Fill2DOp)link

Fill a tile with a scalar

Syntax:

operation ::= `vmvx.fill2d` `scalar` `` `(` $scalar `:` type($scalar) `)`
              `out` `` `(` $out_buffer `offset` $out_offset `row_stride` $out_row_stride `:` type($out_buffer) `)`
              `sizes` `` `(` $m `,` $n `)`
              attr-dict

Fills a tile with dimensions [m, n] with a scalar.

Operands:link
Operand Description
scalar 8-bit signless integer or 16-bit signless integer or 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
out_buffer a reference counted byte buffer
out_offset index
out_row_stride index
m index
n index

vmvx.unary (VMVX::UnaryOp)link

Performs a strided elementwise unary operation

Syntax:

operation ::= `vmvx.unary` `op` `` `(` $opcode `:` $element_type `)`
              `in` `` `(` $in_buffer `offset` $in_offset `strides` `[` $in_strides `]` `:` type($in_buffer) `)`
              `out` `` `(` $out_buffer `offset` $out_offset `strides` `[` $out_strides `]` `:` type($out_buffer) `)`
              `sizes` `` `(` $sizes `)`
              attr-dict

Performs the operation in-place as if:

  OUT = OP(IN)

Where OP is a concrete operation name as defined in ukernel/elementwise.h

Traits: SameVariadicOperandSize

Attributes:link
AttributeMLIR TypeDescription
opcode::mlir::StringAttrstring attribute
element_type::mlir::TypeAttrtype attribute of 8-bit signless integer or 16-bit signless integer or 32-bit signless integer or 64-bit signless integer or 32-bit float or 64-bit float
Operands:link
Operand Description
in_buffer a reference counted byte buffer
in_offset index
in_strides variadic of index
out_buffer a reference counted byte buffer
out_offset index
out_strides variadic of index
sizes variadic of index

Utility opslink

vmvx.get_buffer_descriptor (VMVX::GetBufferDescriptorOp)link

Late binds a base buffer/offset/strides

Syntax:

operation ::= `vmvx.get_buffer_descriptor` $source `:` type($source) `->` type(results) attr-dict

Queries a base buffer, offset and strides. This op is late bound to its source (alloca, binding, etc), allowing additional layers of transformations to be added as lowering progresses (or for buffers to be combined).

This op has canonicalization rules which will bubble it up through the view stack. A final reconciliation pass is used explicitly to bind it to concrete sources.

Traits: AlwaysSpeculatableImplTrait, SameVariadicResultSize

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:link
Operand Description
source memref of any type values
Results:link
Result Description
base_buffer a reference counted byte buffer
offset index
sizes variadic of index
strides variadic of index

vmvx.get_raw_interface_binding_buffer (VMVX::GetRawInterfaceBindingBufferOp)link

Gets the raw buffer associated with a binding

Syntax:

operation ::= `vmvx.get_raw_interface_binding_buffer` `layout` `(` $layout `)`
              `binding` `(` $binding `)`
              attr-dict

Normally, a slice of a binding buffer is returned via hal.interface.binding.subspan. However, the normal VMVX lowering flow for this presumes that the result is a memref, and upon final conversion, it will offset the memref automatically to make it consistent.

This op is used in situations where earlier in a lowering, we have fully resolved the binding to a buffer and would just like the raw backing buffer as passed to the interface.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:link
AttributeMLIR TypeDescription
layout::mlir::iree_compiler::IREE::HAL::PipelineLayoutAttrexecutable entry point layout specification
binding::mlir::IntegerAttrindex attribute
Results:link
Result Description
buffer a reference counted byte buffer

Enumslink

AccessScopeBitfieldlink

valid AccessScope

Cases:link

Symbol Value String
None 0 None
IndirectCommandRead 1 IndirectCommandRead
ConstantRead 2 ConstantRead
DispatchRead 4 DispatchRead
DispatchWrite 8 DispatchWrite
TransferRead 16 TransferRead
TransferWrite 32 TransferWrite
HostRead 64 HostRead
HostWrite 128 HostWrite
MemoryRead 256 MemoryRead
MemoryWrite 512 MemoryWrite

BufferUsageBitfieldlink

valid BufferUsage

Cases:link

Symbol Value String
None 0 None
TransferSource 1 TransferSource
TransferTarget 2 TransferTarget
Transfer 3 Transfer
DispatchIndirectParams 256 DispatchIndirectParams
DispatchUniformRead 512 DispatchUniformRead
DispatchStorageRead 1024 DispatchStorageRead
DispatchStorageWrite 2048 DispatchStorageWrite
DispatchStorage 3072 DispatchStorage
DispatchImageRead 4096 DispatchImageRead
DispatchImageWrite 8192 DispatchImageWrite
DispatchImage 12288 DispatchImage
SharingExport 65536 SharingExport
SharingReplicate 131072 SharingReplicate
SharingConcurrent 262144 SharingConcurrent
SharingImmutable 524288 SharingImmutable
MappingScoped 16777216 MappingScoped
MappingPersistent 33554432 MappingPersistent
MappingOptional 67108864 MappingOptional
MappingAccessRandom 134217728 MappingAccessRandom
MappingAccessSequentialWrite 268435456 MappingAccessSequentialWrite
Mapping 150994944 Mapping

CallingConventionlink

Calling conversions for linked functions

Cases:link

Symbol Value String
Default 0 Default

CollectiveElementTypelink

valid CollectiveElementType

Cases:link

Symbol Value String
Sint8 0 si8
Uint8 1 ui8
Sint16 2 si16
Uint16 3 ui16
Sint32 4 si32
Uint32 5 ui32
Sint64 6 si64
Uint64 7 ui64
Float16 8 f16
Float32 9 f32
Float64 10 f64
BFloat16 11 bf16

CollectiveKindlink

valid CollectiveKind

Cases:link

Symbol Value String
AllGather 0 all_gather
AllReduce 1 all_reduce
AllToAll 2 all_to_all
Broadcast 3 broadcast
Reduce 4 reduce
ReduceScatter 5 reduce_scatter
Send 6 send
Recv 7 recv
SendRecv 8 send_recv

CollectiveReductionOplink

valid CollectiveReductionOp

Cases:link

Symbol Value String
None 0 none
ReductionSum 1 sum
ReductionProduct 2 product
ReductionMinimum 3 minimum
ReductionMaximum 4 maximum
ReductionAverage 5 average

CommandBufferModeBitfieldlink

valid CommandBufferMode

Cases:link

Symbol Value String
None 0 None
OneShot 1 OneShot
AllowInlineExecution 16 AllowInlineExecution

CommandCategoryBitfieldlink

valid CommandCategory

Cases:link

Symbol Value String
None 0 None
Transfer 1 Transfer
Dispatch 2 Dispatch

DescriptorFlagslink

valid Descriptor flags

Cases:link

Symbol Value String
None 0 None
ReadOnly 1 ReadOnly
Indirect 2 Indirect

DispatchFlagslink

valid dispatch flags

Cases:link

Symbol Value String
None 0 None
Reserved 1 Reserved

ExecutionBarrierFlagBitfieldlink

valid ExecutionBarrierFlag

Cases:link

Symbol Value String
None 0 None
Reserved 1 Reserved

ExecutionStageBitfieldlink

valid ExecutionStage

Cases:link

Symbol Value String
None 0 None
CommandIssue 1 CommandIssue
CommandProcess 2 CommandProcess
Dispatch 4 Dispatch
Transfer 8 Transfer
CommandRetire 16 CommandRetire
Host 32 Host

FenceFlagBitfieldlink

valid FenceFlag

Cases:link

Symbol Value String
None 0 None
Reserved 1 Reserved

MemoryAccessBitfieldlink

valid MemoryAccess

Cases:link

Symbol Value String
None 0 None
Read 1 Read
Write 2 Write
Discard 4 Discard
MayAlias 8 MayAlias
Unaligned 16 Unaligned
Any 32 Any

MemoryModellink

IREE HAL MemoryModel

Cases:link

Symbol Value String
Unified 0 Unified
Discrete 1 Discrete

MemoryTypeBitfieldlink

valid MemoryType

Cases:link

Symbol Value String
None 0 None
Optimal 1 Optimal
HostVisible 2 HostVisible
HostCoherent 4 HostCoherent
HostCached 8 HostCached
HostLocal 70 HostLocal
DeviceVisible 16 DeviceVisible
DeviceLocal 48 DeviceLocal

PipelineLayoutFlagslink

valid PipelineLayout flags

Cases:link

Symbol Value String
None 0 None
Indirect 1 Indirect

DescriptorTypelink

valid DescriptorType

Cases:link

Symbol Value String
UniformBuffer 6 uniform_buffer
StorageBuffer 7 storage_buffer