IRON a504a6293388f5b9de1cd9dfb7aea06a86754c3e
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | Static Private 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)
 
 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, PlacementTile placement=AnyShimTile)
 
None drain (self, ObjectFifoHandle out_fifo, RuntimeData dest, TensorAccessPattern|None tap=None, RuntimeTaskGroup|None task_group=None, bool wait=False, PlacementTile placement=AnyShimTile)
 
 start (self, *Worker args)
 
 inline_ops (self, Callable inline_func, list inline_args)
 
 enable_trace (self, int trace_size=None, int trace_offset=None, list|None workers=None, int ddr_id=None, list|None coretile_events=None, list|None coremem_events=None, list|None memtile_events=None, list|None shimtile_events=None)
 
 set_barrier (self, WorkerRuntimeBarrier barrier, int value)
 
list[Workerworkers (self)
 
list[ObjectFifoHandlefifos (self)
 
 get_first_cons_shimtile (self)
 
None resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None)
 

Public Attributes

 ddr_id
 

Protected Attributes

 _rt_data
 
 _fifos
 
 _workers
 
 _open_task_groups
 
 _trace_size
 
 _trace_offset
 
 _trace_workers
 
 _strict_task_groups
 
 _ddr_id
 
 _coretile_events
 
 _coremem_events
 
 _memtile_events
 
 _shimtile_events
 

Static Private Attributes

int __task_group_index = 0
 

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

◆ 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,
PlacementTile   placement = AnyShimTile 
)
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.
    placement (PlacementTile, optional): The Shim tile to associate the data transfer with. Defaults to AnyShimTile.

Raises:
    ValueError: Arguments are validated.

◆ enable_trace()

iron.runtime.runtime.Runtime.enable_trace (   self,
int   trace_size = None,
int   trace_offset = None,
list | None   workers = None,
int   ddr_id = None,
list | None   coretile_events = None,
list | None   coremem_events = None,
list | None   memtile_events = None,
list | None   shimtile_events = None 
)
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.
    trace_offset (int | None, optional): Byte offset into the DDR buffer where trace
        data should begin. Defaults to None (treated as 0).
    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 | None, optional): XRT inout buffer index to write trace data into.
        Defaults to None (treated as 4, the conventional last buffer slot).
    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 mem tile 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).

◆ 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,
PlacementTile   placement = AnyShimTile 
)
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.
    placement (PlacementTile, optional): The Shim tile to associate the data transfer with. Defaults to AnyShimTile.

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.

◆ get_first_cons_shimtile()

iron.runtime.runtime.Runtime.get_first_cons_shimtile (   self)
Find the first consumer side of an objfifo that is in the 0th row
and uses it as the trace shim tile

◆ 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.

◆ resolve()

None iron.runtime.runtime.Runtime.resolve (   self,
ir.Location | None   loc = None,
ir.InsertionPoint | None   ip = None 
)
Resolve the current object into one or more MLIR operations.
Should only be called within an MLIR context.

Args:
    loc (ir.Location | None, optional): Location is used by MLIR object during construction in some cases. Defaults to None.
    ip (ir.InsertionPoint | None, optional): InsertionPoint is used by MLIR object during construction in some cases. Defaults to None.

Reimplemented from iron.resolvable.Resolvable.

◆ 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.

◆ 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

◆ workers()

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

Member Data Documentation

◆ __task_group_index

int iron.runtime.runtime.Runtime.__task_group_index = 0
staticprivate

◆ _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

◆ _fifos

iron.runtime.runtime.Runtime._fifos
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

◆ _trace_offset

iron.runtime.runtime.Runtime._trace_offset
protected

◆ _trace_size

iron.runtime.runtime.Runtime._trace_size
protected

◆ _trace_workers

iron.runtime.runtime.Runtime._trace_workers
protected

◆ _workers

iron.runtime.runtime.Runtime._workers
protected

◆ ddr_id

iron.runtime.runtime.Runtime.ddr_id

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