示例#1
0
 def verify():
     from tvm.contrib import tedd
     str = tedd.viz_dataflow_graph(s, False, '', True)
     # Check all edges are available
     findany(r"digraph \"Dataflow Graph\"", str)
     findany(r"Stage_0:O_0 -> Tensor_0_0", str)
     findany(r"Tensor_0_0 -> Stage_1:I_0", str)
     findany(r"Stage_1:O_0 -> Tensor_1_0", str)
     findany(r"Tensor_0_0 -> Stage_2:I_0", str)
     findany(r"Tensor_1_0 -> Stage_2:I_1", str)
     findany(r"Stage_2:O_0 -> Tensor_2_0", str)
     findany(r"Tensor_2_0 -> Stage_3:I_0", str)
     findany(r"Stage_3:O_0 -> Tensor_3_0", str)
     findany(r"Tensor_2_0 -> Stage_4:I_0", str)
     findany(r"Tensor_3_0 -> Stage_4:I_1", str)
     findany(r"Stage_4:O_0 -> Tensor_4_0", str)
示例#2
0
with tvm.target.Target("llvm"):
    t_conv = topi.nn.conv2d_hwcn(A, W, stride, padding, dilation)
    t_bias = topi.add(t_conv, B)
    t_relu = topi.nn.relu(t_bias)
    s = topi.generic.schedule_conv2d_hwcn([t_relu])

######################################################################
# Render Graphs with TEDD
# -----------------------
# We render graphs to see the computation
# and how it is scheduled.
# If you run the tutorial in a Jupyter notebook, you can use the following commented lines
# to render SVG figures showing in notebook directly.
#

tedd.viz_dataflow_graph(s, dot_file_path="/tmp/dfg.dot")
# tedd.viz_dataflow_graph(s, show_svg = True)

######################################################################
# .. image:: https://github.com/dmlc/web-data/raw/master/tvm/tutorial/tedd_dfg.png
#      :align: center
#
# The first one is a dataflow graph.  Every node represents a stage with name and memory
# scope shown in the middle and inputs/outputs information on the sides.
# Edges show nodes' dependency.
#

tedd.viz_schedule_tree(s, dot_file_path="/tmp/scheduletree.dot")
# tedd.viz_schedule_tree(s, show_svg = True)

######################################################################