diff --git a/test/external/external_test_onnx_backend.py b/test/external/external_test_onnx_backend.py index 7130d4b85a..d8b8890079 100644 --- a/test/external/external_test_onnx_backend.py +++ b/test/external/external_test_onnx_backend.py @@ -172,6 +172,10 @@ if Device.DEFAULT == "METAL" or (OSX and Device.DEFAULT == "GPU"): backend_test.exclude('test_mish_cpu') backend_test.exclude('test_mish_expanded_cpu') +if Device.DEFAULT == 'METAL': + # with default fast math enabled, padding -inf does not work + backend_test.exclude('test_MaxPool3d_stride_padding_cpu') + # TODO: llvm has problems with inf if Device.DEFAULT in ['LLVM']: backend_test.exclude('test_isinf_cpu') diff --git a/tinygrad/runtime/ops_metal.py b/tinygrad/runtime/ops_metal.py index f20173a873..03e71b2b22 100644 --- a/tinygrad/runtime/ops_metal.py +++ b/tinygrad/runtime/ops_metal.py @@ -20,6 +20,7 @@ class MetalCompiler(Compiler): return subprocess.check_output(['xcrun', '-sdk', 'macosx', 'metallib', '-', '-o', '-'], input=air) else: options = Metal.MTLCompileOptions.new() + options.setFastMathEnabled_(getenv("METAL_FAST_MATH", 1)) library = unwrap2(self.device.device.newLibraryWithSource_options_error_(src, options, None)) return library.libraryDataContents().bytes().tobytes()