add osx stuff back

This commit is contained in:
Bruce Wayne 2024-11-12 16:59:44 -08:00
parent ad119af6a5
commit 9b3e6bebf2
1 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ if "NOLOCALS" not in os.environ: os.environ["NOLOCALS"] = "1"
if "JIT_BATCH_SIZE" not in os.environ: os.environ["JIT_BATCH_SIZE"] = "0"
from tinygrad import fetch, Tensor, TinyJit, Context, GlobalCounters
from tinygrad.helpers import DEBUG, getenv
from tinygrad.helpers import OSX, DEBUG, getenv
from tinygrad.tensor import _from_np_dtype
import onnx
@ -18,10 +18,10 @@ OUTPUT = sys.argv[2] if len(sys.argv) > 2 else "/tmp/openpilot.pkl"
def compile():
# hack to fix GPU on OSX: max doesn't work on half, see test/external/external_gpu_fail_osx.py
#if OSX:
# from tinygrad.ops import BinaryOps
# from tinygrad.renderer.cstyle import ClangRenderer, CStyleLanguage
# CStyleLanguage.code_for_op[BinaryOps.MAX] = ClangRenderer.code_for_op[BinaryOps.MAX]
if OSX:
from tinygrad.ops import BinaryOps
from tinygrad.renderer.cstyle import ClangRenderer, CStyleLanguage
CStyleLanguage.code_for_op[BinaryOps.MAX] = ClangRenderer.code_for_op[BinaryOps.MAX]
Tensor.no_grad = True
Tensor.training = False