rework actually broken dcp merge + compute re-batching (still to refine)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import argparse
|
||||
import json
|
||||
import numpy as np
|
||||
import subprocess
|
||||
@@ -258,7 +257,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, threshold=1e-3,
|
||||
simulator_dir, crossbar_size=64, crossbar_count=8, core_count=None, threshold=1e-3,
|
||||
reporter=None, model_index=1, model_total=1):
|
||||
network_onnx_path = Path(network_onnx_path).resolve()
|
||||
raptor_path = Path(raptor_path).resolve()
|
||||
@@ -313,7 +312,7 @@ def validate_network(network_onnx_path, raptor_path, onnx_include_dir,
|
||||
print_stage(reporter, model_index, model_total, network_onnx_path.name, "Compile PIM")
|
||||
pim_pass_timings = compile_with_raptor(
|
||||
network_mlir_path, raptor_path, raptor_dir / network_onnx_path.stem,
|
||||
crossbar_size, crossbar_count,
|
||||
crossbar_size, crossbar_count, core_count=core_count,
|
||||
cwd=raptor_dir, reporter=reporter)
|
||||
print_info(reporter, f"PIM artifacts saved to {raptor_dir / 'pim'}")
|
||||
reporter.advance()
|
||||
@@ -350,18 +349,3 @@ def validate_network(network_onnx_path, raptor_path, onnx_include_dir,
|
||||
reporter.log("=" * 72)
|
||||
if owns_reporter:
|
||||
reporter.finish()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--network-onnx", required=True)
|
||||
ap.add_argument("--raptor-path", required=True)
|
||||
ap.add_argument("--onnx-include-dir", required=True)
|
||||
a = ap.parse_args()
|
||||
|
||||
simulator_dir = Path(__file__).parent.resolve() / ".." / "backend-simulators" / "pim" / "pim-simulator"
|
||||
|
||||
passed = validate_network(
|
||||
a.network_onnx, a.raptor_path, a.onnx_include_dir, simulator_dir
|
||||
)
|
||||
raise SystemExit(0 if passed.passed else 1)
|
||||
|
||||
Reference in New Issue
Block a user