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] Encountered TRT Error in Dynamo compile path #2072

Closed
gs-olive opened this issue Jul 1, 2023 · 1 comment · Fixed by #2080
Closed

🐛 [Bug] Encountered TRT Error in Dynamo compile path #2072

gs-olive opened this issue Jul 1, 2023 · 1 comment · Fixed by #2080
Assignees
Labels
bug Something isn't working

Comments

@gs-olive
Copy link
Collaborator

gs-olive commented Jul 1, 2023

Bug Description

When compiling GPT-2 with Dynamo compile, the following error is encountered:

[07/01/2023-00:07:12] [TRT] [E] 3: [executionContext.cpp::enqueueInternal::795] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::enqueueInternal::795, condition: bindings[x] || nullBindingOK
)

Additionally, this does not seem to cause failures in the Dynamo runtime (not caught by pass_through_build_failures), and it appears both with and without the experimental runtime.

To Reproduce

model = GPT2Model.from_pretrained("gpt2").eval().cuda()
input_ids      = torch.randint(0, 2, (1, 14), dtype=torch.int32).cuda()
attention_mask = torch.randint(0, 2, (1, 14), dtype=torch.int32).cuda()
traced = transformers_trace(model, input_names=["input_ids", "attention_mask"]).eval().cuda()
fx_trt_model = torch_tensorrt.compile(traced, ir="dynamo_compile", inputs=[input_ids, attention_mask], debug=True, pass_through_build_failures=True, min_block_size=10)

Expected behavior

The model should not encounter TRT errors while compiling.

Environment

  • Torch-TensorRT Version (e.g. 1.0.0): 2844630
  • PyTorch Version (e.g. 1.0): 2.1.0.dev20230620+cu118
  • TensorRT Version: 8.6.1

Additional context

This error no longer appears when we apply the @fake_tensor_unsupported flag to the backends, as was removed in #1955. It is unclear whether this is the direct cause of the bug, however.

Additionally, this bug seems to appear only sometimes, and not consistently.

@gs-olive gs-olive added the bug Something isn't working label Jul 1, 2023
@gs-olive gs-olive self-assigned this Jul 1, 2023
@gs-olive
Copy link
Collaborator Author

gs-olive commented Jul 6, 2023

Relevant: CI Failures on #2003, #2070, #1944

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.

1 participant