IRON 898978f104b41f64d534f83342d7a28abe5a86ee
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
iron.dataflow.objectfifo.ObjectFifo Class Reference
Inheritance diagram for iron.dataflow.objectfifo.ObjectFifo:
Inheritance graph
[legend]
Collaboration diagram for iron.dataflow.objectfifo.ObjectFifo:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, type[np.ndarray] obj_type, int|None depth=2, str|None name=None, list[Sequence[int]]|None dims_to_stream=None, list[Sequence[int]]|None dims_from_stream_per_cons=None, bool plio=False, list[Sequence[int]]|None pad_dimensions=None, bool disable_synchronization=False, int|None repeat_count=None, PlacementTile|None delegate_tile=None, bool via_DMA=False, list[np.ndarray]|None init_values=None, type[np.ndarray]|None consumer_obj_type=None)
 
int depth (self)
 
list[Sequence[int]] 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)
 
 set_iter_count (self, int iter_count)
 
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[Tiletiles (self, bool cons_only=False)
 
bool can_used_shared_mem (self, Device device, bool cons_only=False)
 
None resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None)
 

Public Attributes

 name
 

Protected Member Functions

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)
 
 _acquire (self, ObjectFifoPort port, int num_elem)
 
 _release (self, ObjectFifoPort port, int num_elem)
 

Protected Attributes

 _depth
 
 _obj_type
 
 _dims_to_stream
 
 _dims_from_stream_per_cons
 
 _plio
 
 _pad_dimensions
 
 _resolving
 
 _iter_count
 
 _prod
 
 _cons
 
 _consumer_obj_type
 
 _op
 
 _repeat_count
 

Private Member Functions

int __get_index (cls)
 

Static Private Attributes

int __of_index = 0
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

iron.dataflow.objectfifo.ObjectFifo.__init__ (   self,
type[np.ndarray]  obj_type,
int | None   depth = 2,
str | None   name = None,
list[Sequence[int]] | None   dims_to_stream = None,
list[Sequence[int]] | None   dims_from_stream_per_cons = None,
bool   plio = False,
list[Sequence[int]] | None   pad_dimensions = None,
bool   disable_synchronization = False,
int | None   repeat_count = None,
PlacementTile | None   delegate_tile = None,
bool   via_DMA = False,
list[np.ndarray] | None   init_values = None,
type[np.ndarray] | None   consumer_obj_type = None 
)
Construct an ObjectFifo.

Args:
    obj_type (type[np.ndarray]): The type of each buffer in the ObjectFifo
    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): Data layout transformations applied when data is pushed onto the AXI stream, described as pairs of (size, stride) from highest to lowest dimension. Defaults to None.
    dims_from_stream_per_cons (list[Sequence[int]] | None, optional): List of data layout transformations applied by each consumer when data is read from the AXI stream, described as pairs of (size, stride) from highest to lowest dimension. Defaults to None.
    plio (bool, optional): Whether the ObjectFifo uses PLIO connections. Defaults to False.
    disable_synchronization (bool, optional): When True, disables lock-based synchronization on the ObjectFifo. Defaults to False.
    repeat_count (int | None, optional): If set, causes the MemTile DMA to replay the buffer descriptor this many times without a new DMA transfer from L3. Distinct from ``iter_count`` (BD-chain iteration count). Defaults to None.
    delegate_tile (PlacementTile | None, optional): Shared-memory delegate tile. When set, the ObjectFifo's underlying buffer pool is allocated on this tile's memory module instead of the default placement. Lowers to ``aie.objectfifo.allocate``. *Only valid when both producer and consumer have shared-memory access to the delegate tile* (e.g. self-loop fifos where prod == cons, or fifos between adjacent tiles spilling to a neighboring MemTile). The delegate is the storage location, not a producer- or consumer-side concept; the underlying op verifier rejects this if either endpoint cannot share memory with the delegate. Defaults to None.
    init_values (list[np.ndarray] | None, optional): Per-buffer static initial values for the producer endpoint. One ndarray per producer-side buffer; the producer tile must be able to hold static data at design startup (e.g. a MemTile). Lowers to the ``initValues`` attribute on the underlying ``aie.objectfifo`` op. Defaults to None.
    consumer_obj_type (type[np.ndarray] | None, optional): Consumer element type for asymmetric transfer granularity. When set, the producer sends obj_type-sized transfers and the consumer receives consumer_obj_type-sized transfers. Producer element count must be an integer multiple of consumer element count. Defaults to None.

Raises:
    ValueError: If ``depth`` is provided and is less than 1.

Member Function Documentation

◆ __get_index()

int iron.dataflow.objectfifo.ObjectFifo.__get_index (   cls)
private

◆ __str__()

str iron.dataflow.objectfifo.ObjectFifo.__str__ (   self)

◆ _acquire()

