|
IRON 1.0
|


Public Member Functions | |
| Runtime | __init__ (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, 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, [] workers=None, int ddr_id=None, [] coretile_events=None, [] memtile_events=None, [] shimtile_events=None) | |
| set_barrier (self, WorkerRuntimeBarrier barrier, int value) | |
| list[Worker] | workers (self) |
| list[ObjectFifoHandle] | fifos (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 | |
| _ddr_id | |
| _coretile_events | |
| _memtile_events | |
| _shimtile_events | |
Static Private Attributes | |
| int | __task_group_index = 0 |
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.
This is used to generate unique task group ids
| Runtime iron.runtime.runtime.Runtime.__init__ | ( | self | ) |
Initialize a runtime object.
| 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 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. 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.
| iron.runtime.runtime.Runtime.enable_trace | ( | self, | |
| int | trace_size = None, |
||
| int | trace_offset = None, |
||
| [] | workers = None, |
||
| int | ddr_id = None, |
||
| [] | coretile_events = None, |
||
| [] | memtile_events = None, |
||
| [] | shimtile_events = None |
||
| ) |
Enable trace.
| list[ObjectFifoHandle] iron.runtime.runtime.Runtime.fifos | ( | self | ) |
The ObjectFifoHandles associated with the Runtime by calls to fill() and drain()
| 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.
| 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): _description_
| 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
| 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.
| None iron.runtime.runtime.Runtime.resolve | ( | cls, | |
| 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.
| 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:
_type_: Handles to the buffers matching the input types.
| 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.
| 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.
| 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
| list[Worker] iron.runtime.runtime.Runtime.workers | ( | self | ) |
The workers associated with the Runtime by calls to start()
|
staticprivate |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| iron.runtime.runtime.Runtime.ddr_id |