From 831efeff54cee8447d3e53e77b8ad619b165b8a5 Mon Sep 17 00:00:00 2001 From: Yifan Zhao <yifanz16@illinois.edu> Date: Tue, 6 Apr 2021 06:15:09 -0500 Subject: [PATCH] Fixed a bug in profile plotting and added test case for it --- hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py | 4 ++-- .../dnn_benchmarks/pytorch/test_profiling/test_profiling.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py b/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py index b421071aaf..790540aa67 100644 --- a/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py +++ b/hpvm/projects/hpvm-profiler/hpvm_profiler/__init__.py @@ -125,8 +125,8 @@ def plot_hpvm_configs( qoses, speedups = qos_speedup.T fig, ax = plt.subplots(**fig_kwargs) ax.scatter(qoses, speedups) - ax.xlabel("QoS Loss") - ax.ylabel("Speedup (X)") + ax.set_xlabel("QoS Loss") + ax.set_ylabel("Speedup (X)") if save_to: fig.savefig(save_to, dpi=300) return fig diff --git a/hpvm/test/dnn_benchmarks/pytorch/test_profiling/test_profiling.py b/hpvm/test/dnn_benchmarks/pytorch/test_profiling/test_profiling.py index 66aa33d7cb..72ad213b1c 100755 --- a/hpvm/test/dnn_benchmarks/pytorch/test_profiling/test_profiling.py +++ b/hpvm/test/dnn_benchmarks/pytorch/test_profiling/test_profiling.py @@ -4,7 +4,7 @@ import site from pathlib import Path from sys import argv -from hpvm_profiler import profile_configs, read_hpvm_configs, write_hpvm_configs +from hpvm_profiler import profile_configs, read_hpvm_configs, write_hpvm_configs, plot_hpvm_configs self_folder = Path(__file__).parent.absolute() site.addsitedir(self_folder.parent) @@ -20,3 +20,4 @@ out_config_file = f"./{netname}.txt" header, configs = read_hpvm_configs(config_file) profile_configs(binary_file, configs[1:6], configs[0], progress_bar=False) write_hpvm_configs(header, configs[:6], out_config_file) +plot_hpvm_configs(out_config_file, f"{netname}.png") -- GitLab