Skip to content

Commit 90cbb09

Browse files
tinygrad: sync tinygrad and recompile models (sunnypilot#1464)
* ref * add in the fixes * Update fetcher.py * Update helpers.py * force push same commit so we can restart CI
1 parent dd074cb commit 90cbb09

File tree

7 files changed

+10
-13
lines changed

7 files changed

+10
-13
lines changed

selfdrive/modeld/SConscript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def tg_compile(flags, model_name):
5151
for model_name in ['driving_vision', 'driving_policy', 'dmonitoring_model']:
5252
flags = {
5353
'larch64': 'DEV=QCOM',
54-
'Darwin': 'DEV=CPU IMAGE=0',
55-
}.get(arch, 'DEV=LLVM IMAGE=0')
54+
'Darwin': f'DEV=CPU HOME={os.path.expanduser("~")} IMAGE=0', # tinygrad calls brew which needs a $HOME in the env
55+
}.get(arch, 'DEV=CPU CPU_LLVM=1 IMAGE=0')
5656
tg_compile(flags, model_name)
5757

5858
# Compile BIG model if USB GPU is available

selfdrive/modeld/dmonitoringmodeld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
import os
33
from openpilot.system.hardware import TICI
4-
os.environ['DEV'] = 'QCOM' if TICI else 'LLVM'
4+
os.environ['DEV'] = 'QCOM' if TICI else 'CPU'
55
from tinygrad.tensor import Tensor
66
from tinygrad.dtype import dtypes
77
import math

selfdrive/modeld/modeld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
import os
33
from openpilot.system.hardware import TICI
4-
os.environ['DEV'] = 'QCOM' if TICI else 'LLVM'
4+
os.environ['DEV'] = 'QCOM' if TICI else 'CPU'
55
USBGPU = "USBGPU" in os.environ
66
if USBGPU:
77
os.environ['DEV'] = 'AMD'

sunnypilot/models/fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def set(self, data: dict) -> None:
116116

117117
class ModelFetcher:
118118
"""Handles fetching and caching of model data from remote source"""
119-
MODEL_URL = "https://docs.sunnypilot.ai/driving_models_v8.json"
119+
MODEL_URL = "https://raw.githubusercontent.com/sunnypilot/sunnypilot-docs/refs/heads/gh-pages/docs/driving_models_v9.json"
120120

121121
def __init__(self, params: Params):
122122
self.params = params

sunnypilot/models/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
from pathlib import Path
2020

2121
# see the README.md for more details on the model selector versioning
22-
CURRENT_SELECTOR_VERSION = 10
23-
REQUIRED_MIN_SELECTOR_VERSION = 9
22+
CURRENT_SELECTOR_VERSION = 11
23+
REQUIRED_MIN_SELECTOR_VERSION = 11
2424

2525
USE_ONNX = os.getenv('USE_ONNX', PC)
2626

sunnypilot/models/runners/model_runner.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
# Set QCOM environment variable for TICI devices, potentially enabling hardware acceleration
1515
USBGPU = "USBGPU" in os.environ
1616
if USBGPU:
17-
os.environ['AMD'] = '1'
17+
os.environ['DEV'] = 'AMD'
1818
os.environ['AMD_IFACE'] = 'USB'
19-
elif TICI:
20-
os.environ['QCOM'] = '1'
2119
else:
22-
os.environ['LLVM'] = '1'
23-
os.environ['JIT'] = '2' # TODO: This may cause issues
20+
os.environ['DEV'] = 'QCOM' if TICI else 'CPU'
2421

2522

2623
class ModelData:

tinygrad_repo

Submodule tinygrad_repo updated 279 files

0 commit comments

Comments
 (0)