From b9e6d42a1f7cadfdabc9fcd7ef977ffe3d585c4d Mon Sep 17 00:00:00 2001 From: George Hotz <72895+geohot@users.noreply.github.com> Date: Tue, 24 Sep 2024 08:48:10 +0800 Subject: [PATCH] Revert "gated native math in OpenCL (#6683)" (#6691) This reverts commit 2fe3eeed1751bc18c8cebcadf04c78f79ba5c95f. --- examples/openpilot/compile2.py | 1 - examples/openpilot/compile3.py | 1 - tinygrad/renderer/cstyle.py | 5 ----- 3 files changed, 7 deletions(-) diff --git a/examples/openpilot/compile2.py b/examples/openpilot/compile2.py index 811a5fc240..f907097a60 100644 --- a/examples/openpilot/compile2.py +++ b/examples/openpilot/compile2.py @@ -6,7 +6,6 @@ sys.path.insert(0, str(pathlib.Path(__file__).parents[1])) if "FLOAT16" not in os.environ: os.environ["FLOAT16"] = "1" if "IMAGE" not in os.environ: os.environ["IMAGE"] = "2" if "NOLOCALS" not in os.environ: os.environ["NOLOCALS"] = "1" -if "NATIVE_MATH" not in os.environ: os.environ["NATIVE_MATH"] = "1" OPENPILOT_MODEL = "https://github.com/commaai/openpilot/raw/v0.9.4/selfdrive/modeld/models/supercombo.onnx" diff --git a/examples/openpilot/compile3.py b/examples/openpilot/compile3.py index 5dbefc8398..a04c3c2652 100644 --- a/examples/openpilot/compile3.py +++ b/examples/openpilot/compile3.py @@ -3,7 +3,6 @@ import numpy as np if "FLOAT16" not in os.environ: os.environ["FLOAT16"] = "1" if "IMAGE" not in os.environ: os.environ["IMAGE"] = "2" if "NOLOCALS" not in os.environ: os.environ["NOLOCALS"] = "1" -if "NATIVE_MATH" not in os.environ: os.environ["NATIVE_MATH"] = "1" from tinygrad import fetch, Tensor, TinyJit, Device, Context, GlobalCounters from tinygrad.helpers import OSX, DEBUG, Timing diff --git a/tinygrad/renderer/cstyle.py b/tinygrad/renderer/cstyle.py index fe58b95d24..f746d032a0 100644 --- a/tinygrad/renderer/cstyle.py +++ b/tinygrad/renderer/cstyle.py @@ -227,11 +227,6 @@ class ClangRenderer(CStyleLanguage): class OpenCLRenderer(CStyleLanguage): device = "GPU" - code_for_op = {**CStyleLanguage().code_for_op, - #UnaryOps.SQRT: lambda x,dtype: f"native_sqrt({x})", UnaryOps.RECIP: lambda x,dtype: f"native_recip({x})", - #UnaryOps.EXP2: lambda x,dtype: f"native_exp2({x})", UnaryOps.LOG2: lambda x,dtype: f"native_log2({x})", - UnaryOps.SIN: lambda x,dtype: f"native_sin({x})"} if getenv("NATIVE_MATH") else CStyleLanguage().code_for_op - # language options kernel_prefix = "__kernel " buffer_prefix = "__global "