示例#1
0
 def verify():
     from tvm.contrib import tedd
     str = tedd.viz_itervar_relationship_graph(s, False, '', True)
     findany(r"digraph \"IterVar Relationship Graph\"", str)
     findany(r"subgraph cluster_legend", str)
     # Check subgraphs for stages
     findany(r"subgraph cluster_Stage_0", str)
     findany(r"subgraph cluster_Stage_1", str)
     # Check itervars and their types
     findany(r"i\(kDataPar\)\<br/\>range\(min=0, ext=n\)", str)
     findany(r"k\(kCommReduce\)\<br/\>range\(min=0, ext=m\)", str)
     # Check the split node
     findany(r"Split_Relation_1_0 +.+\>Split", str)
     # Check all edges to/from the split node
     findany(r"IterVar_1_1:itervar -> Split_Relation_1_0:Input", str)
     findany(r"Split_Relation_1_0:Outer -> IterVar_1_2:itervar", str)
     findany(r"Split_Relation_1_0:Inner -> IterVar_1_3:itervar", str)
示例#2
0
# IterVar type with the index box color, shown in the legend.
#
# If a stage doesn't compute_at any other stage, it has an edge directly to the
# ROOT node.  Otherwise, it has an edge pointing to the IterVar it attaches to,
# such as W.shared attaches to rx.outer in the middle compute stage.
#

######################################################################
# .. note::
#
#   By definition, IterVars are internal nodes and computes are leaf nodes in
#   a schedule tree.   The edges among IterVars and compute within one stage are
#   omitted, making every stage a block, for better readability.
#

tedd.viz_itervar_relationship_graph(s, dot_file_path="/tmp/itervar.dot")
# tedd.viz_itervar_relationship_graph(s, show_svg = True)

######################################################################
# .. image:: https://github.com/dmlc/web-data/raw/master/tvm/tutorial/tedd_itervar_rel.png
#      :align: center
#
# The last one is an IterVar Relationship Graph.  Every subgraph represents a
# stage and contains IterVar nodes and transformation nodes.  For example,
# W.shared has three split nodes and three fuse nodes.  The rest are IterVar
# nodes of the same format as the IterVar rows in Schedule Trees.  Root
# IterVars are those not driven by any transformation node, such as ax0; leaf
# IterVars don't drive any transformation node and have non-negative indices,
# such as ax0.ax1.fused.ax2.fused.ax3.fused.outer with index of 0.
#