-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support per-test tolerances for ONNX tests #11775
Conversation
Prior to this every test shared the same global tolerances. This meant that if an ONNX test failed due to a small but acceptable difference in output, the only alternative was to disable the test entirely. In op set 17, the DFT operator is being added. Without this change, the tests for that operator fail because the output is off by about 5e-5. It's better to keep test coverage for this new op rather than disable the test entirely. Also prior to this change, the global tolerances were not shared between JavaScript and Python tests. Now they are. Unblocks microsoft#11640.
|
||
import onnxruntime.backend as c2 | ||
from onnxruntime import backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why this is causing this check to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proposing per-test tolerances! The document improvement looks good to me. It would be better to get other experts' approvals about the Python/JavaScript part. Going forward with this PR, perhaps in the future we can go through the whole skip list for ONNX node tests and enable some of them with specific tolerances if reasonable.
please fix the build errors of code formatting and ESLint by running the following commands under <ORT_ROOT>/js/ : npm ci
npm run format
npm run lint |
This pull request introduces 107 alerts when merging bec5a0d into 5ecfaef - view on LGTM.com new alerts:
|
This pull request introduces 129 alerts when merging 5d4b8f6 into 5562b47 - view on LGTM.com new alerts:
|
This pull request introduces 129 alerts when merging ccafd94 into 0869f4f - view on LGTM.com new alerts:
|
This pull request introduces 129 alerts when merging bc78ae7 into a93ebd2 - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. It would be great if this PR can get approvals from ORT Core team and ORT Web team respectively.
onnxruntime/test/onnx/main.cc
Outdated
static const ORTCHAR_T* x86_disabled_tests[] = {ORT_TSTR("mlperf_ssd_resnet34_1200"), ORT_TSTR("mask_rcnn_keras"), ORT_TSTR("mask_rcnn"), ORT_TSTR("faster_rcnn"), ORT_TSTR("vgg19"), ORT_TSTR("coreml_VGG16_ImageNet")}; | ||
all_disabled_tests.insert(std::begin(x86_disabled_tests), std::end(x86_disabled_tests)); | ||
#endif | ||
|
||
const TestTolerances tt = LoadTestTolerances(enable_cuda, enable_openvino); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inlined it instead.
@@ -173,8 +173,6 @@ std::string GetTestDataPath() { | |||
static std::vector<ITestCase*> GetAllTestCases() { | |||
std::vector<ITestCase*> tests; | |||
std::vector<std::basic_string<PATH_CHAR_TYPE>> whitelistedTestCases; | |||
double perSampleTolerance = 1e-3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm not sure what you're asking me to do. Could you please elaborate?
LGTM. As soon as checks pass I can sign off. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signed off for typescript files (/js/node/**)
This pull request introduces 129 alerts when merging d498d52 into 52f6db1 - view on LGTM.com new alerts:
|
@yuslepukhin all checks passed so I'll merge now. If there are any changes you'd like to see, feel free to comment and I'll open another PR. |
This is required on CentOS 7 if using distro-provided json-devel 3.6.1. Regression introduced in: - microsoft#11775 Related upstream commit: - nlohmann/json@74520d8 Fixed microsoft#12393
This is required on CentOS 7 if using distro-provided json-devel 3.6.1. Regression introduced in: - microsoft#11775 Related upstream commit: - nlohmann/json@74520d8 Fixed microsoft#12393
This is required on CentOS 7 if using distro-provided json-devel 3.6.1. Regression introduced in: - #11775 Related upstream commit: - nlohmann/json@74520d8 Fixed #12393
This is required on CentOS 7 if using distro-provided json-devel 3.6.1. Regression introduced in: - microsoft#11775 Related upstream commit: - nlohmann/json@74520d8 Fixed microsoft#12393
Prior to this every test shared the same tolerances. This meant that if an ONNX test failed due to a small but acceptable difference in output, the only alternative was to disable the test entirely. In op set 17, the DFT operator is being added. Without this change, the tests for that operator fail because the output is off by about 5e-5. It's better to keep test coverage for this new op rather than disable the test entirely. Also prior to this change, the global tolerances were not shared between C++, JavaScript, and Python tests. Now they are. Also fix various minor issues raised by linters. Unblocks microsoft#11640.
Prior to this every test shared the same global tolerances. This meant
that if an ONNX test failed due to a small but acceptable difference in
output, the only alternative was to disable the test entirely.
In op set 17, the DFT operator is being added. Without this change, the
tests for that operator fail because the output is off by about 5e-5.
It's better to keep test coverage for this new op rather than disable
the test entirely.
Also prior to this change, the global tolerances were not shared between
JavaScript, Python and C++ tests. Now they are.
Also update the JSON submodule, which is needed to get it to build with
exceptions disabled.
Unblocks #11640.