-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
bert_module: fix inputs of export model #3815
Merged
borisfom
merged 2 commits into
NVIDIA:main
from
virajkarandikar:vkarandikar/fix_bert_model_inputs
Mar 11, 2022
Merged
bert_module: fix inputs of export model #3815
borisfom
merged 2 commits into
NVIDIA:main
from
virajkarandikar:vkarandikar/fix_bert_model_inputs
Mar 11, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virajkarandikar
force-pushed
the
vkarandikar/fix_bert_model_inputs
branch
from
March 9, 2022 11:34
eaca787
to
2cd9f4f
Compare
virajkarandikar
changed the title
Draft: bert_module: fix model inputs when exported
bert_module: fix model inputs when exported
Mar 9, 2022
virajkarandikar
force-pushed
the
vkarandikar/fix_bert_model_inputs
branch
2 times, most recently
from
March 9, 2022 18:44
2bf0c12
to
dcac1ab
Compare
virajkarandikar
force-pushed
the
vkarandikar/fix_bert_model_inputs
branch
from
March 9, 2022 18:47
dcac1ab
to
8d275c7
Compare
virajkarandikar
changed the title
bert_module: fix model inputs when exported
bert_module: fix inputs of export model
Mar 9, 2022
Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
virajkarandikar
force-pushed
the
vkarandikar/fix_bert_model_inputs
branch
from
March 9, 2022 18:48
8d275c7
to
079e148
Compare
Changes look OK to me. |
yzhang123
approved these changes
Mar 11, 2022
@borisfom please double check before we merge |
borisfom
approved these changes
Mar 11, 2022
crcrpar
pushed a commit
to crcrpar/NeMo
that referenced
this pull request
Mar 11, 2022
Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com>
fayejf
pushed a commit
that referenced
this pull request
Mar 12, 2022
Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com>
ericharper
added a commit
that referenced
this pull request
Mar 14, 2022
…nto account (#3826) * initial fix: taking data parallel size into consideration Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update the signature Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * data_parallel_rank -> data_parallel_size Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * fix typo Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * cosmetic changes Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * Revert "update the signature" This reverts commit 1c134e5. Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update batch_sampler arguments Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * change how to slice `batch` Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update not drop_last path Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * add fr asr ckpt to doc (#3809) Signed-off-by: Yang Zhang <yangzhang@nvidia.com> * bert_module: fix inputs of exported model (#3815) Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com> * update random batch sampler Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com> Co-authored-by: Viraj Karandikar <16838694+jarivk@users.noreply.github.com> Co-authored-by: Eric Harper <complex451@gmail.com>
fayejf
pushed a commit
that referenced
this pull request
Mar 22, 2022
Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com>
fayejf
pushed a commit
that referenced
this pull request
Mar 22, 2022
…nto account (#3826) * initial fix: taking data parallel size into consideration Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update the signature Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * data_parallel_rank -> data_parallel_size Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * fix typo Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * cosmetic changes Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * Revert "update the signature" This reverts commit 1c134e5. Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update batch_sampler arguments Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * change how to slice `batch` Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update not drop_last path Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * add fr asr ckpt to doc (#3809) Signed-off-by: Yang Zhang <yangzhang@nvidia.com> * bert_module: fix inputs of exported model (#3815) Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com> * update random batch sampler Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com> Co-authored-by: Viraj Karandikar <16838694+jarivk@users.noreply.github.com> Co-authored-by: Eric Harper <complex451@gmail.com>
fayejf
pushed a commit
that referenced
this pull request
Mar 22, 2022
Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com>
fayejf
pushed a commit
that referenced
this pull request
Mar 22, 2022
…nto account (#3826) * initial fix: taking data parallel size into consideration Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update the signature Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * data_parallel_rank -> data_parallel_size Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * fix typo Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * cosmetic changes Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * Revert "update the signature" This reverts commit 1c134e5. Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update batch_sampler arguments Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * change how to slice `batch` Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * update not drop_last path Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> * add fr asr ckpt to doc (#3809) Signed-off-by: Yang Zhang <yangzhang@nvidia.com> * bert_module: fix inputs of exported model (#3815) Exported ONNX model had to be passed with "attention_mask" and "token_type_ids" inputs swapped to get correct output. Changing the input order fixes this issue. Also return a dict instead of list for correctly passing inputs. Update relevant tests: test_TokenClassificationModel_export_to_onnx test_PunctuationCapitalizationModel_export_to_onnx test_QAModel_export_to_onnx Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com> * update random batch sampler Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com> Co-authored-by: Yang Zhang <yzhang123@users.noreply.github.com> Co-authored-by: Viraj Karandikar <16838694+jarivk@users.noreply.github.com> Co-authored-by: Eric Harper <complex451@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Exported ONNX model had to be passed with "attention_mask" and
"token_type_ids" inputs swapped to get correct output.
Changing the input order fixes this issue.
Also return a dict instead of list for correctly passing inputs.
What does this PR do ?
Fix swapped model inputs for exported ONNX/TRT model.
Collection: NLP
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?
@MaximumEntropy, @ericharper, @ekmb, @yzhang123
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