step one cleanup

pull/35809/head
Bruce Wayne 1 week ago
parent b9ca1bf2d8
commit 48d34754a1
  1. 6
      selfdrive/modeld/SConscript
  2. 5
      selfdrive/modeld/dmonitoringmodeld.py
  3. 8
      selfdrive/modeld/modeld.py

@ -50,9 +50,9 @@ def tg_compile(flags, model_name):
# Compile small models
for model_name in ['driving_vision', 'driving_policy', 'dmonitoring_model']:
flags = {
'larch64': 'QCOM=1',
'Darwin': 'CPU=1 IMAGE=0 JIT=2',
}.get(arch, 'LLVM=1 LLVMOPT=1 BEAM=0 IMAGE=0 JIT=2')
'larch64': 'DEV=QCOM',
'Darwin': 'DEV=CPU IMAGE=0 JIT=2',
}.get(arch, 'DEV=LLVM=1 LLVMOPT=1 BEAM=0 IMAGE=0 JIT=2')
tg_compile(flags, model_name)
# Compile BIG model if USB GPU is available

@ -5,9 +5,10 @@ from tinygrad.tensor import Tensor
from tinygrad.dtype import dtypes
if TICI:
from openpilot.selfdrive.modeld.runners.tinygrad_helpers import qcom_tensor_from_opencl_address
os.environ['QCOM'] = '1'
TG_DEVICE = 'QCOM'
else:
os.environ['LLVM'] = '1'
TG_DEVICE = 'LLVM'
os.environ['DEV'] = TG_DEVICE
import math
import time
import pickle

@ -3,14 +3,14 @@ import os
from openpilot.system.hardware import TICI
USBGPU = "USBGPU" in os.environ
if USBGPU:
os.environ['AMD'] = '1'
TG_DEVICE = 'AMD'
os.environ['AMD_IFACE'] = 'USB'
elif TICI:
from openpilot.selfdrive.modeld.runners.tinygrad_helpers import qcom_tensor_from_opencl_address
os.environ['QCOM'] = '1'
TG_DEVICE = 'QCOM'
else:
os.environ['LLVM'] = '1'
os.environ['JIT'] = '2'
TG_DEVICE = 'LLVM'
os.environ['DEV'] = TG_DEVICE
from tinygrad.tensor import Tensor
from tinygrad.dtype import dtypes
import time

Loading…
Cancel
Save