'dialects.dataflow' Submodule
- Introduction
- ITensorType
- TaskGraph
- TaskGraphEdge
- TaskGraphNode
- TaskGraphNodeChildrenIterator
- TaskGraphNodeInEdgesIterator
- TaskGraphNodeOutEdgesIterator
- TaskGraphNodesIterator
- get_children
- get_iter_trip_counts
- get_live_ins
- get_parent_task_or_func
- get_reduced_shape_and_vec_shape
- get_tied_yielded_itensor
- is_leaf_task
Introduction¶
from streamtensor.dialects import dataflow
ITensorType
¶
Represents an ITensor type in the dataflow dialect.
Attributes:
Name | Type | Description |
---|---|---|
shape |
list[int]
|
The shape of the tensor. |
bitwidth |
int
|
The bitwidth of the tensor. |
iter_trip_counts |
list[int]
|
The iteration loop trip counts of the tensor. |
TaskGraph(arg0)
¶
TaskGraphEdge(*args, **kwargs)
¶
TaskGraphNode(*args, **kwargs)
¶
children()
¶
children(self: _dataflow_dialect.TaskGraphNode) -> _dataflow_dialect.TaskGraphNodeChildrenIterator
in_edges()
¶
in_edges(self: _dataflow_dialect.TaskGraphNode) -> _dataflow_dialect.TaskGraphNodeInEdgesIterator
out_edges()
¶
out_edges(self: _dataflow_dialect.TaskGraphNode) -> _dataflow_dialect.TaskGraphNodeOutEdgesIterator
TaskGraphNodeChildrenIterator(*args, **kwargs)
¶
TaskGraphNodeInEdgesIterator(*args, **kwargs)
¶
TaskGraphNodeOutEdgesIterator(*args, **kwargs)
¶
TaskGraphNodesIterator(*args, **kwargs)
¶
get_children(task_op)
¶
get_children(task_op: MlirOperation) -> List[MlirOperation]
Gets the children of the task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_op
|
MlirOperation
|
The |
required |
Returns:
Type | Description |
---|---|
list[MlirOperation]
|
A list of |
get_iter_trip_counts(task_op)
¶
get_iter_trip_counts(task_op: MlirOperation) -> List[int]
Gets the iteration loop trip counts of the task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_op
|
MlirOperation
|
The |
required |
Returns:
Type | Description |
---|---|
list[int]
|
A list of int representing the iteration loop trip counts of the task. |
get_live_ins(task_op)
¶
get_live_ins(task_op: MlirOperation) -> List[MlirValue]
Gets the live-in values of the task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_op
|
MlirOperation
|
The |
required |
Returns:
Type | Description |
---|---|
list[MlirValue]
|
A list of |
get_parent_task_or_func(op)
¶
get_parent_task_or_func(op: MlirOperation) -> Optional[MlirOperation]
Gets the parent task or function operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op
|
MlirOperation
|
The |
required |
Returns:
Type | Description |
---|---|
Optional[MlirOperation]
|
The parent |
get_reduced_shape_and_vec_shape(source_itensor_type, result_itensor_type)
¶
get_reduced_shape_and_vec_shape(source_itensor_type: MlirType, result_itensor_type: MlirType) -> Tuple[List[int], List[int]]
Gets the reduced shape and vectorized shape of the tensor reduction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_itensor_type
|
MlirType
|
The |
required |
result_itensor_type
|
MlirType
|
The |
required |
Returns:
Type | Description |
---|---|
tuple[list[int], list[int]]
|
A pair of lists of int representing the reduced shape and vectorized shape. |
get_tied_yielded_itensor(kernel_result)
¶
get_tied_yielded_itensor(kernel_result: MlirValue) -> MlirValue
Gets the tied yielded ITensor of the kernel result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel_result
|
MlirValue
|
The |
required |
Returns:
Type | Description |
---|---|
MlirValue
|
The |
is_leaf_task(task_op)
¶
is_leaf_task(task_op: MlirOperation) -> bool
Checks if the task is a leaf task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_op
|
MlirOperation
|
The |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the task is a leaf task, False otherwise. |