dace.transformation.interstate package

Submodules

dace.transformation.interstate.fpga_transform_sdfg module

Contains inter-state transformations of an SDFG to run on an FPGA.

class dace.transformation.interstate.fpga_transform_sdfg.FPGATransformSDFG(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Implements the FPGATransformSDFG transformation, which takes an entire SDFG and transforms it into an FPGA-capable SDFG.

static annotates_memlets()

Indicates whether the transformation annotates the edges it creates or modifies with the appropriate memlets. This determines whether to apply memlet propagation after the transformation.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

promote_global_trans

If True, transient arrays that are fully internal are pulled out so that they can be allocated on the host.

properties()

dace.transformation.interstate.fpga_transform_state module

Contains inter-state transformations of an SDFG to run on an FPGA.

class dace.transformation.interstate.fpga_transform_state.FPGATransformState(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Implements the FPGATransformState transformation.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

dace.transformation.interstate.fpga_transform_state.fpga_update(sdfg, state, depth)

dace.transformation.interstate.gpu_transform_sdfg module

Contains inter-state transformations of an SDFG to run on the GPU.

class dace.transformation.interstate.gpu_transform_sdfg.GPUTransformSDFG(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Implements the GPUTransformSDFG transformation.

Transforms a whole SDFG to run on the GPU: Steps of the full GPU transform

  1. Acquire metadata about SDFG and arrays
  2. Replace all non-transients with their GPU counterparts
  3. Copy-in state from host to GPU
  4. Copy-out state from GPU to host
  5. Re-store Default-top/CPU_Heap transients as GPU_Global
  6. Global tasklets are wrapped with a map of size 1
  7. Global Maps are re-scheduled to use the GPU
  8. Make data ready for interstate edges that use them
  9. Re-apply strict transformations to get rid of extra states and transients
static annotates_memlets()

Indicates whether the transformation annotates the edges it creates or modifies with the appropriate memlets. This determines whether to apply memlet propagation after the transformation.

apply(sdfg: dace.sdfg.sdfg.SDFG)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

exclude_copyin

Exclude these arrays from being copied into the device (comma-separated)

exclude_copyout

Exclude these arrays from being copied out of the device (comma-separated)

exclude_tasklets

Exclude these tasklets from being processed as CPU tasklets (comma-separated)

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

properties()
register_trans

Make all transients inside GPU maps registers

sequential_innermaps

Make all internal maps Sequential

skip_scalar_tasklets

If True, does not transform tasklets that manipulate (Default-stored) scalars

strict_transform

Reapply strict transformations after modifying graph

toplevel_trans

Make all GPU transients top-level

dace.transformation.interstate.loop_detection module

Loop detection transformation

class dace.transformation.interstate.loop_detection.DetectLoop(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Detects a for-loop construct from an SDFG.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

dace.transformation.interstate.loop_detection.find_for_loop(sdfg: dace.sdfg.sdfg.SDFG, guard: dace.sdfg.state.SDFGState, entry: dace.sdfg.state.SDFGState, itervar: Optional[str] = None) → Optional[Tuple[AnyStr, Tuple[Union[sympy.core.basic.Basic, dace.symbolic.SymExpr], Union[sympy.core.basic.Basic, dace.symbolic.SymExpr], Union[sympy.core.basic.Basic, dace.symbolic.SymExpr]], Tuple[List[dace.sdfg.state.SDFGState], dace.sdfg.state.SDFGState]]]

Finds loop range from state machine. :param guard: State from which the outgoing edges detect whether to exit

the loop or not.
Parameters:entry – First state in the loop “body”.
Returns:
(iteration variable, (start, end, stride),
(start_states[], last_loop_state)), or None if proper

for-loop was not detected. end is inclusive.

dace.transformation.interstate.loop_peeling module

Loop unroll transformation

class dace.transformation.interstate.loop_peeling.LoopPeeling(*args, **kwargs)

Bases: dace.transformation.interstate.loop_unroll.LoopUnroll

Splits the first count iterations of a state machine for-loop into multiple, separate states.

apply(sdfg: dace.sdfg.sdfg.SDFG)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
begin

If True, peels loop from beginning (first count iterations), otherwise peels last count iterations.

static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

properties()

dace.transformation.interstate.loop_unroll module

Loop unroll transformation

class dace.transformation.interstate.loop_unroll.LoopUnroll(*args, **kwargs)

Bases: dace.transformation.interstate.loop_detection.DetectLoop

Unrolls a state machine for-loop into multiple states

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

count

Number of iterations to unroll, or zero for all iterations (loop must be constant-sized for 0)

instantiate_loop(sdfg: dace.sdfg.sdfg.SDFG, loop_states: List[dace.sdfg.state.SDFGState], loop_subgraph: dace.sdfg.graph.SubgraphView, itervar: str, value: Union[sympy.core.basic.Basic, dace.symbolic.SymExpr], state_suffix=None)
properties()

dace.transformation.interstate.sdfg_nesting module

SDFG nesting transformation.

class dace.transformation.interstate.sdfg_nesting.ASTRefiner(to_refine: str, refine_subset: dace.subsets.Subset, sdfg: dace.sdfg.sdfg.SDFG, indices: Set[int] = None)

Bases: ast.NodeTransformer

Python AST transformer used in RefineNestedAccess to reduce (refine) the subscript ranges based on the specification given in the transformation.

visit_Subscript(node: _ast.Subscript) → _ast.Subscript
class dace.transformation.interstate.sdfg_nesting.InlineSDFG(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Inlines a single-state nested SDFG into a top-level SDFG.

In particular, the steps taken are:

  1. All transient arrays become transients of the parent
  2. If a source/sink node is one of the inputs/outputs:
  1. Remove it
  2. Reconnect through external edges (map/accessnode)
  3. Replace and reoffset memlets with external data descriptor
  1. If other nodes carry the names of inputs/outputs:
  1. Replace data with external data descriptor
  2. Replace and reoffset memlets with external data descriptor
  1. If source/sink node is not connected to a source/destination, and the nested SDFG is in a scope, connect to scope with empty memlets
  2. Remove all unused external inputs/output memlet paths
  3. Remove isolated nodes resulting from previous step
static annotates_memlets()

Indicates whether the transformation annotates the edges it creates or modifies with the appropriate memlets. This determines whether to apply memlet propagation after the transformation.

apply(sdfg: dace.sdfg.sdfg.SDFG)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

properties()
class dace.transformation.interstate.sdfg_nesting.InlineTransients(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Inlines all transient arrays that are not used anywhere else into a nested SDFG.

static annotates_memlets()

Indicates whether the transformation annotates the edges it creates or modifies with the appropriate memlets. This determines whether to apply memlet propagation after the transformation.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph: dace.sdfg.state.SDFGState, candidate: Dict[dace.transformation.transformation.PatternNode, int], expr_index: int, sdfg: dace.sdfg.sdfg.SDFG, strict: bool = False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

nsdfg = <dace.transformation.transformation.PatternNode object>
properties()
class dace.transformation.interstate.sdfg_nesting.NestSDFG(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Implements SDFG Nesting, taking an SDFG as an input and creating a nested SDFG node from it.

static annotates_memlets()

Indicates whether the transformation annotates the edges it creates or modifies with the appropriate memlets. This determines whether to apply memlet propagation after the transformation.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

promote_global_trans

Promotes transients to be allocated once

properties()
class dace.transformation.interstate.sdfg_nesting.RefineNestedAccess(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Reduces memlet shape when a memlet is connected to a nested SDFG, but not using all of the contents. Makes the outer memlet smaller in shape and ensures that the offsets in the nested SDFG start with zero. This helps with subsequent transformations on the outer SDFGs.

For example, in the following program:

@dace.program
def func_a(y):
    return y[1:5] + 1

@dace.program
def main(x: dace.float32[N]):
    return func_a(x)

The memlet pointing to func_a will contain all of x (x[0:N]), and it is offset to y[1:5] in the function, with y’s size being N. After the transformation, the memlet connected to the nested SDFG of func_a would contain x[1:5] directly and the internal y array would have a size of 4, accessed as y[0:4].

static annotates_memlets()

Indicates whether the transformation annotates the edges it creates or modifies with the appropriate memlets. This determines whether to apply memlet propagation after the transformation.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph: dace.sdfg.state.SDFGState, candidate: Dict[dace.transformation.transformation.PatternNode, int], expr_index: int, sdfg: dace.sdfg.sdfg.SDFG, strict: bool = False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

nsdfg = <dace.transformation.transformation.PatternNode object>
properties()

dace.transformation.interstate.state_elimination module

State elimination transformations

class dace.transformation.interstate.state_elimination.EndStateElimination(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

End-state elimination removes a redundant state that has one incoming edge and no contents.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

class dace.transformation.interstate.state_elimination.HoistState(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Move a state out of a nested SDFG

apply(sdfg: dace.sdfg.sdfg.SDFG)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph: dace.sdfg.state.SDFGState, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

nsdfg = <dace.transformation.transformation.PatternNode object>
class dace.transformation.interstate.state_elimination.StateAssignElimination(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

State assign elimination removes all assignments into the final state and subsumes the assigned value into its contents.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

dace.transformation.interstate.state_fusion module

State fusion transformation

class dace.transformation.interstate.state_fusion.CCDesc(first_inputs: Set[str], first_outputs: Set[str], first_output_nodes: Set[dace.sdfg.nodes.AccessNode], second_inputs: Set[str], second_outputs: Set[str], second_input_nodes: Set[dace.sdfg.nodes.AccessNode])

Bases: object

class dace.transformation.interstate.state_fusion.StateFusion(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Implements the state-fusion transformation.

State-fusion takes two states that are connected through a single edge, and fuses them into one state. If strict, only applies if no memory access hazards are created.

static annotates_memlets()

Indicates whether the transformation annotates the edges it creates or modifies with the appropriate memlets. This determines whether to apply memlet propagation after the transformation.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static find_fused_components(first_cc_input, first_cc_output, second_cc_input, second_cc_output) → List[dace.transformation.interstate.state_fusion.CCDesc]
first_state = <dace.transformation.transformation.PatternNode object>
static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

static memlets_intersect(graph_a: dace.sdfg.state.SDFGState, group_a: List[dace.sdfg.nodes.AccessNode], inputs_a: bool, graph_b: dace.sdfg.state.SDFGState, group_b: List[dace.sdfg.nodes.AccessNode], inputs_b: bool) → bool

Performs an all-pairs check for subset intersection on two groups of nodes. If group intersects or result is indeterminate, returns True as a precaution. :param graph_a: The graph in which the first set of nodes reside. :param group_a: The first set of nodes to check. :param inputs_a: If True, checks inputs of the first group. :param graph_b: The graph in which the second set of nodes reside. :param group_b: The second set of nodes to check. :param inputs_b: If True, checks inputs of the second group. :returns True if subsets intersect or result is indeterminate.

second_state = <dace.transformation.transformation.PatternNode object>
dace.transformation.interstate.state_fusion.top_level_nodes(state: dace.sdfg.state.SDFGState)

dace.transformation.interstate.transient_reuse module

class dace.transformation.interstate.transient_reuse.TransientReuse(*args, **kwargs)

Bases: dace.transformation.transformation.Transformation

Implements the TransientReuse transformation. Finds all possible reuses of arrays, decides for a valid combination and changes sdfg accordingly.

apply(sdfg)

Applies this transformation instance on the matched pattern graph. :param sdfg: The SDFG to apply the transformation to. :return: A transformation-defined return value, which could be used

to pass analysis data out, or nothing.
static can_be_applied(graph, candidate, expr_index, sdfg, strict=False)

Returns True if this transformation can be applied on the candidate matched subgraph. :param graph: SDFGState object if this Transformation is

single-state, or SDFG object otherwise.
Parameters:
  • candidate – A mapping between node IDs returned from Transformation.expressions and the nodes in graph.
  • expr_index – The list index from Transformation.expressions that was matched.
  • sdfg – If graph is an SDFGState, its parent SDFG. Otherwise should be equal to graph.
  • strict – Whether transformation should run in strict mode.
Returns:

True if the transformation can be applied.

expansion()
static expressions()

Returns a list of Graph objects that will be matched in the subgraph isomorphism phase. Used as a pre-pass before calling can_be_applied. :see: Transformation.can_be_applied

static match_to_str(graph, candidate)

Returns a string representation of the pattern match on the candidate subgraph. Used when identifying matches in the console UI.

properties()

Module contents

This module initializes the inter-state transformations package.