iron.dataflow.objectfifo.ObjectFifo._acquire (   self,
ObjectFifoPort  port,
int  num_elem 
)
protected

◆ _cons_tiles_ops()

list[Tile] iron.dataflow.objectfifo.ObjectFifo._cons_tiles_ops (   self)
protected

◆ _get_depths()

int | list[int] iron.dataflow.objectfifo.ObjectFifo._get_depths (   self)
protected

◆ _get_endpoint()

list[ObjectFifoEndpoint] iron.dataflow.objectfifo.ObjectFifo._get_endpoint (   self,
bool  is_prod 
)
protected

◆ _prod_tile_op()

Tile iron.dataflow.objectfifo.ObjectFifo._prod_tile_op (   self)
protected

◆ _release()

iron.dataflow.objectfifo.ObjectFifo._release (   self,
ObjectFifoPort  port,
int  num_elem 
)
protected

◆ can_used_shared_mem()

bool iron.dataflow.objectfifo.ObjectFifo.can_used_shared_mem (   self,
Device  device,
bool   cons_only = False 
)
Check if all endpoints have legal memory affinity.

◆ cons()

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 it is called.

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.

◆ depth()

int iron.dataflow.objectfifo.ObjectFifo.depth (   self)
The default depth of the ObjectFifo. This may be overridden by an ObjectFifoHandle upon construction.

◆ dims_from_stream_per_cons()

list[Sequence[int]] iron.dataflow.objectfifo.ObjectFifo.dims_from_stream_per_cons (   self)
The default dimensions from stream per consumer value. This may be overridden by an ObjectFifoHandle of type consumer.

◆ dims_to_stream()

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.

◆ dtype()

np.dtype iron.dataflow.objectfifo.ObjectFifo.dtype (   self)
The per-element data type of each element in each buffer belonging to the ObjectFifo

◆ obj_type()

type[np.ndarray] iron.dataflow.objectfifo.ObjectFifo.obj_type (   self)
The tensor type of each buffer belonging to the ObjectFifo

◆ op()

ObjectFifoCreateOp iron.dataflow.objectfifo.ObjectFifo.op (   self)

◆ prod()

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 depth was not specified on ObjectFifo construction, depth must be specified here.

Returns:
    ObjectFifoHandle: The producer handle to this ObjectFifo.

◆ resolve()

None iron.dataflow.objectfifo.ObjectFifo.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.

◆ set_iter_count()

iron.dataflow.objectfifo.ObjectFifo.set_iter_count (   self,
int  iter_count 
)
Set iteration count for DMA BD (Buffer Descriptor) chaining on MemTile for the ObjectFifo.

Args:
    iter_count (int): Number of forward chain iterations.
        - Must be in range [1, 256]: Forward chain with specified number of iterations

Raises:
    ValueError: If iter_count is outside the valid range [1, 256]

◆ shape()

Sequence[int] iron.dataflow.objectfifo.ObjectFifo.shape (   self)
The shape of each buffer belonging to the ObjectFifo

◆ tiles()

list[Tile] iron.dataflow.objectfifo.ObjectFifo.tiles (   self,
bool   cons_only = False 
)
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[Tile]: A list of tiles of the endpoints of this ObjectFifo.

Reimplemented from iron.resolvable.Resolvable.

Member Data Documentation

◆ __of_index

int iron.dataflow.objectfifo.ObjectFifo.__of_index = 0
staticprivate

◆ _cons

iron.dataflow.objectfifo.ObjectFifo._cons
protected

◆ _consumer_obj_type

iron.dataflow.objectfifo.ObjectFifo._consumer_obj_type
protected

◆ _depth

iron.dataflow.objectfifo.ObjectFifo._depth
protected

◆ _dims_from_stream_per_cons

iron.dataflow.objectfifo.ObjectFifo._dims_from_stream_per_cons
protected

◆ _dims_to_stream

iron.dataflow.objectfifo.ObjectFifo._dims_to_stream
protected

◆ _iter_count

iron.dataflow.objectfifo.ObjectFifo._iter_count
protected

◆ _obj_type

iron.dataflow.objectfifo.ObjectFifo._obj_type
protected

◆ _op

iron.dataflow.objectfifo.ObjectFifo._op
protected

◆ _pad_dimensions

iron.dataflow.objectfifo.ObjectFifo._pad_dimensions
protected

◆ _plio

iron.dataflow.objectfifo.ObjectFifo._plio
protected

◆ _prod

iron.dataflow.objectfifo.ObjectFifo._prod
protected

◆ _repeat_count

iron.dataflow.objectfifo.ObjectFifo._repeat_count
protected

◆ _resolving

iron.dataflow.objectfifo.ObjectFifo._resolving
protected

◆ name

iron.dataflow.objectfifo.ObjectFifo.name

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