IRON 1a5eed49d3c0721a318ac369f725acc96b7c4584
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
iron.runtime.runtime.Runtime Class Reference
Inheritance diagram for iron.runtime.runtime.Runtime:
Inheritance graph
[legend]
Collaboration diagram for iron.runtime.runtime.Runtime:
Collaboration graph
[legend]

Public Member Functions

None __init__ (self, bool strict_task_groups=True)
 
None add_flow (self, flow)
 
None add_lock (self, lock)
 
None add_tile_dma (self, tile_dma)
 
 flows (self)
 
 locks (self)
 
 tile_dmas (self)
 
 sequence (self, *type[np.ndarray] input_types)
 
RuntimeTaskGroup task_group (self)
 
 finish_task_group (self, RuntimeTaskGroup task_group)
 
None fill (self, ObjectFifoHandle in_fifo, RuntimeData source, TensorAccessPattern|None tap=None, RuntimeTaskGroup|None task_group=None, bool wait=False, Tile tile=AnyShimTile, tuple[int, int]|None packet=None, "ScratchpadParameter | str | None" offset_parameter=None)
 
None drain (self, ObjectFifoHandle out_fifo, RuntimeData dest, TensorAccessPattern|None tap=None, RuntimeTaskGroup|None task_group=None, bool wait=False, Tile tile=AnyShimTile, tuple[int, int]|None packet=None, "ScratchpadParameter | str | None" offset_parameter=None)
 
 start (self, *Worker args)
 
 inline_ops (self, Callable inline_func, list inline_args)
 
 enable_trace (self, int|None trace_size=None, list|None workers=None, int ddr_id=4, list|None coretile_events=None, list|None coremem_events=None, list|None memtile_events=None, list|None shimtile_events=None, int egress_shim_col=0)
 
 set_barrier (self, WorkerRuntimeBarrier barrier, int value)
 
 sync_parameters (self)
 
list[Worker] workers (self)
 
list[ObjectFifoHandle] fifos (self)
 
None resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None)
 

Protected Attributes

 _rt_data
 
 _flows
 
 _locks
 
 _tile_dmas
 
 _open_task_groups
 
 _trace_size
 
 _trace_workers
 
 _strict_task_groups
 
 _task_group_index
 
 _ddr_id
 
 _egress_shim_col
 
 _coretile_events
 
 _coremem_events
 
 _memtile_events
 
 _shimtile_events
 
 _fifos
 

Detailed Description

A Runtime contains that operations and structure of all operations that
need to be taken care of by the host/runtime in order to run a program.

Constructor & Destructor Documentation

◆ __init__()

None iron.runtime.runtime.Runtime.__init__ (   self,
bool   strict_task_groups = True 
)
Initialize a runtime object.

Args:
    strict_task_groups (bool): Disallows mixing the default group and explicit task groups during resolution.
        This can catch common errors, but can be set to False to disable the checks.

Member Function Documentation

◆ add_flow()

None iron.runtime.runtime.Runtime.add_flow (   self,
  flow 
)
Register an explicit :class:`Flow` (or :class:`PacketFlow`) so the
Program resolves it alongside the ObjectFifos.

◆ add_lock()

None iron.runtime.runtime.Runtime.add_lock (   self,
  lock 
)
Register an explicit :class:`Lock` shared between a Worker and a
:class:`TileDma`.

◆ add_tile_dma()

None iron.runtime.runtime.Runtime.add_tile_dma (   self,
  tile_dma 
)
Register an explicit :class:`TileDma` program.

◆ drain()

None iron.runtime.runtime.Runtime.drain (   self,
ObjectFifoHandle  out_fifo,
RuntimeData  dest,
TensorAccessPattern | None   tap = None,
RuntimeTaskGroup | None   task_group = None,
bool   wait = False,
Tile   tile = AnyShimTile,
tuple[int, int] | None   packet = None,
"ScratchpadParameter | str | None"   offset_parameter = None 
)
Conceptually fill an ObjectFifoHandle (of type consumer) of data and write that data to a runtime buffer.
This should be called within a Runtime.sequence() context.

