This commit is contained in:
@@ -52,7 +52,7 @@ PERCENTAGE_FIELDS = (
|
||||
("raptor_power_mw", "power"),
|
||||
("raptor_energy_pj", "energy"),
|
||||
)
|
||||
RESULT_FIELDS = (*CASE_FIELDS, *(target for _, target in PERCENTAGE_FIELDS))
|
||||
RESULT_FIELDS = (*CASE_FIELDS, "functional_validation", *(target for _, target in PERCENTAGE_FIELDS))
|
||||
DEFAULT_CASE_ARGUMENTS = (
|
||||
("latency", ("--mode", "latency")),
|
||||
("throughput/pipeline4", ("--mode", "throughput", "--pipeline", "4")),
|
||||
@@ -106,20 +106,7 @@ def runner_argument_sets(forwarded: list[str]) -> tuple[tuple[str, list[str]], .
|
||||
|
||||
|
||||
def variant_output_dir(out_dir: Path, variant: Variant) -> Path:
|
||||
return out_dir if variant.name == "baseline" else out_dir / "ablation" / variant.name
|
||||
|
||||
|
||||
def remove_variant_summaries(out_dir: Path) -> None:
|
||||
summary_root = out_dir / "ablation"
|
||||
if not summary_root.is_dir():
|
||||
return
|
||||
for summary in summary_root.glob("*/results_comparison.csv"):
|
||||
summary.unlink()
|
||||
for variant_dir in summary_root.iterdir():
|
||||
if variant_dir.is_dir() and not any(variant_dir.iterdir()):
|
||||
variant_dir.rmdir()
|
||||
if not any(summary_root.iterdir()):
|
||||
summary_root.rmdir()
|
||||
return out_dir / "ablation" / variant.name
|
||||
|
||||
|
||||
def runner_command(
|
||||
@@ -136,11 +123,11 @@ def runner_command(
|
||||
"--out-dir",
|
||||
str(out_dir),
|
||||
"--raptor-only",
|
||||
"--ablation-variant",
|
||||
variant.name,
|
||||
"--models",
|
||||
*models,
|
||||
]
|
||||
if variant.name != "baseline":
|
||||
command.extend(("--ablation-variant", variant.name))
|
||||
if not has_option(forwarded, "--common-dir"):
|
||||
command.extend(("--common-dir", str(common_root)))
|
||||
command.extend(forwarded)
|
||||
@@ -228,6 +215,7 @@ def aggregate_results(
|
||||
{
|
||||
"variant": variant.name,
|
||||
**{field: row.get(field, "") for field in CASE_FIELDS},
|
||||
"functional_validation": row.get("raptor_functional_validation", "NA"),
|
||||
**{
|
||||
target: percentage_difference(
|
||||
row.get(source), reference.get(source) if reference else None
|
||||
@@ -301,7 +289,6 @@ def main(argv: list[str] | None = None) -> int:
|
||||
if current_process is not None:
|
||||
terminate_process_group(current_process)
|
||||
remove_lock_files(out_dir)
|
||||
remove_variant_summaries(out_dir)
|
||||
print("Interrupted; terminated the active ablation job.", file=sys.stderr)
|
||||
return 130
|
||||
|
||||
@@ -313,7 +300,6 @@ def main(argv: list[str] | None = None) -> int:
|
||||
selected_cases,
|
||||
frozenset(args.models),
|
||||
)
|
||||
remove_variant_summaries(out_dir)
|
||||
failed.extend(aggregation_failures)
|
||||
if output is not None:
|
||||
print(f"Ablation results: {output}")
|
||||
|
||||
Reference in New Issue
Block a user