From 5bc65ec669b06de9adbbe5abc3c89099f137818c Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Thu, 19 Feb 2026 12:08:26 +0800 Subject: [PATCH] applied_opts/estimates in program spec are aliases for the sink arg (#14860) * remove applied_opts from programspec * comment that out * placement * update tests * p.ast.arg * remove todo comment * maybe this too * it can exist as an alias, also for estimates --- tinygrad/renderer/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tinygrad/renderer/__init__.py b/tinygrad/renderer/__init__.py index 28b9f800e7..1778efa4fe 100644 --- a/tinygrad/renderer/__init__.py +++ b/tinygrad/renderer/__init__.py @@ -80,7 +80,7 @@ class ProgramSpec: ins:list[int]=field(default_factory=list) @property - def estimates(self) -> Estimates: return self.ast.arg.estimates + def estimates(self) -> Estimates: return self.ast.arg.estimates if self.ast.arg is not None and self.ast.arg.estimates is not None else Estimates() @functools.cached_property def function_name(self) -> str: return to_function_name(self.name) @@ -89,10 +89,7 @@ class ProgramSpec: def runtimevars(self) -> dict[str, int]: return {v.arg[0]: i for i, v in enumerate(self.vars) if v.arg[0] == 'core_id'} @property - def applied_opts(self) -> tuple[Opt, ...]|None: - if self.uops is None: return None - assert self.uops[-1].op is Ops.SINK, self.uops[-1].op - return self.uops[-1].arg.applied_opts + def applied_opts(self) -> tuple[Opt, ...]|None: return self.ast.arg.applied_opts if self.ast.arg is not None else None def launch_dims(self, var_vals:dict[str, int]): global_size = [sym_infer(sz, var_vals) for sz in self.global_size]