|
|
|
@ -50,10 +50,14 @@ lenvCython.Program('runners/runmodel_pyx.so', 'runners/runmodel_pyx.pyx', LIBS=c |
|
|
|
|
lenvCython.Program('runners/snpemodel_pyx.so', 'runners/snpemodel_pyx.pyx', LIBS=[snpemodel_lib, snpe_lib, *cython_libs], FRAMEWORKS=frameworks, RPATH=snpe_rpath) |
|
|
|
|
lenvCython.Program('models/commonmodel_pyx.so', 'models/commonmodel_pyx.pyx', LIBS=[commonmodel_lib, *cython_libs], FRAMEWORKS=frameworks) |
|
|
|
|
|
|
|
|
|
# Get model metadata |
|
|
|
|
fn = File("models/supercombo").abspath |
|
|
|
|
cmd = f' python3 {Dir("#selfdrive/modeld").abspath}/get_model_metadata.py {fn}.onnx' |
|
|
|
|
files = sum([lenv.Glob("#"+x) for x in open(File("#release/files_common").abspath).read().split("\n") if x.endswith("get_model_metadata.py")], []) |
|
|
|
|
lenv.Command(fn + "_metadata.pkl", [fn + ".onnx"]+files, cmd) |
|
|
|
|
|
|
|
|
|
# Build thneed model |
|
|
|
|
if arch == "larch64" or GetOption('pc_thneed'): |
|
|
|
|
fn = File("models/supercombo").abspath |
|
|
|
|
|
|
|
|
|
tinygrad_opts = ["NATIVE_EXPLOG=1", "VALIDHACKS=1", "OPTLOCAL=1", "IMAGE=2", "GPU=1", "ENABLE_METHOD_CACHE=1"] |
|
|
|
|
if not GetOption('pc_thneed'): |
|
|
|
|
# use FLOAT16 on device for speed + don't cache the CL kernels for space |
|
|
|
|