Revert "try using compile2.py again"

This reverts commit 914117d2e1.
This commit is contained in:
Jason Wen
2025-01-05 08:37:34 -05:00
parent b52347e7b4
commit a2e30cc7d1
+8 -7
View File
@@ -60,13 +60,14 @@ cmd = f'python3 {Dir("#selfdrive/modeld").abspath}/get_model_metadata.py {fn}.on
lenv.Command(fn + "_metadata.pkl", [fn + ".onnx"] + tinygrad_files, cmd)
# Build thneed model
pythonpath_string = 'PYTHONPATH="${PYTHONPATH}:' + env.Dir("#sunnypilot/tinygrad_repo").abspath + '"'
if arch == "larch64" or GetOption('pc_thneed'):
tinygrad_opts = []
if not GetOption('pc_thneed'):
# use FLOAT16 on device for speed + don't cache the CL kernels for space
tinygrad_opts += ["FLOAT16=1", "PYOPENCL_NO_CACHE=1"]
cmd = f'{pythonpath_string} {tinygrad_opts} python3 {Dir("#tinygrad_repo").abspath}/openpilot/compile2.py {fn}.onnx {fn}.thneed'
pythonpath_string = 'PYTHONPATH="${PYTHONPATH}:' + env.Dir("#tinygrad_repo").abspath + '"'
if arch == 'larch64':
device_string = 'QCOM=1'
else:
device_string = 'CLANG=1 IMAGE=0'
if arch == "larch64":
fn = File(f"models/supercombo").abspath
cmd = f'{pythonpath_string} {device_string} python3 {Dir("#tinygrad_repo").abspath}/examples/openpilot/compile3.py {fn}.onnx {fn}.thneed'
lenv.Command(fn + ".thneed", [fn + ".onnx"] + tinygrad_files, cmd)