Python peft and new summary report

This commit is contained in:
ilgeco
2026-06-05 10:20:02 +02:00
parent 27410207c4
commit 800c0c4316
3 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -42,7 +42,7 @@ def _format_command(cmd):
def compile_with_raptor(network_path, raptor_onnx_path: Path, output_base: Path,
crossbar_size, crossbar_count, core_count=None, pim_merge_scheduler="peft",
cwd=None, verbose=False, reporter=None, timeout_sec=None):
pim_memory_report="none", cwd=None, verbose=False, reporter=None, timeout_sec=None):
# Define the arguments, with the possibility to set crossbar size and count
args = [
network_path,
@@ -56,6 +56,8 @@ def compile_with_raptor(network_path, raptor_onnx_path: Path, output_base: Path,
]
if core_count is not None:
args.append(f"--core-count={core_count}")
if pim_memory_report != "none":
args.append(f"--pim-memory-report={pim_memory_report}")
if verbose:
args.append("--enable-timing")
+3 -1
View File
@@ -75,6 +75,8 @@ def main():
help="Core count to pass to Raptor. Required for PIM validation.")
ap.add_argument("--pim-merge-scheduler", choices=("peft"), default="peft",
help="Scheduler used by the Spatial merge-compute-nodes pass.")
ap.add_argument("--pim-memory-report", choices=("none", "summary", "full"), default="none",
help="Emit a human-readable PIM memory planning report during codegen.")
ap.add_argument("--command-timeout-seconds", type=float, default=1000000.0,
help="Per-subprocess timeout in seconds for compiler, runner, and simulator commands.")
ap.add_argument("--clean", action="store_true",
@@ -142,7 +144,7 @@ def main():
result = validate_network(
onnx_path, a.raptor_path, a.onnx_include_dir, simulator_dir,
crossbar_size=a.crossbar_size, crossbar_count=a.crossbar_count, core_count=a.core_count,
pim_merge_scheduler=a.pim_merge_scheduler,
pim_merge_scheduler=a.pim_merge_scheduler, pim_memory_report=a.pim_memory_report,
command_timeout_seconds=a.command_timeout_seconds,
threshold=a.threshold,
seed=a.seed,
+3 -1
View File
@@ -289,7 +289,7 @@ def validate_outputs(sim_arrays, runner_out_dir, outputs_descriptor, threshold=1
def validate_network(network_onnx_path, raptor_path, onnx_include_dir,
simulator_dir, crossbar_size=64, crossbar_count=8, core_count=None,
pim_merge_scheduler="peft", threshold=1e-3,
pim_merge_scheduler="peft", pim_memory_report="none", threshold=1e-3,
seed=0, reporter=None, model_index=1, model_total=1, verbose=False,
command_timeout_seconds=60.0, mode=MODE_FULL):
network_onnx_path = Path(network_onnx_path).resolve()
@@ -343,6 +343,7 @@ def validate_network(network_onnx_path, raptor_path, onnx_include_dir,
pim_pass_timings = compile_with_raptor(
network_mlir_path, raptor_path, pim_output_base, crossbar_size, crossbar_count,
core_count=core_count, pim_merge_scheduler=pim_merge_scheduler,
pim_memory_report=pim_memory_report,
cwd=raptor_dir, verbose=verbose, reporter=reporter, timeout_sec=command_timeout_seconds)
print_info(reporter, f"PIM artifacts saved to {raptor_dir / 'pim'}")
reporter.advance()
@@ -382,6 +383,7 @@ def validate_network(network_onnx_path, raptor_path, onnx_include_dir,
pim_pass_timings = compile_with_raptor(
network_mlir_path, raptor_path, pim_output_base, crossbar_size, crossbar_count,
core_count=core_count, pim_merge_scheduler=pim_merge_scheduler,
pim_memory_report=pim_memory_report,
cwd=raptor_dir, verbose=verbose, reporter=reporter, timeout_sec=command_timeout_seconds)
print_info(reporter, f"PIM artifacts saved to {raptor_dir / 'pim'}")
reporter.advance()