Merge remote-tracking branch 'origin/main'
Validate Operations / validate-operations (push) Has been cancelled

This commit is contained in:
NiccoloN
2026-11-05 15:54:00 +01:00
21 changed files with 1161 additions and 311 deletions
+4 -1
View File
@@ -9,6 +9,9 @@ Run the synchronization/Spatial-planning ablation from the repository root:
Defaults: `vgg8 resnet18 resnet34 googlenet`, `arch-a arch-b`, latency
(pipeline 1), and throughput (pipeline 4). Select `yolo11n` or `arch-c`
explicitly when needed. Only Raptor runs; Pimcomp validation is `SKIPPED`.
Ready models, architectures, modes, and variants run concurrently in one dependency queue.
References are prepared once per model. `--jobs` and `--threads-per-job` both default
to the available logical processor count; override them to limit CPU contention.
| Variant | Raptor options |
|---|---|
@@ -34,7 +37,7 @@ suite pipelines for that mode. Pipeline-only selection uses its matching mode.
`--pipeline auto` requests automatic throughput depth selection; positive numeric
depths retain their exact-stage meaning.
`--only` is rejected because
the wrapper always runs Raptor only. Ctrl+C stops the active variant's workers.
the wrapper always runs Raptor only. Ctrl+C stops all active experiment workers.
Artifacts use `<out-dir>/<model>/artifacts/<arch>/<mode>[/pipelineN]/ablation/<variant>/`;
reference inputs, outputs, and runners are shared under `artifacts/common/`.
+21 -41
View File
@@ -6,10 +6,7 @@ from __future__ import annotations
import argparse
import csv
import math
import os
import shlex
import signal
import subprocess
import sys
from dataclasses import dataclass
from pathlib import Path
@@ -26,6 +23,7 @@ from raptor_validation.pimcomp_models import (
)
from raptor_validation.artifacts import remove_lock_files
from raptor_validation.raptor import parse_pipeline_depth, pipeline_sort_key
from raptor_validation.experiment_scheduler import available_processors, positive_integer
@dataclass(frozen=True)
@@ -79,9 +77,14 @@ def parse_args(argv: list[str] | None = None) -> tuple[argparse.Namespace, list[
help="Run only this variant; baseline is added when needed. Repeat as needed.",
)
parser.add_argument("--dry-run", action="store_true", help="Print runner commands without modifying files.")
parser.add_argument("--jobs", "-j", type=positive_integer, default=available_processors(),
help="Maximum concurrent cases (default: available logical processors).")
parser.add_argument("--threads-per-job", type=positive_integer, default=available_processors(),
help="Threads per case (default: available logical processors).")
args, forwarded = parser.parse_known_args(argv)
if any(option == "--only" or option.startswith("--only=") for option in forwarded):
parser.error("--only is not supported; the ablation wrapper always runs Raptor only")
forwarded.extend(("--jobs", str(args.jobs), "--threads-per-job", str(args.threads_per_job)))
return args, forwarded
@@ -156,23 +159,6 @@ def runner_command(
return command
def terminate_process_group(process: subprocess.Popen[bytes]) -> None:
if process.poll() is not None:
return
try:
os.killpg(process.pid, signal.SIGTERM)
except ProcessLookupError:
return
try:
process.wait(timeout=5)
except subprocess.TimeoutExpired:
try:
os.killpg(process.pid, signal.SIGKILL)
except ProcessLookupError:
return
process.wait()
def percentage_difference(
value: str | None, reference: str | None, *, lower_is_better: bool = False
) -> str:
@@ -313,33 +299,27 @@ def main(argv: list[str] | None = None) -> int:
)
return 0
out_dir.mkdir(parents=True, exist_ok=True)
failed = []
current_process = None
sys.path.insert(0, str(RUNNER.parent))
import run_pimcomp_models as suite
plans = []
try:
for variant in variants:
for case_label, case_forwarded in case_sets:
for _, case_forwarded in case_sets:
if variant.name == "no-sync" and case_key(case_forwarded)[0] != "throughput":
continue
command = runner_command(
out_dir, variant, args.models, case_forwarded, out_dir, False
)
print(f"[{variant.name}/{case_label}] {shlex.join(command)}")
current_process = subprocess.Popen(
command,
cwd=REPO,
start_new_session=True,
)
returncode = current_process.wait()
current_process = None
if returncode:
failed.append(f"{variant.name}/{case_label}: runner exited with {returncode}")
command = runner_command(out_dir, variant, args.models, case_forwarded, out_dir, False)
selected = suite.parse_args(command[2:])
if selected.clean:
print(f"Removed {suite.clean_artifacts(out_dir, args.models, out_dir)} artifact path(s).")
return 0
plans.append(suite.make_plan(selected))
failed = ["experiment jobs failed"] if suite.run_plans(plans) else []
except KeyboardInterrupt:
if current_process is not None:
terminate_process_group(current_process)
remove_lock_files(out_dir)
print("Interrupted; terminated the active ablation job.", file=sys.stderr)
print("Interrupted; terminated ablation workers.", file=sys.stderr)
return 130
except ValueError as exc:
print(str(exc), file=sys.stderr)
return 2
remove_lock_files(out_dir)
selected_cases = frozenset(case_key(arguments) for _, arguments in case_sets)