-
Couldn't load subscription status.
- Fork 3.8k
Fix some checks not ideal to onnx-ml #781
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
Conversation
1. Need to consider cases where no default ONNX operator set exists 2. Cannot assume that value_info's are all tensors (CoreML's neural network classifiers contain ZipMap, the they may produce Maps)
| enforce_has_field(type, elem_type); | ||
| enforce_has_field(type, shape); | ||
| } break; | ||
| default: |
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.
we should add #ifdef ONNX_ML and add cases of map/sequence in-place.
onnx/checker.cc
Outdated
| } | ||
| auto dit = opset_imports.find(ONNX_DOMAIN); | ||
| if (dit == opset_imports.end()) { | ||
| if (opset_imports.size() < 1) { |
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.
.empty()
|
✅ Build onnx 0.3.2387 completed (commit 4fec2d4b7b by @wschin) |
onnx/checker.cc
Outdated
| } | ||
| auto dit = opset_imports.find(ONNX_DOMAIN); | ||
| if (dit == opset_imports.end()) { | ||
| if (opset_imports.empty()) { |
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.
This doesn't seem right to me. Do you want to avoid the check when you have other domain?
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.
The following checks are not necessary if at least one domain exists because (1) opset_import is good with IR>=3 (2) default opset_imports should be set only if opset_import is empty.
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 think the right check should be:
if (model.ir_version() >= 3) {
// enforce opset_imports is not empty
} else {
// enforce opset_imports is empty,
// and set the default value for ONNX_DOMAIN
}
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.
Looks better.
| } else { | ||
| if (opset_imports.empty()) | ||
| opset_imports[ONNX_DOMAIN] = 1; | ||
| } |
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.
else {
fail_check(
"model with IR version < 3 should have no opset_import specified for ONNX");
}
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.
Done. Thanks.
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.
It breaks a lot of torch tests.
|
@houseroad , looks like some of the tests are not following the fact that opset_import should not be there if ir_version <= 2. Could you help on it please? |
|
❌ Build onnx 0.3.2402 failed (commit bfc1669fef by @wschin) |
|
❌ Build onnx 0.3.2405 failed (commit a101afba21 by @wschin) |
|
#788 should solve the problem |
|
❌ Build onnx 0.3.2418 failed (commit 897f159ca2 by @linkerzhang) |
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.
LG. Please wait for the test cases update PR to be merged first and then rebase this one.
|
❌ Build onnx 0.3.2427 failed (commit f95c64fec7 by @houseroad) |
|
❌ Build onnx 0.3.2429 failed (commit 1f2d3ac5f6 by @bddppq) |
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.
Thank you very much!
|
❌ Build onnx 0.3.2433 failed (commit af7fef5b47 by @bddppq) |
|
@houseroad looks like the tests still fail :(. |
|
@linkerzhang Some test cases were not updated. Checking the reason |
|
❌ Build onnx 0.3.2437 failed (commit 9ad9ab73ba by @bddppq) |
|
❌ Build onnx 0.3.2441 failed (commit c826f80c41 by @linkerzhang) |
|
❌ Build onnx 0.3.2444 failed (commit ba96ba9bab by @linkerzhang) |
* Fix some checks not ideal to onnx-ml 1. Need to consider cases where no default ONNX operator set exists 2. Cannot assume that value_info's are all tensors (CoreML's neural network classifiers contain ZipMap, the they may produce Maps) * Address comments and improve some more error messages * Make SSA not abbreviated * Address a comment * a fix (cherry picked from commit e3da0f9)
* Cherry picked fix on python Schema API * Merge Rel 1.1.0 branch into master (#657) * Increase Version number for release 1.1.0 * Increase version number to 1.1.1 (cherry picked from commit ecac1c1) * Fix some checks not ideal to onnx-ml (#781) * Fix some checks not ideal to onnx-ml 1. Need to consider cases where no default ONNX operator set exists 2. Cannot assume that value_info's are all tensors (CoreML's neural network classifiers contain ZipMap, the they may produce Maps) * Address comments and improve some more error messages * Make SSA not abbreviated * Address a comment * a fix (cherry picked from commit e3da0f9) * Cherry picked updated testcases * Cherry pick updates on testcases (1) * Remove incorrect cases (#791) * Update the remainig cases (#794) * Fix incorrect conflict merge * Remove unpassed testcases * Bump up version number
* Cherry picked fix on python Schema API * Merge Rel 1.1.0 branch into master (#657) * Increase Version number for release 1.1.0 * Increase version number to 1.1.1 (cherry picked from commit ecac1c1) * Fix some checks not ideal to onnx-ml (#781) * Fix some checks not ideal to onnx-ml 1. Need to consider cases where no default ONNX operator set exists 2. Cannot assume that value_info's are all tensors (CoreML's neural network classifiers contain ZipMap, the they may produce Maps) * Address comments and improve some more error messages * Make SSA not abbreviated * Address a comment * a fix (cherry picked from commit e3da0f9) * Cherry picked updated testcases * Cherry pick updates on testcases (1) * Remove incorrect cases (#791) * Update the remainig cases (#794) * Fix incorrect conflict merge * Remove unpassed testcases * Bump up version number * Kezhan/update ml op spec (#799) * update normalizer. * update ml op spec. * update traditional ops. * update ml op doc (cherry picked from commit bf00ae6)
* Fix some checks not ideal to onnx-ml 1. Need to consider cases where no default ONNX operator set exists 2. Cannot assume that value_info's are all tensors (CoreML's neural network classifiers contain ZipMap, the they may produce Maps) * Address comments and improve some more error messages * Make SSA not abbreviated * Address a comment * a fix
* Fix some checks not ideal to onnx-ml 1. Need to consider cases where no default ONNX operator set exists 2. Cannot assume that value_info's are all tensors (CoreML's neural network classifiers contain ZipMap, the they may produce Maps) * Address comments and improve some more error messages * Make SSA not abbreviated * Address a comment * a fix
network classifiers contain ZipMap, so they may produce Maps)