Skip to content
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

🐛 [Bug] Error when compiling Punctuation BERT model #1587

Closed
gs-olive opened this issue Jan 12, 2023 · 0 comments · Fixed by #1589
Closed

🐛 [Bug] Error when compiling Punctuation BERT model #1587

gs-olive opened this issue Jan 12, 2023 · 0 comments · Fixed by #1589
Assignees
Labels
bug Something isn't working

Comments

@gs-olive
Copy link
Collaborator

gs-olive commented Jan 12, 2023

Bug Description

When compiling the BERT punctuation/capitalization model, the following error is encountered:

RuntimeError: outputs_[i]->uses().empty() INTERNAL ASSERT FAILED at "../torch/csrc/jit/ir/ir.cpp":1312, please report a bug to PyTorch. 

To Reproduce

Steps to reproduce the behavior:

  1. Run torch_tensorrt.compile with the BERT punctuation model as input, using fp32 precision.
  2. Choose three fixed-size inputs of shape [1, 256], [1, 256], and [1, 256], and enable truncate_long_and_double with 12 GB workspace.

Expected behavior

Model should successfully compile with Torch-TRT. Specifically, internal assertion errors of this sort should not occur.

Environment

  • Torch-TensorRT Version: 1.4.0.dev0+f43be5b6
  • PyTorch Version: 1.14.0.dev20221114+cu116
  • CPU Architecture: Intel Xeon CPU
  • OS: Ubuntu 20.04
  • How you installed PyTorch: pip
  • Build command you used: python setup.py develop
  • Are you using local sources or building from archives: local
  • Python version: 3.8.13
  • CUDA version: 11.6

Additional context + Temporary Solution

Upon inspecting the error in greater depth, it seems to occur in the Lowering phase, during the RemoveDropout lowering pass:

void RemoveDropout(std::shared_ptr<torch::jit::Graph>& graph) {

The model was in evaluation mode, but it seems that one of the rewrites/replacements used in this lowering pass causes the above error. Disabling this lowering pass and recompiling the model causes the compilation to proceed normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants