Skip to content

Commit bc83644

Browse files
committed
small fixes
1 parent b202370 commit bc83644

2 files changed

Lines changed: 1 addition & 33 deletions

File tree

selfdrive/modeld/SConscript

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ def get_camera_configs():
1919
"tizi": (_ar_ox_fisheye.width, _ar_ox_fisheye.height),
2020
"mici": (_os_fisheye.width, _os_fisheye.height),
2121
}
22-
if release or PC or 'CI' in os.environ:
23-
return set(DEVICE_RESOLUTIONS.values())
2422
return [DEVICE_RESOLUTIONS[HARDWARE.get_device_type()]]
2523

2624
CAMERA_CONFIGS = get_camera_configs()
@@ -48,7 +46,7 @@ if 'CUDA' in available:
4846
tg_flags = f'DEV={tg_backend}'
4947
elif 'QCOM' in available:
5048
tg_backend = 'QCOM'
51-
tg_flags = f'DEV={tg_backend} IMAGE=1 FLOAT16=1 NOLOCALS=1 JIT_BATCH_SIZE=0 OPENPILOT_HACKS=1'
49+
tg_flags = f'DEV={tg_backend} IMAGE=1 FLOAT16=1 JIT_BATCH_SIZE=0 OPENPILOT_HACKS=1'
5250
else:
5351
tg_backend = 'CPU'
5452
tg_flags = f'DEV=CPU' if arch == 'Darwin' else 'DEV=CPU:LLVM'

selfdrive/modeld/compile_modeld.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,6 @@ def fetch_fw(path, name, sha256):
4040

4141
WARP_DEV = os.getenv('WARP_DEV')
4242

43-
_ORIG_TINYGRAD_OPTIMIZE_LOCAL_SIZE = None
44-
45-
46-
def _optimize_local_size_or_skip(call, prg):
47-
try:
48-
return _ORIG_TINYGRAD_OPTIMIZE_LOCAL_SIZE(call, prg)
49-
except AssertionError as e:
50-
if str(e) != "all optimize_local_size exec failed":
51-
raise
52-
from dataclasses import replace
53-
preferred = (32, 16, 1)
54-
local_size = tuple(next(x for x in range(min(preferred[i] if i < len(preferred) else 1, g), 0, -1) if g % x == 0)
55-
for i, g in enumerate(prg.arg.global_size))
56-
new_global = tuple(g//l if g % l == 0 else g/l for g, l in zip(prg.arg.global_size, local_size, strict=True))
57-
return call.replace(src=(prg.replace(arg=replace(prg.arg, global_size=new_global, local_size=local_size)), *call.src[1:]))
58-
59-
60-
def _patch_tinygrad_local_size_optimizer():
61-
global _ORIG_TINYGRAD_OPTIMIZE_LOCAL_SIZE
62-
from tinygrad.engine import realize
63-
from tinygrad.uop.ops import Ops, PatternMatcher, UPat
64-
65-
_ORIG_TINYGRAD_OPTIMIZE_LOCAL_SIZE = realize.optimize_local_size
66-
realize.pm_optimize_local_size = PatternMatcher([
67-
(UPat(Ops.CALL, src=(UPat(Ops.PROGRAM, name="prg"),), name="call", allow_any_len=True), _optimize_local_size_or_skip),
68-
])
69-
70-
71-
_patch_tinygrad_local_size_optimizer()
72-
7343

7444
def make_camera_vars(camera_configs: list[NV12Frame]):
7545
max_cam_w = max(nv12.width for nv12 in camera_configs)

0 commit comments

Comments
 (0)