diff --git a/.ci/docker/common/install_onnx.sh b/.ci/docker/common/install_onnx.sh index bc844ea1d40..f9502dc3550 100644 --- a/.ci/docker/common/install_onnx.sh +++ b/.ci/docker/common/install_onnx.sh @@ -16,7 +16,7 @@ pip_install \ onnx==1.14.0 pip_install \ - onnxruntime==1.14.0 \ + onnxruntime==1.15.0 \ parameterized==0.8.1 \ pytest-cov==4.0.0 \ pytest-subtests==0.10.0 \ diff --git a/test/onnx/test_fx_op_consistency.py b/test/onnx/test_fx_op_consistency.py index 828c22dc530..70f00ecde79 100644 --- a/test/onnx/test_fx_op_consistency.py +++ b/test/onnx/test_fx_op_consistency.py @@ -406,21 +406,6 @@ EXPECTED_SKIPS_OR_FAILS: Tuple[onnx_test_common.DecorateMeta, ...] = ( dtypes=(torch.uint8, torch.int8, torch.int16,), reason=onnx_test_common.reason_onnx_script_does_not_support("Add", "int8, int16"), ), - xfail( - "new_full", - dtypes=onnx_test_common.BOOL_TYPES + onnx_test_common.INT_TYPES + onnx_test_common.FLOAT_TYPES, - reason=onnx_test_common.reason_onnx_runtime_does_not_support("new_full", "ORT 1.15 will support"), - ), - xfail( - "new_ones", - dtypes=onnx_test_common.BOOL_TYPES + onnx_test_common.INT_TYPES + onnx_test_common.FLOAT_TYPES, - reason=onnx_test_common.reason_onnx_runtime_does_not_support("new_ones", "ORT 1.15 will support"), - ), - xfail( - "new_zeros", - dtypes=onnx_test_common.BOOL_TYPES + onnx_test_common.INT_TYPES + onnx_test_common.FLOAT_TYPES, - reason=onnx_test_common.reason_onnx_runtime_does_not_support("new_zeros", "ORT 1.15 will support"), - ), xfail( "nn.functional.adaptive_avg_pool1d", reason=onnx_test_common.reason_onnx_script_does_not_support("aten.mean.dim"), diff --git a/test/onnx/test_op_consistency.py b/test/onnx/test_op_consistency.py index 8a0bc79e485..e90a00ef6ee 100644 --- a/test/onnx/test_op_consistency.py +++ b/test/onnx/test_op_consistency.py @@ -100,6 +100,8 @@ EXPECTED_SKIPS_OR_FAILS: Tuple[onnx_test_common.DecorateMeta, ...] = ( skip("nn.functional.scaled_dot_product_attention", reason="fixme: ORT crashes on Windows, segfaults randomly on Linux"), skip("sqrt", dtypes=onnx_test_common.BOOL_TYPES, reason=onnx_test_common.reason_onnx_does_not_support("Sqrt")), skip("stft", opsets=[onnx_test_common.opsets_before(17)], reason=onnx_test_common.reason_onnx_does_not_support("STFT")), + xfail("stft", + reason=onnx_test_common.reason_onnx_runtime_does_not_support("STFT", "Regression on ORT=1.15 4 percent difference")), skip("tile", opsets=[onnx_test_common.opsets_before(13)], reason=onnx_test_common.reason_onnx_does_not_support("Tile")), xfail("unflatten", opsets=[onnx_test_common.opsets_before(13)], reason="Helper function is needed to support legacy ops."), ) diff --git a/test/onnx/test_pytorch_onnx_onnxruntime.py b/test/onnx/test_pytorch_onnx_onnxruntime.py index bd51519c79d..b774822f233 100644 --- a/test/onnx/test_pytorch_onnx_onnxruntime.py +++ b/test/onnx/test_pytorch_onnx_onnxruntime.py @@ -650,15 +650,7 @@ class TestONNXRuntime(onnx_test_common._TestONNXRuntime): self.run_test(model, (x, y, z), input_names=("x", "y", "z")) self.run_test(model, (x,), {"y": y, "z": z}, input_names=("x", "y", "z")) - - # Requires input_names to be set so that we can feed the inputs properly into ORT. - # TODO: Export default values as ONNX initializers, then this should not raise. - # https://msdata.visualstudio.com/Vienna/_workitems/edit/969268 - # Default values are accessible via FunctionSchema. - with self.assertRaisesRegex( - ValueError, "Model requires 3 inputs. Input Feed contains 2" - ): - self.run_test(model, (x,), {"y": y}, input_names=("x", "y")) + self.run_test(model, (x,), {"y": y}, input_names=("x", "y")) for example_inputs, example_kwargs in ( ((x, y, None), {}), @@ -742,14 +734,13 @@ class TestONNXRuntime(onnx_test_common._TestONNXRuntime): y = torch.randn(2, 3) model = torch.jit.script(Model()) - # TODO: Export default values as ONNX initializers, then this should not raise. - # https://msdata.visualstudio.com/Vienna/_workitems/edit/969268 - # Default values are accessible via FunctionSchema. - with self.assertRaisesRegex( - ValueError, "Model requires 2 inputs. Input Feed contains 1" - ): - self.run_test(model, (x,)) - self.run_test(model, (), {"y": y}) + # Optional supports None inputs + self.run_test(model, (x,)) + # NOTE: default value is not supported on ONNX, so torch and ONNX has + # different behavior + with self.assertRaisesRegex(AssertionError, "Tensor-likes are not close!"): + self.run_test(model, (), {"y": y}, input_names=["y"]) + self.run_test(model, (x, y)) self.run_test(model, (), {"x": x, "y": y}, input_names=("x", "y"))