add constant folding and verification pass for pim host operations
better validation scripts output big refactors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user