From 367fbabc3063757eefc4b02a591fa785c3d0ce11 Mon Sep 17 00:00:00 2001 From: Sieds Lykles <93992551+S-Lykles@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:19:42 +0200 Subject: [PATCH] remove Ops.SUBSTITUTE (#12827) * remove Ops.SUBSTITUTE * remove from viz --- tinygrad/uop/__init__.py | 1 - tinygrad/uop/ops.py | 2 +- tinygrad/uop/spec.py | 3 --- tinygrad/viz/serve.py | 3 +-- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tinygrad/uop/__init__.py b/tinygrad/uop/__init__.py index fcb62cd1f3..f6130bc6e4 100644 --- a/tinygrad/uop/__init__.py +++ b/tinygrad/uop/__init__.py @@ -20,7 +20,6 @@ class Ops(FastEnum): # create buffer BUFFERIZE = auto() - SUBSTITUTE = auto() # ops that adjust the behavior of the scheduler CONTIGUOUS = auto(); CONTIGUOUS_BACKWARD = auto(); DETACH = auto(); FUSE = auto() # noqa: E702 diff --git a/tinygrad/uop/ops.py b/tinygrad/uop/ops.py index b08c193f9c..e8be4f0fe6 100644 --- a/tinygrad/uop/ops.py +++ b/tinygrad/uop/ops.py @@ -179,7 +179,7 @@ class UOp(MathTrait, metaclass=UOpMetaClass): match self.op: # late ops don't have shape case Ops.UNIQUE | Ops.DEVICE | Ops.RANGE | Ops.INDEX | Ops.LOAD | Ops.IF | Ops.BARRIER | Ops.CUSTOM | Ops.CUSTOMI | \ - Ops.VECTORIZE | Ops.VCONST | Ops.SUBSTITUTE | Ops.GEP | Ops.SPECIAL | Ops.UNROLL | Ops.PRECAST: + Ops.VECTORIZE | Ops.VCONST | Ops.GEP | Ops.SPECIAL | Ops.UNROLL | Ops.PRECAST: return None # some ops init the shape diff --git a/tinygrad/uop/spec.py b/tinygrad/uop/spec.py index 667936cb49..86e0e398be 100644 --- a/tinygrad/uop/spec.py +++ b/tinygrad/uop/spec.py @@ -236,9 +236,6 @@ full_spec = PatternMatcher([ # SENTINEL should never be in the graph (UPat(Ops.SENTINEL), lambda: False), - # allow any SUBSTITUTE - (UPat(Ops.SUBSTITUTE), lambda: True), - # Invalid must have type Index (UPat(Ops.CONST, arg=Invalid, name="x"), lambda x: x.dtype.scalar() == dtypes.index), # where on index in rhs position is fine diff --git a/tinygrad/viz/serve.py b/tinygrad/viz/serve.py index 827d672509..592304116c 100755 --- a/tinygrad/viz/serve.py +++ b/tinygrad/viz/serve.py @@ -20,8 +20,7 @@ uops_colors = {Ops.LOAD: "#ffc0c0", Ops.STORE: "#87CEEB", Ops.CONST: "#e0e0e0", **{x:"#D8F9E4" for x in GroupOp.Movement}, **{x:"#ffffc0" for x in GroupOp.ALU}, Ops.THREEFRY:"#ffff80", Ops.BUFFER_VIEW: "#E5EAFF", Ops.BLOCK: "#C4A484", Ops.BLOCKEND: "#C4A4A4", Ops.BUFFER: "#B0BDFF", Ops.COPY: "#a040a0", Ops.FUSE: "#FFa500", Ops.ALLREDUCE: "#ff40a0", Ops.MSELECT: "#d040a0", Ops.MSTACK: "#d040a0", Ops.CONTIGUOUS: "#FFC14D", - Ops.BUFFERIZE: "#FF991C", Ops.REWRITE_ERROR: "#ff2e2e", Ops.SUBSTITUTE: "#ffff00", Ops.AFTER: "#8A7866", - Ops.END: "#524C46"} + Ops.BUFFERIZE: "#FF991C", Ops.REWRITE_ERROR: "#ff2e2e", Ops.AFTER: "#8A7866", Ops.END: "#524C46"} # VIZ API