add METAL_FAST_MATH env var to disable metal fast math (#3369)

* env var METAL_FAST_MATH to disable fastmath for metal

use this to test impact of fast math. might need to disable compiler cache with DISABLE_COMPILER_CACHE

* failed onnx test with fast math

METAL_FAST_MATH=0 DISABLE_COMPILER_CACHE=1 NOOPT=1 python -m pytest -n=auto test/external/external_test_onnx_backend.py -k test_MaxPool3d_stride_padding_cpu
This commit is contained in:
chenyu
2024-02-11 04:26:09 -05:00
committed by GitHub
parent 1156a27619
commit f798b60338
2 changed files with 5 additions and 0 deletions

View File

@@ -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')