diff --git a/tests/function_libs/torch_lib/ops_test_common.py b/tests/function_libs/torch_lib/ops_test_common.py index 34f5b5844..ae0578abd 100644 --- a/tests/function_libs/torch_lib/ops_test_common.py +++ b/tests/function_libs/torch_lib/ops_test_common.py @@ -8,6 +8,7 @@ import multiprocessing import os import pprint +import sys import unittest import warnings from typing import ( @@ -56,6 +57,7 @@ ) TEST_OPSET_VERSION = 18 +IS_MACOS = sys.platform.startswith("darwin") IS_WINDOWS = os.name == "nt" diff --git a/tests/function_libs/torch_lib/ops_test_data.py b/tests/function_libs/torch_lib/ops_test_data.py index b6fa826bf..cff34897d 100644 --- a/tests/function_libs/torch_lib/ops_test_data.py +++ b/tests/function_libs/torch_lib/ops_test_data.py @@ -1932,7 +1932,14 @@ def _where_input_wrangler( core_ops.aten_native_layer_norm, trace_only=True, tolerance={torch.float32: (3.7e-5, 1.8e-4), torch.float16: (1e-1, 7e-4)}, - ).skip( + ) + .xfail( + dtypes=(torch.float32,), + matcher=lambda sample: len(sample.input.shape) == 1, + enabled_if=ops_test_common.IS_MACOS and version_utils.onnxruntime_older_than("1.18"), + reason="fixme: result mismatch. https://github.com/microsoft/onnxruntime/issues/20676", + ) + .skip( dtypes=(torch.float16,), device_type="cpu", reason="native_layer_norm outputs different dtypes on CPU and CUDA. Our implematation is based on that for CUDA",