Info: Zenodo’s user support line is staffed on regular business days between Dec 23 and Jan 5. Response times may be slightly longer than normal.

There is a newer version of the record available.

Published January 22, 2022 | Version v0.12
Software Open

spcl/dace: DaCe 0.12

Description

API Changes

Important: Pattern-matching transformation API has been significantly simplified. Transformations using the old API must be ported! Summary of changes:

  • Transformations now expand either the SingleStateTransformation or MultiStateTransformation classes instead of using decorators
  • Patterns must be registered as class variables called PatternNodes
  • Nodes in matched patterns can be then accessed in can_be_applied and apply directly using self.nodename
  • The name strict is now replaced with permissive (False by default). Permissive mode allows transformations to match in more cases, but may be dangerous to apply (e.g., create race conditions).
  • can_be_applied is now a method of the transformation
  • The apply method accepts a graph and the SDFG.

Example of using the new API:

import dace
from dace import nodes
from dace.sdfg import utils as sdutil
from dace.transformation import transformation as xf

class ExampleTransformation(xf.SingleStateTransformation):
    # Define pattern nodes
    map_entry = xf.PatternNode(nodes.MapEntry)
    access = xf.PatternNode(nodes.AccessNode)

    # Define matching subgraphs
    @classmethod
    def expressions(cls):
        # MapEntry -> Access
        return [sdutil.node_path_graph(cls.map_entry, cls.access)]

    def can_be_applied(self, graph: dace.SDFGState, expr_index: int, sdfg: dace.SDFG, permissive: bool = False) -> bool:
        # Returns True if the transformation can be applied on a subgraph
        if permissive:  # In permissive mode, we will always apply this transformation
            return True
        return self.map_entry.schedule == dace.ScheduleType.CPU_Multicore

    def apply(self, graph: dace.SDFGState, sdfg: dace.SDFG):
        # Apply the transformation using the SDFG API
        pass

Simplifying SDFGs is renamed from sdfg.apply_strict_transformations() to sdfg.simplify()

AccessNodes no longer have an AccessType field.

Other changes
  • More nested SDFG inlining opportunities by default with the multi-state inline transformation
  • Performance optimizations of the DaCe framework (parsing, transformations, code generation) for large graphs
  • Support for Xilinx Vitis 2021.2
  • Minor fixes to transformations and deserialization

Full Changelog: https://github.com/spcl/dace/compare/v0.11.4...v0.12

Files

spcl/dace-v0.12.zip

Files (2.4 MB)

Name Size Download all
md5:f8374c45f2c88770e7fa7154a49df3e1
2.4 MB Preview Download

Additional details

Related works