Skip to content

Commit

Permalink
add one call to test plot.py
Browse files Browse the repository at this point in the history
Signed-off-by: luarss <jluar@precisioninno.com>
  • Loading branch information
luarss committed Jan 11, 2025
1 parent 8b42912 commit d6c0661
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/AutoTuner/src/autotuner/utils/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import pandas as pd
import matplotlib.pyplot as plt
import re
import os
import argparse

AT_REGEX = r"variant-AutoTunerBase-([\w-]+)-\w+"
IMG_DIR = "images"


def load_dir(dir: str) -> pd.DataFrame:
Expand Down Expand Up @@ -83,6 +85,8 @@ def plot(df: pd.DataFrame, key: str):


def main(results_dir: str):
# Default: saves to <REPO_ROOT>/images. Change the IMG_DIR above.
os.makedirs(IMG_DIR, exist_ok=True)
df = load_dir(results_dir)
df = preprocess(df)
keys = ["qor", "runtime", "clk_period", "worst_slack"]
Expand All @@ -93,7 +97,10 @@ def main(results_dir: str):
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Plot AutoTuner results.")
parser.add_argument(
"results_dir", type=str, help="Directory containing the results.", required=True
"--results_dir",
type=str,
help="Directory containing the results.",
required=True,
)
args = parser.parse_args()
main(args.results_dir)

0 comments on commit d6c0661

Please sign in to comment.