-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
No-script TS export, prepared for ONNX export #5653
Conversation
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
aa0b99f
to
9a53880
Compare
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
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 the export changes look fine. Someone from TTS team should check of the code overall works as expected. Fyi @XuesongYang
Seems import check fails with _globals from onnx. Put try catch import guard around it |
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
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.
Changes look fine, @XuesongYang for final review
Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
* Changed unfold to reshape, merged padding chenges * Almost working ONNX export of RadTTS * restored radtts function * Added explicit assume_padded flag * Fixing attn_mask * Fixing unfold * Trying no hx * Back with hx * Made fx only for tracing * Tests annotated * Fully working no-script TS export, prepared for ONNX export * Restored no-autocast block, addressed code review * Fine-tuning autocast option * Protecting InstanceNorm * Forcing eval and param freeze on export Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com> Signed-off-by: Elena Rastorgueva <erastorgueva@nvidia.com>
* Changed unfold to reshape, merged padding chenges * Almost working ONNX export of RadTTS * restored radtts function * Added explicit assume_padded flag * Fixing attn_mask * Fixing unfold * Trying no hx * Back with hx * Made fx only for tracing * Tests annotated * Fully working no-script TS export, prepared for ONNX export * Restored no-autocast block, addressed code review * Fine-tuning autocast option * Protecting InstanceNorm * Forcing eval and param freeze on export Signed-off-by: Boris Fomitchev <bfomitchev@nvidia.com>
Signed-off-by: Boris Fomitchev bfomitchev@nvidia.com
What does this PR do ?
Changed unfold to reshape for inference to be able to export in ONNX.
Also using extra hx parameter to LSTM call to work around Pytorch issues with tracing the hx=None.
Now Torchscript export works without any scripting - so I was also able to get rid of unnecessary autocast=False block.
ONNX export still fails due to internal bugs, even though each part of the network is now ONNX-exportable.
Collection: [Note which collection this PR will affect]
Changelog
Usage
# Add a code snippet demonstrating how to use this
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information