'air' Dialect¶
The air dialect describes spatial computation on accelerators with an
explicit memory hierarchy and explicit data movement. It is
architecture-independent: the same IR lowers to AMD NPUs (AI Engine arrays)
and to AMD GPUs. The normative semantics of each operation are defined in
the AIR Compute Model.
Hierarchy¶
Computation on a single device is organized in three nested levels. Each
level defines an iteration space and a body region that is isolated from
above. An optional enclosing rank level spans multiple devices.
launchgroups segments and L3 allocations that must be co-resident on the device. Iterations of alaunchmay execute in parallel.segmentgroups the processing elements, L2 memory, and data-movement resources required by its body. The iterations of asegmentexecute in parallel, each on its own copy of these resources.herdis an array of processing elements executing the same body; each point of its iteration space executes on a distinct processing element. Code in aherdaccesses L1 memory directly and reaches L2 and L3 only through data-movement operations.
Memory Hierarchy¶
L1: local memory of a single processing element.L2: on-device memory shared within asegment.L3: off-chip or host-accessible memory.
The memory spaces are enumerated in air::MemorySpace. On GPUs, memory in
the #air.symmetric_heap space is directly addressable from a herd and
from peer ranks.
Data Movement¶
dma_memcpy_nd is an asynchronous multi-dimensional copy between memory
levels. channel declares a stream between producers and consumers, which
channel.put and channel.get write to and read from. Puts and gets on a
channel must balance on every control-flow path.
Asynchrony¶
Operations may execute asynchronously and return an !air.async.token.
Token operands order an operation after its producers, and wait_all
joins multiple tokens.
Operations¶
air.channel (xilinx::air::ChannelOp)¶
Channel for data movement.
Syntax:
Operation to represent a communication channel as a point-to-point connection between two memrefs.
The array following the channel name symbol represents the channel's dimensional sizes. Default
size, with empty size array, is 1. The data movement mechanism that the channel uses is controlled
by the channel_type attribute.
Channel Types¶
The channel_type attribute is a string that determines the mechanism used for data movement.
Values are namespaced by backend: NPU (AIE) channels use the npu_ prefix; GPU channels use
the gpu_ prefix.
NPU (AIE) channel types:
- "npu_dma_stream" (default): Use DMA engines to send and receive data, with routing performed over a streaming interconnect.
- "npu_dma_packet": Use DMA engines to send and receive data, with routing performed over a packet-switched network.
- "npu_cascade": Use processor cores to send and receive data via cascade connections between adjacent tiles.
- "npu_mmio":
Use host-side MMIO writes (e.g.
aiex.npu.blockwrite) issued from the runtime sequence to deliver a constant payload directly into a tile-local L1 buffer. No DMA channel, no shim allocation, no flow is reserved. Verifier-enforced constraints on the put/get sites:- the
putsource memref must live in L3 (memory_space=0); - the
getdestination memref must live in L1 (memory_space=2). The lowering further requires the put source to be a constantmemref.get_global. The consumer-sidegetlowers to a no-op because the L1 buffer is already populated when the core begins executing.
- the
GPU channel types:
- "gpu_symmetric_heap":
Cross-GPU messaging through the symmetric heap runtime
(
runtime_lib/airgpu/symmetric_heap.{h,cpp}). The channel must be enclosed by anair.rankop; the put/get sites use rank indices to address peer heaps. Lowering will be added by a future GPU pass (planned:air-gpu-channel-to-mgpu) which expands put/get to peer-mappedmgpuMemcpycalls plus a barrier; this PR introduces only the IR surface and verifier rules.
Broadcasting¶
If a channel broadcasts to multiple destinations, the optional broadcast_shape attribute
annotates the output sizes after broadcasting. Broadcasting follows NumPy's broadcasting rules.
Packet ids¶
A packet-switched channel (channel_type = "npu_dma_packet") may pin explicit routing ids
via the optional packet_ids array attribute (each id in [0, 31], unique). One
aie.packet_flow is emitted per id:
- N ids to one destination: all ids route to the same buffer; a later demux hop keys off the header carried by the payload.
- N ids to N destinations: destination
iis routed withpacket_ids[i], an indexed fan-out landing each slice on a distinct, statically-known id.
The compute core writes the routing id into the packet header word of the payload, so the DMA
engine does not stamp/filter these ids; the flows only install switchbox routing entries.
Without packet_ids a packet channel gets a single auto-assigned id.
Example:
// An array of 4 x 4 streaming DMA channels (NPU)
air.channel @channel_0 [4, 4] {channel_type = "npu_dma_stream"}
// A streaming DMA channel broadcasting to 4 destinations (NPU)
air.channel @channel_1 [1, 1] {broadcast_shape = [1, 4], channel_type = "npu_dma_stream"}
// An array of 1 x 4 streaming DMA channels broadcasting to 4 x 4 destinations (NPU).
// Broadcasting follows NumPy's rules.
air.channel @channel_2 [1, 4] {broadcast_shape = [4, 4], channel_type = "npu_dma_stream"}
// A packet-switched DMA channel (NPU)
air.channel @channel_3 [] {channel_type = "npu_dma_packet"}
// A cascade channel using core-to-core cascade connections (NPU)
air.channel @channel_4 [] {channel_type = "npu_cascade"}
// An MMIO channel: the put writes a constant from host into L1 of each
// get's destination tile via runtime-sequence blockwrites (NPU)
air.channel @channel_5 [] {channel_type = "npu_mmio"}
// A cross-GPU channel through the symmetric heap (GPU). Must appear inside
// an air.rank scope; the indices on put/get encode the peer rank.
air.channel @channel_6 [] {channel_type = "gpu_symmetric_heap"}
// A packet-switched channel pinning two routing ids (NPU)
air.channel @channel_7 [] {channel_type = "npu_dma_packet", packet_ids = [1, 4]}
Traits: SymbolName, air_AttrBasedSymbolVisibility
Interfaces: Symbol
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
size | ::mlir::ArrayAttr | 64-bit integer array attribute |
channel_type | ::mlir::StringAttr | string attribute |
air.channel.get (xilinx::air::ChannelGetOp)¶
Get for air channels.
Syntax:
operation ::= `air.channel.get` custom<AsyncDependencies>(type($async_token), $async_dependencies)
$chan_name `[` ($indices^)? `]`
`(` $dst ``
custom<DynamicIndexList>($dynamic_dst_offsets, $static_dst_offsets)
custom<DynamicIndexList>($dynamic_dst_sizes, $static_dst_sizes)
custom<DynamicIndexList>($dynamic_dst_strides, $static_dst_strides) `)`
attr-dict `:` `(` type($dst) `)`
The air.channel.get operation represents a pull (receive) operation that copies data from a
specified channel into a destination memref.
This operation models one-way data movement from a channel endpoint into memory, enabling
asynchronous communication where data previously sent by a corresponding
air.channel.put becomes available to the consumer.
Semantics¶
- The destination buffer is specified by the
dstmemref, along with its associateddst_offsets,dst_sizes, anddst_strideswhich describe the subview being written to. - The channel being read is identified by the symbol referenced by
chan_name. - The channel must have been declared earlier via an
air.channeloperation. - The operation may be asynchronous: if an async token is produced, it can be used to synchronize with subsequent dependent operations.
- The specific channel it operates on, when
chan_namereferences an array of channels, is identified byindices. - Optionally,
pad_beforeandpad_afterspecify constant zero-padding to apply per dimension during the DMA transfer. This maps to hardware DMA buffer descriptor padding on AIE memtile DMAs.
Interfaces¶
- Implements
air_AsyncOpInterface, enabling participation in async dependency chains. - Implements
air_MemcpyInterface, allowing it to behave like a DMA/memcpy operation. - Implements
air_ChannelInterface, allowing inspection of channel properties.
Example¶
// Receive a 4x4 tile into %dst from channel @chan_0
air.channel.get @chan_0(%dst[%c0, %c0][%c4, %c4][%c1, %c1]) : (memref<16x16xf32>)
// Asynchronous get with dependency on %t1
%t2 = air.channel.get async [%t1] @chan_1(%dst[%c8, %c0][%c4, %c4][%c1, %c1]) : (memref<16x16xf32>)
Traits: AttrSizedOperandSegments
Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface), TilingInterface, air_AsyncOpInterface, air_ChannelInterface, air_MemcpyInterface
Effects: MemoryEffects::Effect{MemoryEffects::Read on ::mlir::SideEffects::DefaultResource, MemoryEffects::Write on ::mlir::SideEffects::DefaultResource}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
chan_name | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
static_dst_offsets | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_dst_sizes | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_dst_strides | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
pad_before | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
pad_after | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
indices |
variadic of index |
dst |
ranked or unranked memref of any non-token type values |
dynamic_dst_offsets |
variadic of index |
dynamic_dst_sizes |
variadic of index |
dynamic_dst_strides |
variadic of index |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.channel.issue (xilinx::air::ChannelIssueOp)¶
Start a transfer whose parameters are known only at run time
Syntax:
operation ::= `air.channel.issue` custom<AsyncDependencies>(type($async_token), $async_dependencies)
$chan_name `[` ($indices^)? `]`
(`offset` `(` $offset^ `:` type($offset) `)`)?
(`length` `(` $length^ `)`)?
attr-dict
The run-time half of a channel transfer whose offset or length is a value
the compiler cannot place on its buffer descriptor: one a core computes,
or a run-time scalar of the launch. The static half is the channel op
tagged air.device_issue = issue_id; it moves the data. This op patches
that transfer's buffer descriptor and starts it, through control packets.
Where the op sits says who issues it: inside an air.herd, that herd's
core; anywhere else, the host.
offset: elements to add to the static offset of the paired op.length: the run-time extent of the paired op's outermost dimension.
// The core starts the paired put on @wexp, `%elems` elements further in.
air.channel.issue @wexp[] offset(%elems : i64) {issue_id = 1 : i64}
Traits: AttrSizedOperandSegments
Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface), air_AsyncOpInterface
Effects: MemoryEffects::Effect{MemoryEffects::Write on ::mlir::SideEffects::DefaultResource}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
chan_name | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
issue_id | ::mlir::IntegerAttr | 64-bit signless integer attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
indices |
variadic of index |
offset |
signless integer or index |
length |
index |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.channel.put (xilinx::air::ChannelPutOp)¶
Push for air channels.
Syntax:
operation ::= `air.channel.put` custom<AsyncDependencies>(type($async_token), $async_dependencies)
$chan_name `[` ($indices^)? `]`
`(` $src ``
custom<DynamicIndexList>($dynamic_src_offsets, $static_src_offsets)
custom<DynamicIndexList>($dynamic_src_sizes, $static_src_sizes)
custom<DynamicIndexList>($dynamic_src_strides, $static_src_strides) `)`
(`dest` `(` $dest^ `)`)?
attr-dict `:` `(` type($src) `)`
The air.channel.put operation represents a push (send) operation that copies data from a
source memref into a specified channel.
This operation models one-way data movement into a channel endpoint, enabling asynchronous
communication between producer and consumer operations. It is typically paired with
air.channel.get operations on the receiving side.
Semantics¶
- The source data is specified by the
srcmemref, along with its associatedsrc_offsets,src_sizes, andsrc_strideswhich describe the subview being transferred. - The channel being targeted is identified by the symbol referenced by
chan_name. - The channel must have been declared earlier via an
air.channeloperation. - The operation may be asynchronous: if an async token is produced, it can be used to synchronize with subsequent dependent operations.
- The specific channel it operates on, when
chan_namereferences an array of channels, is identified byindices. - Optionally,
pad_beforeandpad_afterspecify constant zero-padding to apply per dimension during the DMA transfer. This maps to hardware DMA buffer descriptor padding on AIE memtile DMAs.
Interfaces¶
- Implements
air_AsyncOpInterface, allowing it to participate in async dependency chains. - Implements
air_MemcpyInterface, enabling it to behave like a DMA/memcpy operation. - Implements
air_ChannelInterface, allowing inspection of channel properties.
Example¶
// Send a 4x4 tile from %src into channel @chan_0
air.channel.put @chan_0(%src[%c0, %c0][%c4, %c4][%c1, %c1]) : (memref<16x16xf32>)
// Asynchronous put with dependency on %t0
%t1 = air.channel.put async [%t0] @chan_1(%src[%c8, %c0][%c4, %c4][%c1, %c1]) : (memref<16x16xf32>)
// Put with padding: read 13 elements, pad 2 before and 1 after
air.channel.put @chan_2(%src[%c0] [13] [%c1])
{pad_before = array<i32: 2>, pad_after = array<i32: 1>} : (memref<16xi32>)
Traits: AttrSizedOperandSegments
Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface), TilingInterface, air_AsyncOpInterface, air_ChannelInterface, air_MemcpyInterface
Effects: MemoryEffects::Effect{MemoryEffects::Read on ::mlir::SideEffects::DefaultResource, MemoryEffects::Write on ::mlir::SideEffects::DefaultResource}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
chan_name | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
static_src_offsets | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_src_sizes | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_src_strides | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
pad_before | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
pad_after | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
indices |
variadic of index |
src |
ranked or unranked memref of any non-token type values |
dynamic_src_offsets |
variadic of index |
dynamic_src_sizes |
variadic of index |
dynamic_src_strides |
variadic of index |
dest |
index |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.custom (xilinx::air::CustomOp)¶
A handle to a user-customized op
A placeholder operation for a user-customized op. With user-specified latency value, AIR Runner is able to simulate the system-level performance with this op in place.
Traits: AttrSizedOperandSegments
Interfaces: air_AsyncOpInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
symbol | ::mlir::SymbolRefAttr | symbol reference attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
custom_operands |
variadic of any non-token type |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.dma_memcpy_nd (xilinx::air::DmaMemcpyNdOp)¶
Dma operator
Syntax:
operation ::= `air.dma_memcpy_nd` custom<AsyncDependencies>(type($async_token), $async_dependencies)
`(` $dst ``
custom<DynamicIndexList>($dynamic_dst_offsets, $static_dst_offsets)
custom<DynamicIndexList>($dynamic_dst_sizes, $static_dst_sizes)
custom<DynamicIndexList>($dynamic_dst_strides, $static_dst_strides) `,`
$src ``
custom<DynamicIndexList>($dynamic_src_offsets, $static_src_offsets)
custom<DynamicIndexList>($dynamic_src_sizes, $static_src_sizes)
custom<DynamicIndexList>($dynamic_src_strides, $static_src_strides) `)`
attr-dict `:` `(` type($dst) `,` type($src) `)`
N-dimensional strided bulk copy between two memrefs.
Optional src_rank / dst_rank integer attributes name a peer rank in the
enclosing air.rank scope. When present, the corresponding memref is
interpreted as living on rank R's symmetric heap rather than on the local
process. These attributes are only valid for air.symmetric-tagged memref
allocations and require an enclosing air.rank. Lowering for these
attributes will be added by a future GPU pass (planned: air-cross-rank-
dma-to-mgpu); this PR introduces only the IR surface and verifier rules.
Traits: AttrSizedOperandSegments
Interfaces: air_AsyncOpInterface, air_MemcpyInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
static_dst_offsets | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_dst_sizes | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_dst_strides | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_src_offsets | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_src_sizes | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
static_src_strides | ::mlir::DenseI64ArrayAttr | i64 dense array attribute |
pad_before | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
pad_after | ::mlir::DenseI32ArrayAttr | i32 dense array attribute |
src_rank | ::mlir::IntegerAttr | 64-bit signless integer attribute |
dst_rank | ::mlir::IntegerAttr | 64-bit signless integer attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
dst |
ranked or unranked memref of any non-token type values |
dynamic_dst_offsets |
variadic of index |
dynamic_dst_sizes |
variadic of index |
dynamic_dst_strides |
variadic of index |
src |
ranked or unranked memref of any non-token type values |
dynamic_src_offsets |
variadic of index |
dynamic_src_sizes |
variadic of index |
dynamic_src_strides |
variadic of index |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.execute (xilinx::air::ExecuteOp)¶
Asynchronous code region
Syntax:
operation ::= `air.execute` (` ``[` $async_dependencies^ `]`)?
(`->` `(` type($results)^ `)`)? regions attr-dict
Defines a code region to be dispatched asynchronously at runtime. All operations in the region must be executed sequentially.
Traits: SingleBlockImplicitTerminator<ExecuteTerminatorOp>, SingleBlock
Interfaces: MemoryEffectOpInterface, air_AsyncOpInterface
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
results |
variadic of any non-token type |
air.execute_terminator (xilinx::air::ExecuteTerminatorOp)¶
Terminator for air execute.
Syntax:
A terminator operation for code regions that appear in the body of
air.execute operation. The operation takes variable number of
operands and produces no results. The operand number and types must
match the signature of the air.execute that contains the operation.
Traits: AlwaysSpeculatableImplTrait, HasParent<ExecuteOp>, ReturnLike, Terminator
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), RegionBranchTerminatorOpInterface
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
results |
variadic of any non-token type |
air.herd (xilinx::air::HerdOp)¶
Herd
Define and run a 1D or 2D array of tiles as an AIR Herd.
Traits: AffineScope, AttrSizedOperandSegments, IsolatedFromAbove, SingleBlockImplicitTerminator<HerdTerminatorOp>, SingleBlock
Interfaces: RegionBranchOpInterface, air_AsyncOpInterface, air_HierarchyInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
link_with | ::mlir::StringAttr | string attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
sizes |
variadic of index |
herd_operands |
variadic of any non-token type |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.herd_terminator (xilinx::air::HerdTerminatorOp)¶
Terminator for air herd regions.
Syntax:
A terminator operation for the body of air.herd operations.
air.herd operations are not expected to return any value so the
terminator takes no operands.
Traits: AlwaysSpeculatableImplTrait, HasParent<HerdOp>, Terminator
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
air.launch (xilinx::air::LaunchOp)¶
Launch
Launch
Traits: AffineScope, AttrSizedOperandSegments, IsolatedFromAbove, SingleBlockImplicitTerminator<LaunchTerminatorOp>, SingleBlock
Interfaces: RegionBranchOpInterface, air_AsyncOpInterface, air_HierarchyInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
sizes |
variadic of index |
launch_operands |
variadic of any non-token type |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.launch_terminator (xilinx::air::LaunchTerminatorOp)¶
Terminator for air.launch.
Syntax:
A terminator operation for the body of air.launch operations.
air.launch operations are not expected to return any value so the
terminator takes no operands.
Traits: AlwaysSpeculatableImplTrait, HasParent<LaunchOp>, Terminator
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
air.rank (xilinx::air::RankOp)¶
Multi-device rank
Represents a communicating world of rank instances, where each instance
corresponds to a complete GPU device or a CPU host process. air.rank
is the outermost hierarchy level, sitting above air.launch.
The operation defines an N-dimensional iteration space. Each point is a
rank instance. The body is IsolatedFromAbove; values are passed via
explicit kernel operands.
An optional universe operand of type !air.universe constrains the
physical pool from which rank instances are scheduled.
Traits: AffineScope, AttrSizedOperandSegments, IsolatedFromAbove, SingleBlockImplicitTerminator<RankTerminatorOp>, SingleBlock
Interfaces: RegionBranchOpInterface, air_AsyncOpInterface, air_HierarchyInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
universe |
universe type |
sizes |
variadic of index |
rank_operands |
variadic of any non-token type |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.rank_terminator (xilinx::air::RankTerminatorOp)¶
Terminator for air.rank.
Syntax:
A terminator operation for the body of air.rank operations.
air.rank operations are not expected to return any value so the
terminator takes no operands.
Traits: AlwaysSpeculatableImplTrait, HasParent<RankOp>, Terminator
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
air.segment (xilinx::air::SegmentOp)¶
Segment
Segment
Traits: AffineScope, AttrSizedOperandSegments, IsolatedFromAbove, SingleBlockImplicitTerminator<SegmentTerminatorOp>, SingleBlock
Interfaces: RegionBranchOpInterface, air_AsyncOpInterface, air_HierarchyInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
sizes |
variadic of index |
segment_operands |
variadic of any non-token type |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
air.segment_terminator (xilinx::air::SegmentTerminatorOp)¶
Terminator for air segment regions.
Syntax:
A terminator operation for the body of air.segment operations.
air.segment operations are not expected to return any value so the
terminator takes no operands.
Traits: AlwaysSpeculatableImplTrait, HasParent<SegmentOp>, Terminator
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
air.translate (xilinx::air::TranslateOp)¶
Re-express a symmetric-heap memref in another rank's address space
Syntax:
operation ::= `air.translate` $source `,` $from_rank `,` $to_rank `,` $heap_bases
attr-dict `:` type($source) `,` type($heap_bases)
Produces a memref of the same type as $source whose underlying
pointer references the corresponding allocation on $to_rank. The
$source memref is assumed to live on $from_rank's symmetric heap.
The translation is the pointer rebase
peer_va = bases[to_rank] + (source_ptr - bases[from_rank])
where $heap_bases is a 1-D memref of index-typed pointer values
(per-rank symmetric-heap base addresses) obtained from the
mgpuGetHeapBases() runtime hook. The host typically wraps the raw
runtime pointer as a memref<?xindex> once and threads it through
gpu.launch_func as a kernel argument. No data is moved; this op
produces a value-level "view" of peer memory.
Folds to $source when $from_rank and $to_rank are statically
equal.
Both ranks must address the same collective allocation on the
symmetric heap (i.e. $source must trace back to a
memref.alloc {air.symmetric}). Using this op outside that contract
is undefined.
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
source |
memref of any non-token type values |
from_rank |
index |
to_rank |
index |
heap_bases |
1D memref of index values |
Results:
| Result | Description |
|---|---|
result |
memref of any non-token type values |
air.universe.alloc (xilinx::air::UniverseAllocOp)¶
Allocate a universe of devices
Syntax:
Creates an !air.universe value representing a bounded pool of
capacity devices or hosts. The universe value is consumed by
air.rank to constrain the physical pool from which rank instances
are scheduled.
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
capacity |
index |
Results:
| Result | Description |
|---|---|
universe |
universe type |
air.wait_all (xilinx::air::WaitAllOp)¶
Wait for all operator
Syntax:
operation ::= `air.wait_all` custom<AsyncDependencies>(type($async_token), $async_dependencies) attr-dict
Wait for all async tokens before preceding.
Interfaces: air_AsyncOpInterface
Operands:
| Operand | Description |
|---|---|
async_dependencies |
variadic of async token type |
Results:
| Result | Description |
|---|---|
async_token |
async token type |
Attributes¶
SymmetricHeapMemorySpaceAttr¶
Symmetric-heap memory space (cross-rank XGMI-accessible HBM)
Syntax: #air.symmetric_heap
Types¶
AsyncTokenType¶
Token that orders asynchronous AIR operations
Syntax: !air.async.token
UniverseType¶
Bounded pool of devices or hosts that air.rank runs on
Syntax: !air.universe
Enums¶
MemorySpace¶
AIR Memory Space IDs
Cases:
| Symbol | Value | String |
|---|---|---|
| L1 | 2 |
L1 |
| L2 | 1 |
L2 |
| L3 | 0 |
L3 |