Plots GPU metrics as a matplotlib plot.
(gpu_metrics_info, output_dir)
| 1221 | |
| 1222 | |
| 1223 | def plot_gpu_metrics(gpu_metrics_info, output_dir): |
| 1224 | """ |
| 1225 | Plots GPU metrics as a matplotlib plot. |
| 1226 | """ |
| 1227 | for metric_name in gpu_metrics_info: |
| 1228 | # Create pandas data frame. |
| 1229 | df = pd.DataFrame(gpu_metrics_info[metric_name]) |
| 1230 | ax = df.plot(title=metric_name) |
| 1231 | ax.set_xlabel("Execution time") |
| 1232 | ax.set_ylabel(metric_name) |
| 1233 | fig = ax.get_figure() |
| 1234 | fig.savefig(os.path.join(output_dir, "plot.%s.jpg" % metric_name)) |
| 1235 | plt.close(fig) |
| 1236 | |
| 1237 | |
| 1238 | def main(): |