in visualize/generate.py [0:0]
def create_ratio_pie(epoch_data):
total_computation_time = total_communication_time = 0
for item in epoch_data:
if item.comm_type == CommType.computation:
total_computation_time += item._elapsed_time
elif item.comm_type != CommType.epoch_end:
total_communication_time += item._elapsed_time
total_ratio_pie = Pie()
total_ratio_pie.add(
"",
[
("Computation", total_computation_time),
("Communication", total_communication_time)
],
radius=["40%", "75%"],
)
total_ratio_pie.set_global_opts(
title_opts=opts.TitleOpts(title="Overall Computation vs Communication time Ratio"),
legend_opts=opts.LegendOpts(type_="scroll", pos_left="80%", orient="vertical")
)
total_ratio_pie.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {d}%"))
return total_ratio_pie