-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Export ONNX Dropout for opset 10 #20710
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
Export ONNX Dropout for opset 10 #20710
Conversation
|
|
||
| # we should only export the onnx Dropout op in training mode; test both modes | ||
|
|
||
| # test training mode |
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 training proposal is still in progress. So in ONNX, the dropout operator still only support inference mode. We should error out and print out warning if it's in training mode. Tell user, you should call .eval before exporting to 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.
So for both opset 9 and 10, error out instead of exporting Dropout() ?
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.
could we maybe still export the model with Dropout in training mode, but add a warning to inform the user?
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 only difference between opset 7 and opset 10's dropout is that their mask type (2nd output) is different. So they both only support inference, no training... So please don't add support for training yet. (ONNX's training proposal is still under development)
houseroad
left a comment
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 good, could you rebase again to let the CI pass.
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…aidar/remove_onnx_dropout_blacklist
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@houseroadcan we merge this? |
|
@houseroad merged this pull request in 27d1daa. |
Remove Dropout from the opset 10 blacklist.
ONNX Dropout was modified in opset 10, but only the output "mask" was modified, which is not exported in pytorch opset 9. So we can still fallback on the opset 9 op.