3737 8 : ('kTensorized' , '#A9DFBF' ),
3838}
3939
40+ PALETTE = {
41+ 0 : '#000000' ,
42+ 1 : '#922B21' ,
43+ 2 : '#76448A' ,
44+ 3 : '#1F618D' ,
45+ 4 : '#148F77' ,
46+ 5 : '#B7950B' ,
47+ 6 : '#AF601A' ,
48+ 7 : '#F5B7B1' ,
49+ 8 : '#A9DFBF' ,
50+ }
51+
52+ PALETTE_SIZE = 9
4053
4154def dom_path_to_string (dom_path , prefix = "" ):
4255 path_string = prefix
@@ -458,8 +471,8 @@ def stage_node_label(stage):
458471 var_attr_label = ''
459472 if "thread" in leafiv ["properties" ] and \
460473 leafiv ["properties" ]["thread" ] is not None :
461- var_attr_label = var_attr_label + "<br/>(" + str (
462- leafiv ["properties" ]["thread" ]) + ")"
474+ var_attr_label = var_attr_label + "<br/><font color= \" #2980B9 \" > (" + str (
475+ leafiv ["properties" ]["thread" ]) + ")</font> "
463476 if "intrin" in leafiv ["properties" ] and \
464477 leafiv ["properties" ]["intrin" ] is not None :
465478 var_attr_label = var_attr_label + "<br/>" + \
@@ -483,7 +496,11 @@ def compute_at_dot(g, stage):
483496 [stage ["attaching_to" ][0 ]], "Stage" ) + ":" + dom_path_to_string (
484497 stage ["attaching_to" ],
485498 "IterVar" ) if stage ["attaching_to" ] is not None else "ROOT"
486- g .edge (src , dst )
499+ color = PALETTE [
500+ stage ["attaching_to" ][1 ] +
501+ 1 ] if stage ["attaching_to" ] is not None and stage ["attaching_to" ][
502+ 1 ] < PALETTE_SIZE - 1 else PALETTE [0 ]
503+ g .edge (src , dst , color = color )
487504
488505 graph = create_schedule_tree_graph ("Schedule Tree" )
489506 s = extract_dom_for_viz (sch )
0 commit comments