-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[ONNX] Update the sequence of initializers in exported graph so that it is as same as inputs. #49798
Conversation
Sync to latest branch.
Get latest changes from pytorch branch.
Get latest changes in master.
Sync from Onnx ms 1
Sync from Onnx ms 1
💊 CI failures summary and remediationsAs of commit efd09b9 (more details on the Dr. CI page):
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages: pytorch_linux_backward_compatibility_check_test (1/2)Step: "Run tests" (full log | diagnosis details | 🔁 rerun)
|
Thanks @fatcat-z, could you check the failed onnx_ort_test1/onnx_ort_test2 CI tests and fix if related? |
It has been fixed by updating expect file. |
…it is as same as inputs. (pytorch#49798) * [ONNX] Support onnx if/loop sequence output in opset 13 - (pytorch#49270) * Symbolic function for torch.square (pytorch#49446) * [ONNX] Support onnx if/loop sequence output in opset 13 - (pytorch#49270) * Symbolic function for torch.square (pytorch#49446) * Update code so that initializers' sequence is as same as inputs. * Correct the format according to flake8. * Correct the format by clang-format. * Add a new test for script model. * Update expect files for Test_Operators tests. Co-authored-by: Bowen Bao <bowbao@microsoft.com> Co-authored-by: David Fan <30608893+jiafatom@users.noreply.github.com>
Summary: [ONNX] ONNX dev branch merge 01-06-2021 - [ONNX] Support onnx if/loop sequence output in opset 13 - (#49270) - Symbolic function for torch.square (#49446) - [ONNX] Add checks in ONNXSetDynamicInputShape (#49783) … - [ONNX] Enable export af aten::__derive_index (#49514) … - [ONNX] Update symbolic for unfold (#49378) … - [ONNX] Update the sequence of initializers in exported graph so that it is as same as inputs. (#49798) - [ONNX] Enable opset 13 ops (#49612) … - [ONNX] Improve error message for supported model input types in ONNX export API. (#50119) - [ONNX] Add a post-pass for If folding (#49410) Pull Request resolved: #50163 Reviewed By: pbelevich Differential Revision: D25821059 Pulled By: SplitInfinity fbshipit-source-id: 9f511a93d9d5812d0ab0a49d61ed0fa5f8066948
In the process of export, initializers were saved in a C++ map container. Map will automatically sort the elements when an insertion happened. This causes initializers lose the insertion sequence which is supposed to be kept.
So update the backend code to create initializers following up on the inputs sequence in a final stage where initializers were not kept in a map container.