Skip to content

Commit

Permalink
begin implementation of backup
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlsondre committed Oct 29, 2024
1 parent 1a6ef64 commit 92ffdc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/itwinai/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ def generate_gpu_energy_plot(
log_dir: str = "utilization_logs",
pattern_str: str = r"dataframe_(?:\w+)_(?:\d+)\.csv$",
output_file: str = "plots/gpu_energy_plot.png",
backup_dir: Optional[str] = "backup/"
) -> None:
"""Generate a GPU energy plot showing the expenditure for each combination of
strategy and number of GPUs in Watt hours.
strategy and number of GPUs in Watt hours. Backs up the data used to create the
plot if ``backup_dir`` is not None
Args:
log_dir: The directory where the csv logs are stored. Defaults to
Expand All @@ -35,6 +37,8 @@ def generate_gpu_energy_plot(
Defaults to ``dataframe_(?:\\w+)_(?:\\d+)\\.csv$``.
output_file: The path to where the resulting plot should be saved. Defaults to
``plots/gpu_energy_plot.png``.
backup_dir: The path to where the data used to produce the plot should be
saved.
"""
import matplotlib.pyplot as plt
Expand Down
5 changes: 4 additions & 1 deletion src/itwinai/torch/monitoring/plotting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from pathlib import Path
from typing import Tuple
from typing import Tuple, List

import matplotlib
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -124,3 +124,6 @@ def gpu_energy_plot(gpu_utilization_df: pd.DataFrame) -> Tuple[Figure, Axes]:
ax.legend(title="Strategy")

return fig, ax

def backup_data(file_paths: List):
pass

0 comments on commit 92ffdc4

Please sign in to comment.