onnxruntime/onnxruntime/test/common
Wei-Sheng Chin 1524f73a09
Implement two easier random tensor generator (RTG) for flaky tests (#15517)
Some math ops have very bad numerical stability and essential randomness
(e.g., exp/log with reduction on large elements). To maintain the same
test coverage with lower CI failing rate, we can gradually replace flaky
tests' RTG with the ones implemented in this PR --- try Discrete first.
If still unstable, use Circular.

Overall recommended strategy to handle flaky test
- Find if it uses `Uniform` in
`onnxruntime/test/common/tensor_op_test_utils.h`. If yes, replace
`Uniform` with `Discrete` implemented in this PR. For
`candidate_values`, we can try `[-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5,
2]`, `[-2, -1, 0, 1, 2]`, `[-1, 0, 1]`, and `[0, 1]` and choose the most
difficult one among those passing 100 runs.
- If `Discrete` fails to meet the stability requirement, switch to
`Circular` and repeat the `candidate_values` selection process.

Let's keep an eye on the two bugs mentioned in
https://github.com/microsoft/onnxruntime/pull/15515. If the related unit
tests fail again, we can replace the underlying
`RandomValueGenerator::Uniform` with
`FixedPatternValueGenerator::Descrete` or
`FixedPatternValueGenerator::Circular` implemented in this PR.
2023-04-25 17:52:44 -07:00
..
logging Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
cuda_op_test_utils.h Fix CUDA tests for Ampere cards, and bump layernorm tests opset version (#14761) 2023-03-17 09:30:01 -07:00
denormal_test.cc
dnnl_op_test_utils.cc Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
dnnl_op_test_utils.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
narrow_test.cc
path_test.cc
quantization_test_utils.h
random_generator_test.cc Implement two easier random tensor generator (RTG) for flaky tests (#15517) 2023-04-25 17:52:44 -07:00
span_utils_test.cc Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
string_utils_test.cc
tensor_op_test_utils.cc Implement two easier random tensor generator (RTG) for flaky tests (#15517) 2023-04-25 17:52:44 -07:00
tensor_op_test_utils.h Implement two easier random tensor generator (RTG) for flaky tests (#15517) 2023-04-25 17:52:44 -07:00
utf8_util_test.cc