mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
Change Jave Test Threshold (#19508)
### Description Increase the threshold to 1e-5 to avoid test failed in CUDA when difference is slightly larger than 1e-6. May because TF32 is used in those CUDA tests. ### Motivation and Context https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1291322&view=logs&j=f2f63060-d9d6-52d0-adee-b97db5a9ab91&t=28e21ca6-87a4-5e1e-0441-72b5e8326f2d ProviderOptionsTest > testCUDAOptions() FAILED org.opentest4j.AssertionFailedError: array contents differ at index [103], expected: <0.0102678> but was: <0.010266338> at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at app//org.junit.jupiter.api.AssertArrayEquals.failArraysNotEqual(AssertArrayEquals.java:440) at app//org.junit.jupiter.api.AssertArrayEquals.assertArrayEquals(AssertArrayEquals.java:290) at app//org.junit.jupiter.api.AssertArrayEquals.assertArrayEquals(AssertArrayEquals.java:123) at app//org.junit.jupiter.api.AssertArrayEquals.assertArrayEquals(AssertArrayEquals.java:119) at app//org.junit.jupiter.api.Assertions.assertArrayEquals(Assertions.java:1360) at app//ai.onnxruntime.providers.ProviderOptionsTest.runProvider(ProviderOptionsTest.java:99) at app//ai.onnxruntime.providers.ProviderOptionsTest.testCUDAOptions(ProviderOptionsTest.java:43) https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1293200&view=logs&jobId=f2f63060-d9d6-52d0-adee-b97db5a9ab91&j=f2f63060-d9d6-52d0-adee-b97db5a9ab91&t=28e21ca6-87a4-5e1e-0441-72b5e8326f2d InferenceTest > testCUDA() FAILED org.opentest4j.AssertionFailedError: array contents differ at index [103], expected: <0.0102678> but was: <0.010266337> at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at app//org.junit.jupiter.api.AssertArrayEquals.failArraysNotEqual(AssertArrayEquals.java:440) at app//org.junit.jupiter.api.AssertArrayEquals.assertArrayEquals(AssertArrayEquals.java:290) at app//org.junit.jupiter.api.AssertArrayEquals.assertArrayEquals(AssertArrayEquals.java:123) at app//org.junit.jupiter.api.AssertArrayEquals.assertArrayEquals(AssertArrayEquals.java:119) at app//org.junit.jupiter.api.Assertions.assertArrayEquals(Assertions.java:1360) at app//ai.onnxruntime.InferenceTest.runProvider(InferenceTest.java:676) at app//ai.onnxruntime.InferenceTest.testCUDA(InferenceTest.java:615)
This commit is contained in:
parent
f53d2c2465
commit
fbff99a432
2 changed files with 2 additions and 2 deletions
|
|
@ -673,7 +673,7 @@ public class InferenceTest {
|
|||
// CoreML gives slightly different answers on a 2020 13" M1 MBP
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-2f);
|
||||
} else {
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-6f);
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-5f);
|
||||
}
|
||||
} catch (OrtException e) {
|
||||
throw new IllegalStateException("Failed to execute a scoring operation", e);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public class ProviderOptionsTest {
|
|||
OnnxValue resultTensor = result.get(0);
|
||||
float[] resultArray = TestHelpers.flattenFloat(resultTensor.getValue());
|
||||
assertEquals(expectedOutput.length, resultArray.length);
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-6f);
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-5f);
|
||||
} catch (OrtException e) {
|
||||
throw new IllegalStateException("Failed to execute a scoring operation", e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue