-
Notifications
You must be signed in to change notification settings - Fork 356
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 bug when compiling model with nested Input type using input_signature
argument
#1595
Comments
UpdateError OriginThe origin of this compilation error derives from the graph inputs sourced from the ( (Tensor, (Tensor, Tensor)), ) With the above as the input format, however, the innermost TensorRT/core/ir/GraphInputs.cpp Lines 42 to 52 in 5fa6374
Since the initial Tuple coalescing the individual arguments in the input signature is considered as a nesting level, this implies that Tuple[Tuple[Tensor]] input constructs are disallowed as they violate the maximum nesting depth.
ResolutionSince this example did not derive from a specific Input, but was instead a general assessment of A more involved fix might include restructuring the input signature format to allow for arbitrary input nesting depth. A suggestion on this approach would be to refactor the
TensorRT/core/ir/GraphInputs.cpp Lines 64 to 66 in 5fa6374
|
Bug Description
When compiling a model with input type
Tuple[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]
, compilation fails with the following error:To Reproduce
Steps to reproduce the behavior:
input_signature
, then compile the scripted model:Expected behavior
Model should compile with input signature containing nested Tuple collection.
Environment
python setup.py develop
Additional context
The case of a nested Tuple containing a singleton Tensor followed by a Tuple of Tensors is not parsed as expected by the input signature interpreter, whereas regular tuple Inputs of Tensors are supported, as in:
TensorRT/tests/py/api/test_collections.py
Lines 210 to 213 in b2a5da6
Wrapping the input signature in another Tuple does not resolve the issue, and raises a different error message:
The text was updated successfully, but these errors were encountered: