New Features
Cutout:
Cutout allows developers to take large DaCe programs and cut out subgraphs reliably to create a runnable sub-program. This sub-program can be then used to check for correctness, benchmark, and transform a part of a program without having to run the full application.
* Example usage from Python:
python
def my_method(sdfg: dace.SDFG, state: dace.SDFGState):
nodes = [n for n in state if isinstance(n, dace.nodes.LibraryNode)] Cut every library node
cut_sdfg: dace.SDFG = cutout.cutout_state(state, *nodes)
The cut SDFG now includes each library node and all the necessary arrays to call it with
Also available in the SDFG editor:
<img src="https://user-images.githubusercontent.com/8348955/155983136-01638491-26d1-40f8-82f8-7b149215e3c1.gif" height="200px" />
Data Instrumentation:
Just like node instrumentation for performance analysis, data instrumentation allows users to set access nodes to be saved to an instrumented data report, and loaded later for exact reproducible runs.
* Data instrumentation natively works with CPU and GPU global memory, so there is no need to copy data back
* Combined with Cutout, this is a powerful interface to perform local optimizations in large applications with ease!
* Example use:
python
dace.program
def tester(A: dace.float64[20, 20]):
tmp = A + 1
return tmp + 5
sdfg = tester.to_sdfg()
for node, _ in sdfg.all_nodes_recursive(): Instrument every access node
if isinstance(node, nodes.AccessNode):
node.instrument = dace.DataInstrumentationType.Save
A = np.random.rand(20, 20)
result = sdfg(A)
Get instrumented data from report
dreport = sdfg.get_instrumented_data()
assert np.allclose(dreport['A'], A)
assert np.allclose(dreport['tmp'], A + 1)
assert np.allclose(dreport['__return'], A + 6)
Logical Groups:
SDFG elements can now be grouped by any criteria, and they will be colored during visualization by default (by phschaad). See example in action:
<img src="https://user-images.githubusercontent.com/8348955/155984287-79eaad11-1022-4857-8d79-97cc60855b20.gif" height="200px" />
Changes and Bug Fixes
* Samples and tutorials have now been updated to reflect the latest API
* Constants (added with `sdfg.add_constant`) can now be used as access nodes in SDFGs. The constants are hard-coded into the generated program, so you can run code with the best performance possible.
* View nodes can now use the `views` connector to disambiguate which access node is being viewed
* Python frontend: `else` clause is now handled in for and while loops
* Scalars have been removed from the `__dace_init` generated function signature (by orausch)
* Multiple clock signals in the RTL codegen (by carljohnsen)
* Various fixes to frontends, transformations, and code generators
**Full Changelog** available at https://github.com/spcl/dace/compare/v0.12...v0.13