Validate new option for compile only
Validate Operations / validate-operations (push) Has been cancelled
Validate Operations / validate-operations (push) Has been cancelled
This commit is contained in:
+22
-2
@@ -6,7 +6,15 @@ import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from colorama import Style, Fore
|
||||
from validate_one import ProgressReporter, clean_workspace_artifacts, validate_network
|
||||
from validate_one import (
|
||||
MODE_COMPILE_ONLY,
|
||||
MODE_FULL,
|
||||
MODE_RUN_ONLY,
|
||||
MODE_STAGE_TITLES,
|
||||
ProgressReporter,
|
||||
clean_workspace_artifacts,
|
||||
validate_network,
|
||||
)
|
||||
from raptor import PIM_PASS_LABELS
|
||||
|
||||
|
||||
@@ -71,6 +79,11 @@ def main():
|
||||
help="Per-subprocess timeout in seconds for compiler, runner, and simulator commands.")
|
||||
ap.add_argument("--clean", action="store_true",
|
||||
help="Remove generated validation artifacts under each model workspace and exit.")
|
||||
mode_group = ap.add_mutually_exclusive_group()
|
||||
mode_group.add_argument("--compile-only", action="store_true",
|
||||
help="Compile reference and PIM artifacts only; do not run reference, simulator, or compare.")
|
||||
mode_group.add_argument("--run-only", action="store_true",
|
||||
help="Reuse existing compiled artifacts and only run inputs/reference/simulator/compare.")
|
||||
ap.add_argument("--verbose", action="store_true",
|
||||
help="Print per-stage progress and subprocess logs for passing validations too.")
|
||||
a = ap.parse_args()
|
||||
@@ -111,12 +124,18 @@ def main():
|
||||
print(f"Operations root: {operations_dir}")
|
||||
print("=" * 72)
|
||||
|
||||
mode = MODE_FULL
|
||||
if a.compile_only:
|
||||
mode = MODE_COMPILE_ONLY
|
||||
elif a.run_only:
|
||||
mode = MODE_RUN_ONLY
|
||||
|
||||
results = {} # relative_path -> passed
|
||||
pass_timing_sums = {label: 0.0 for _, label in PIM_PASS_LABELS}
|
||||
pass_timing_counts = {label: 0 for _, label in PIM_PASS_LABELS}
|
||||
total_timing_sum = 0.0
|
||||
timed_benchmark_count = 0
|
||||
reporter = ProgressReporter(len(onnx_files), verbose=a.verbose)
|
||||
reporter = ProgressReporter(len(onnx_files), stages_per_model=len(MODE_STAGE_TITLES[mode]), verbose=a.verbose)
|
||||
for index, onnx_path in enumerate(onnx_files, start=1):
|
||||
rel = onnx_path.relative_to(operations_dir)
|
||||
try:
|
||||
@@ -131,6 +150,7 @@ def main():
|
||||
model_index=index,
|
||||
model_total=len(onnx_files),
|
||||
verbose=a.verbose,
|
||||
mode=mode,
|
||||
)
|
||||
results[str(rel)] = result.passed
|
||||
if result.pim_pass_timings:
|
||||
|
||||
Reference in New Issue
Block a user