add constant folding and verification pass for pim host operations

better validation scripts output
big refactors
This commit is contained in:
NiccoloN
2026-03-20 12:08:12 +01:00
parent 4e50e056e3
commit 6e1de865bb
64 changed files with 1364 additions and 2265 deletions

View File

@@ -1,9 +1,10 @@
import subprocess
from pathlib import Path
from colorama import Fore, Style
from subprocess_utils import run_command_with_reporter
def compile_with_raptor(network_path, raptor_onnx_path: Path, crossbar_size, crossbar_count):
def compile_with_raptor(network_path, raptor_onnx_path: Path, crossbar_size, crossbar_count, reporter=None):
# Define the arguments, with the possibility to set crossbar size and count
args = [
network_path,
@@ -14,16 +15,14 @@ def compile_with_raptor(network_path, raptor_onnx_path: Path, crossbar_size, cro
f"--crossbar-count={crossbar_count}",
]
# Run the executable with the arguments
try:
result = subprocess.run(
run_command_with_reporter(
[str(raptor_onnx_path)] + [str(arg) for arg in args],
check=True,
capture_output=True,
text=True,
reporter=reporter,
)
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)
if reporter is None:
print(Fore.GREEN + "Raptor execution successful" + Style.RESET_ALL)
except subprocess.CalledProcessError:
if reporter is None:
print(Fore.RED + "Raptor execution failed" + Style.RESET_ALL)
raise