IRON
1.0
|
Public Member Functions | |
def | __init__ (self, type[np.ndarray] obj_type, int|None default_depth=2, str|None name=None, list[Sequence[int]]|None dims_to_stream=None, list[Sequence[int]]|None default_dims_from_stream_per_cons=None, bool plio=False) |
int | default_depth (self) |
list[Sequence[int]] | default_dims_from_stream_per_cons (self) |
list[Sequence[int]] | dims_to_stream (self) |
ObjectFifoCreateOp | op (self) |
Sequence[int] | shape (self) |
np.dtype | dtype (self) |
type[np.ndarray] | obj_type (self) |
str | __str__ (self) |
ObjectFifoHandle | prod (self, int|None depth=None) |
ObjectFifoHandle | cons (self, int|None depth=None, list[Sequence[int]]|None dims_from_stream=None) |
list[PlacementTile] | tiles (self) |
None | resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None) |
Public Attributes | |
name | |
Private Member Functions | |
int | __get_index (cls) |
Tile | _prod_tile_op (self) |
list[Tile] | _cons_tiles_ops (self) |
int|list[int] | _get_depths (self) |
list[ObjectFifoEndpoint] | _get_endpoint (self, bool is_prod) |
def | _acquire (self, ObjectFifoPort port, int num_elem) |
def | _release (self, ObjectFifoPort port, int num_elem) |
Private Attributes | |
_default_depth | |
_obj_type | |
_dims_to_stream | |
_default_dims_from_stream_per_cons | |
_plio | |
_resolving | |
_prod | |
_cons | |
_op | |
Static Private Attributes | |
int | __of_index = 0 |
An ObjectFifo is a method of representing synchronized, explicit dataflow between IRON program components such as Workers and the Runtime. Internally, it is a circular buffer with a given depth and type of buffer. The users of an ObjectFifo are explicitly either a Producer or a Consumer, and each user has a Placeable endpoint.
This is used to generate unique ObjectFifo names.
def iron.dataflow.objectfifo.ObjectFifo.__init__ | ( | self, | |
type[np.ndarray] | obj_type, | ||
int | None | default_depth = 2 , |
||
str | None | name = None , |
||
list[Sequence[int]] | None | dims_to_stream = None , |
||
list[Sequence[int]] | None | default_dims_from_stream_per_cons = None , |
||
bool | plio = False |
||
) |
Construct an ObjectFifo. Args: obj_type (type[np.ndarray]): The type of each buffer in the ObjectFifo default_depth (int | None, optional): The default depth of the ObjectFifo endpoints. Defaults to 2. name (str | None, optional): The name of the ObjectFifo. If None is given, a unique name will be generated.. Defaults to None. dims_to_stream (list[Sequence[int]] | None, optional): _description_. Defaults to None. default_dims_from_stream_per_cons (list[Sequence[int]] | None, optional): _description_. Defaults to None. plio (bool, optional): _description_. Defaults to False. Raises: ValueError: _description_
|
private |
str iron.dataflow.objectfifo.ObjectFifo.__str__ | ( | self | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
ObjectFifoHandle iron.dataflow.objectfifo.ObjectFifo.cons | ( | self, | |
int | None | depth = None , |
||
list[Sequence[int]] | None | dims_from_stream = None |
||
) |
Returns an ObjectFifoHandle of type consumer. Each ObjectFifo may have multiple consumers, so this will return a new consumer handle every time is it callled. Args: depth (int | None, optional): The depth of the buffers at the endpoint corresponding to this consumer handle. Defaults to None. dims_from_stream (list[Sequence[int]] | None, optional): Dimensions from stream for this consumer. Defaults to None. Raises: ValueError: Arguments are validated Returns: ObjectFifoHandle: A consumer handle to this ObjectFifo.
int iron.dataflow.objectfifo.ObjectFifo.default_depth | ( | self | ) |
The default depth of the ObjectFifo. This may be overriden by an ObjectFifoHandle upon construction.
list[Sequence[int]] iron.dataflow.objectfifo.ObjectFifo.default_dims_from_stream_per_cons | ( | self | ) |
The default dimensions from stream per consumer value. This may be overriden by an ObjectFifoHandle of type consumer.
list[Sequence[int]] iron.dataflow.objectfifo.ObjectFifo.dims_to_stream | ( | self | ) |
The dimensions to stream value. This will be shared by the ObjectFifoHandle of type producer.
np.dtype iron.dataflow.objectfifo.ObjectFifo.dtype | ( | self | ) |
The per-element data type of each element in each buffer belonging to the ObjectFifo
type[np.ndarray] iron.dataflow.objectfifo.ObjectFifo.obj_type | ( | self | ) |
The tensor type of each buffer belonging to the ObjectFifo
ObjectFifoCreateOp iron.dataflow.objectfifo.ObjectFifo.op | ( | self | ) |
ObjectFifoHandle iron.dataflow.objectfifo.ObjectFifo.prod | ( | self, | |
int | None | depth = None |
||
) |
Returns an ObjectFifoHandle of type producer. Each ObjectFifo may have only one producer handle, so if one already exists, a new reference to this handle will be returned. Args: depth (int | None, optional): The depth of the buffers at the endpoint corresponding to the producer handle. Defaults to None. Raises: ValueError: Arguments are validated ValueError: If default_depth was not specified on ObjectFifo construction, depth must be specified here. Returns: ObjectFifoHandle: The producer handle to this ObjectFifo.
None iron.dataflow.objectfifo.ObjectFifo.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.
Sequence[int] iron.dataflow.objectfifo.ObjectFifo.shape | ( | self | ) |
The shape of each buffer belonging to the ObjectFifo
list[PlacementTile] iron.dataflow.objectfifo.ObjectFifo.tiles | ( | self | ) |
The list of placement tiles corresponding to the endpoints of all handles of this ObjectFifo Raises: ValueError: A producer handle must be constructed. ValueError: At least one consumer handle must be constructed. Returns: list[PlacementTile]: A list of tiles of the endpoints of this ObjectFifo.
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
iron.dataflow.objectfifo.ObjectFifo.name |