mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
Tinygrad: use compile2 (#30400)
* Tinygrad: use compile2 * unused * compile2 file * slightly different * Revert "slightly different" This reverts commit 8a470ecab40c295f3b8c777b82cb7a22890d116e. * slightly different ref * add release file * rm default args old-commit-hash: c9fae805bc53e732109fb9e5c36d9674deed0475
This commit is contained in:
@@ -58,11 +58,11 @@ lenv.Command(fn + "_metadata.pkl", [fn + ".onnx"]+files, cmd)
|
||||
|
||||
# Build thneed model
|
||||
if arch == "larch64" or GetOption('pc_thneed'):
|
||||
tinygrad_opts = ["NOLOCALS=1", "IMAGE=2", "GPU=1"]
|
||||
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"cd {Dir('#').abspath}/tinygrad_repo && " + ' '.join(tinygrad_opts) + f" python3 openpilot/compile.py {fn}.onnx {fn}.thneed"
|
||||
cmd = f"cd {Dir('#').abspath}/tinygrad_repo && " + ' '.join(tinygrad_opts) + f" python3 openpilot/compile2.py {fn}.onnx {fn}.thneed"
|
||||
|
||||
tinygrad_files = sum([lenv.Glob("#"+x) for x in open(File("#release/files_common").abspath).read().split("\n") if x.startswith("tinygrad_repo/")], [])
|
||||
lenv.Command(fn + ".thneed", [fn + ".onnx"] + tinygrad_files, cmd)
|
||||
|
||||
Reference in New Issue
Block a user