mirror of https://github.com/commaai/tinygrad.git
add osx stuff back
This commit is contained in:
parent
ad119af6a5
commit
9b3e6bebf2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue