add automatic validation process wit pim simulator

This commit is contained in:
NiccoloN
2026-02-25 09:44:42 +01:00
parent a6e928bdd7
commit 9a7168e7b6
7 changed files with 644 additions and 1 deletions

29
validation/raptor.py Normal file
View File

@@ -0,0 +1,29 @@
import subprocess
from pathlib import Path
from colorama import Fore, Style
def compile_with_raptor(network_path, raptor_onnx_path: Path, crossbar_size=64, crossbar_count=16):
# Define the arguments, with the possibility to set crossbar size and count
args = [
network_path,
"--maccel=PIM",
"--EmitPIMJSON",
"--EmitPimCodegen",
# "--use-experimental-conv-impl=true",
f"--crossbar-size={crossbar_size}",
f"--crossbar-count={crossbar_count}",
]
# Run the executable with the arguments
try:
result = subprocess.run(
[str(raptor_onnx_path)] + [str(arg) for arg in args],
check=True,
capture_output=True,
text=True,
)
print(result.stdout + Fore.GREEN + "Raptor execution successful" + Style.RESET_ALL)
except subprocess.CalledProcessError as e:
print(Fore.RED + "Error executing ONNX-MLIR:")
print(e.stderr + Style.RESET_ALL)