[ONNX] Make freeze_param = True and run DynamicToStatic by default
#10750
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ONNX frontend is written to produce a dynamic graph and it is expected that the
DynamicToStaticpass be applied after model import to make thing as static as possible. Until now we are implicitly relying on users to take this assumption into account, but I believe it is better to runDynamicToStaticinside the frontend since it is practically required anyway. This is especially important since in #10691 I removed the "last minute fix-up".For
DynamicToStaticto work,freeze_paramneeds to be True. So I also changed its default value, but this can be reverted if there are some concerns in makingfreeze_param = Trueby default (which will disableDynamicToStatictoo).@mbrookhart @AndrewZhaoLuo @kparzysz-quic