Args:
    out_fifo (ObjectFifoHandle): The consumer ObjectFifoHandle.
    dest (RuntimeData): The output Runtime data buffer.
    tap (TensorAccessPattern | None, optional): A way of specifying how data in the buffer is accessed when reading from the out_fifo.
        If None is given, this will default to a linear transfer containing all data in the destination buffer. Defaults to None.
    task_group (RuntimeTaskGroup | None, optional): A TaskGroup to associate this task with. Defaults to None.
    wait (bool, optional): Whether this Task should be awaited on or not. If not, it will be freed when the task group is finished. Defaults to False.
    tile (Tile | None, optional): The Shim tile to associate the data transfer with. Defaults to AnyShimTile.
    packet (tuple[int, int] | None, optional): Stamp the shim DMA's BD
        with a packet header ``(pkt_type, pkt_id)``.  Pairs with
        downstream packet-switched routing (e.g. ObjectFifos lowered
        with ``--packet-sw-objFifos`` or an explicit
        :class:`~aie.iron.PacketFlow`).  Defaults to None.
    offset_parameter (ScratchpadParameter | str | None, optional): A ScratchpadParameter (or its name) whose value is used as the element offset for this DMA transfer. Defaults to None.

Raises:
    ValueError: Arguments are validated.

◆ enable_trace()

iron.runtime.runtime.Runtime.enable_trace (   self,
int | None   trace_size = None,
list | None   workers = None,
int   ddr_id = 4,
list | None   coretile_events = None,
list | None   coremem_events = None,
list | None   memtile_events = None,
list | None   shimtile_events = None,
int   egress_shim_col = 0 
)
Enable hardware tracing for this program.

Configures the AIE trace units and routes trace packets to DDR via the shim DMA.
Should be called within a :meth:`sequence` context before data movement operations.

Args:
    trace_size (int): Size of the trace buffer in bytes.
    workers (list[Worker] | None, optional): Specific workers to trace. If None,
        all workers with ``trace`` set will be traced. Defaults to None.
    ddr_id (int, optional): XRT inout buffer index (0-4) to write trace data
        into, mapping to group_id (3-7). Defaults to 4 (group_id 7).
        Set to -1 to append trace data after the last runtime_sequence
        tensor argument.
    coretile_events (list | None, optional): List of up to 8 core tile trace events.
        See ``https://xilinx.github.io/mlir-aie/AIEXDialect.html`` for available
        events under (type)EventAIE such as CoreEventAIE.
        Defaults to None (uses hardware defaults).
    coremem_events (list | None, optional): List of up to 8 core memory trace events.
        Defaults to None (uses hardware defaults).
    memtile_events (list | None, optional): List of up to 8 mem tile trace events.
        Defaults to None (uses hardware defaults).
    shimtile_events (list | None, optional): List of up to 8 shim tile trace events.
        Defaults to None (uses hardware defaults).
    egress_shim_col (int, optional): Column of the shim tile used to
        egress trace packets to DDR. Defaults to 0.

◆ fifos()

list[ObjectFifoHandle] iron.runtime.runtime.Runtime.fifos (   self)
The ObjectFifoHandles associated with the Runtime by calls to fill() and drain()

◆ fill()

None iron.runtime.runtime.Runtime.fill (   self,
ObjectFifoHandle  in_fifo,
RuntimeData  source,
TensorAccessPattern | None   tap = None,
RuntimeTaskGroup | None   task_group = None,
bool   wait = False,
Tile   tile = AnyShimTile,
tuple[int, int] | None   packet = None,
"ScratchpadParameter | str | None"   offset_parameter = None 
)
Conceptually fill an ObjectFifoHandle (of type producer) with data from a runtime buffer.
This should be called within a Runtime.sequence() context.

Args:
    in_fifo (ObjectFifoHandle): The producer ObjectFifoHandle.
    source (RuntimeData): The input Runtime data buffer.
    tap (TensorAccessPattern | None, optional): A way of specifying how data in the buffer is accessed when sending it to the in_fifo.
        If None is given, this will default to a linear transfer containing all data in the source buffer. Defaults to None.
    task_group (RuntimeTaskGroup | None, optional): A TaskGroup to associate this task with. Defaults to None.
    wait (bool, optional): Whether this Task should be awaited on or not. If not, it will be freed when the task group is finished. Defaults to False.
    tile (Tile | None, optional): The Shim tile to associate the data transfer with. Defaults to AnyShimTile.
    packet (tuple[int, int] | None, optional): Stamp the shim DMA's BD
        with a packet header ``(pkt_type, pkt_id)``.  Pairs with
        downstream packet-switched routing (e.g. ObjectFifos lowered
        with ``--packet-sw-objFifos`` or an explicit
        :class:`~aie.iron.PacketFlow`).  Defaults to None.
    offset_parameter (ScratchpadParameter | str | None, optional): A ScratchpadParameter (or its name) whose value is used as the element offset for this DMA transfer. Defaults to None.

