From 8435d2d23bde3328a797c597557bb63abc102c5a Mon Sep 17 00:00:00 2001 From: Sieds Lykles <93992551+S-Lykles@users.noreply.github.com> Date: Sat, 6 Sep 2025 00:05:45 +0200 Subject: [PATCH] fix openpilot speed regeression (#12039) * set local_size=None if special.arg[0]=='i' * add cast back --- tinygrad/renderer/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinygrad/renderer/__init__.py b/tinygrad/renderer/__init__.py index 22660bc80d..371b96c138 100644 --- a/tinygrad/renderer/__init__.py +++ b/tinygrad/renderer/__init__.py @@ -82,9 +82,9 @@ class ProgramSpec: if u.op is Ops.LOAD: self.ins.extend([x.arg for x in u.src[0].toposort() if x.op is Ops.DEFINE_GLOBAL]) if u.op is Ops.SPECIAL: # NOTE: you have to set local_size and global_size to the base [1,1,1] outside this + if u.arg[0] == 'i': self.local_size = None special_size = self.local_size if u.arg[0] == 'l' else self.global_size - assert special_size is not None, f"special_size is None but found SPECIAL in uops {u}" - special_size[int(u.arg[-1])] = cast(int, u.src[0].ssimplify()) # TODO: the type here should be sint + if special_size is not None: special_size[int(u.arg[-1])] = cast(int, u.src[0].ssimplify()) self.vars = sorted(self.vars, key=lambda v: v.arg) self.outs = sorted(dedup(self.outs)) self.ins = sorted(dedup(self.ins))