This commit is contained in:
Jason Wen
2025-01-05 07:59:18 -05:00
parent 75d338f2bd
commit 23dd423e78

View File

@@ -62,10 +62,10 @@ 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 = []
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"]
tinygrad_opts = 'FLOAT16=1 PYOPENCL_NO_CACHE=1'
cmd = f'{pythonpath_string} {tinygrad_opts} python3 {Dir("#sunnypilot/tinygrad_repo").abspath}/openpilot/compile2.py {fn}.onnx {fn}.thneed'
lenv.Command(fn + ".thneed", [fn + ".onnx"] + tinygrad_files, cmd)