Raises:
    ValueError: Arguments are validated.

◆ finish_task_group()

iron.runtime.runtime.Runtime.finish_task_group (   self,
RuntimeTaskGroup  task_group 
)
Close out a RuntimeTaskGroup.
This should be called within a Runtime.sequence() context.

Args:
    task_group (RuntimeTaskGroup): The task group to close. All associated tasks will be awaited or freed.

◆ flows()

iron.runtime.runtime.Runtime.flows (   self)

◆ inline_ops()

iron.runtime.runtime.Runtime.inline_ops (   self,
Callable  inline_func,
list  inline_args 
)
Insert an InlineOpRuntimeTask into the runtime.
 This should be called within a Runtime.sequence() context.

Args:
    inline_func (Callable): The function to execute within an MLIR context.
    inline_args (list): The state the function needs to execute.

◆ locks()

iron.runtime.runtime.Runtime.locks (   self)

◆ resolve()

None iron.runtime.runtime.Runtime.resolve (   self,
ir.Location | None   loc = None,
ir.InsertionPoint | None   ip = None 
)

◆ sequence()

iron.runtime.runtime.Runtime.sequence (   self,
*type[np.ndarray]  input_types 
)
A RuntimeSequence is a sequence of operations that are performed in
support of a program. Common operations include input and output data movement.

Raises:
    ValueError: Arguments are validated.
    ValueError: If task groups are not finished within the sequence() context, and error will be raised.

Yields:
    RuntimeData | tuple[RuntimeData, ...]: Handles to the runtime buffers matching the declared input types.

◆ set_barrier()

iron.runtime.runtime.Runtime.set_barrier (   self,
WorkerRuntimeBarrier  barrier,
int  value 
)
Set the value of a worker barrier.
This should be called within a Runtime.sequence() context.

Args:
    barrier (WorkerRuntimeBarrier): The WorkerRuntimeBarrier to set.
    value (int): The value to set the barrier to.

◆ start()

iron.runtime.runtime.Runtime.start (   self,
*Worker  args 
)
A placeholder operation to indicate that one or more Worker should be started on the device.
This should be called within a Runtime.sequence() context.

Args:
    *args: One or more Workers. If more than one is given, they will be started in order.

Raises:
    ValueError: Arguments are validated.

◆ sync_parameters()

iron.runtime.runtime.Runtime.sync_parameters (   self)
Emit ``aiex.sync_scratchpad_parameters_from_host`` in the runtime sequence.

Call this within a :meth:`sequence` context after all parameters have
been written on the host side and before starting workers that read
them.

◆ task_group()

RuntimeTaskGroup iron.runtime.runtime.Runtime.task_group (   self)
Generate a handle to a RuntimeTaskGroup.
This should be called within a Runtime.sequence() context.

Returns:
    RuntimeTaskGroup: The new RuntimeTaskGroup

◆ tile_dmas()

iron.runtime.runtime.Runtime.tile_dmas (   self)

◆ workers()

list[Worker] iron.runtime.runtime.Runtime.workers (   self)
The workers associated with the Runtime by calls to start()

Member Data Documentation

◆ _coremem_events

iron.runtime.runtime.Runtime._coremem_events
protected

◆ _coretile_events

iron.runtime.runtime.Runtime._coretile_events
protected

◆ _ddr_id

iron.runtime.runtime.Runtime._ddr_id
protected

◆ _egress_shim_col

iron.runtime.runtime.Runtime._egress_shim_col
protected

◆ _fifos

iron.runtime.runtime.Runtime._fifos
protected

◆ _flows

iron.runtime.runtime.Runtime._flows
protected

◆ _locks

iron.runtime.runtime.Runtime._locks
protected

◆ _memtile_events

iron.runtime.runtime.Runtime._memtile_events
protected

◆ _open_task_groups

iron.runtime.runtime.Runtime._open_task_groups
protected

◆ _rt_data

iron.runtime.runtime.Runtime._rt_data
protected

◆ _shimtile_events

iron.runtime.runtime.Runtime._shimtile_events
protected

◆ _strict_task_groups

iron.runtime.runtime.Runtime._strict_task_groups
protected

◆ _task_group_index

iron.runtime.runtime.Runtime._task_group_index
protected

◆ _tile_dmas

iron.runtime.runtime.Runtime._tile_dmas
protected

◆ _trace_size

iron.runtime.runtime.Runtime._trace_size
protected

◆ _trace_workers

iron.runtime.runtime.Runtime._trace_workers
protected

The documentation for this class was generated from the following file: