Skip to content

🐛 [Bug] Compiling Models with Int-to-Tensor Casted Inputs #2187

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

Closed
gs-olive opened this issue Aug 10, 2023 · 0 comments · Fixed by #2188
Closed

🐛 [Bug] Compiling Models with Int-to-Tensor Casted Inputs #2187

gs-olive opened this issue Aug 10, 2023 · 0 comments · Fixed by #2188
Assignees
Labels
bug Something isn't working component: runtime

Comments

@gs-olive
Copy link
Collaborator

Bug Description

When compiling models with 0D tensor inputs, the following error is encountered:

ERROR: [Torch-TensorRT] - 3: [executionContext.cpp::setInputShape::2259] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::setInputShape::2259, condition: engineDims.nbDims == dims.nbDims
)

To Reproduce

        class Multiply(torch.nn.Module):
            def forward(self, x):
                return x * 7

        inputs = [
            torch.tensor(
                3,
            ).cuda().int(),
        ]

Expected behavior

The models should successfully compile.

Environment

Build information about Torch-TensorRT can be found by turning on debug messages

  • Torch-TensorRT Version (e.g. 1.0.0): 8c62fca
  • PyTorch Version (e.g. 1.0): 2.1.0.dev20230803+cu121

Additional context

Very relevant to diffusion and detectron-style models.

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

Successfully merging a pull request may close this issue.

2 participants