-
Notifications
You must be signed in to change notification settings - Fork 351
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] Expected ivalues_maps.count(input) to be true but got false #1834
Comments
Hello - could you please share any information/sample of the model being compiled which led to the error, and/or the full debug logs associated with the failure? Related: #1815 |
With just a simple class that has this part of code in the forward. Being |
I tried the following sample on my machine, which has a linear layer and uses the tensors in the Code Sampleimport torch
import torch_tensorrt
class Network(torch.nn.Module):
def __init__(self):
super(Network, self).__init__()
self.lin = torch.nn.Linear(5, 5)
self.hidden_size = 5
self.device = "cuda:0"
def forward(self, X: torch.Tensor):
out_1 = self.lin(X)
hidden = (
torch.zeros(
size=(5, self.hidden_size),
dtype=torch.float,
device=self.device,
),
torch.zeros(
size=(5, self.hidden_size),
dtype=torch.float,
device=self.device,
)
)
a = out_1 + hidden[0] + hidden[1]
return a
net = Network().eval().cuda()
kwargs = {
'inputs': [torch_tensorrt.Input(shape=[5, 5], dtype=torch.float32)],
'enabled_precisions': {torch.float32},
'min_block_size': 1,
}
trt_network = torch_tensorrt.compile(torch.jit.script(net), **kwargs)
out = trt_network(torch.rand(5, 5).cuda()) |
@gs-olive the hidden variable was input for an attentioncell: `
` |
@bowang007 - this may be similar to your work on |
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days |
Bug Description
RuntimeError: [Error thrown at core/partitioning/shape_analysis.cpp:183] Expected ivalues_maps.count(input) to be true but got false
Could not find torch::jit::Value* hidden.1 produced from %hidden.1 : (Tensor, Tensor) = prim::TupleConstruct(%440, %440) in lowering graph for mini graph input.
To Reproduce
Steps to reproduce the behavior:
Environment
torch==2.1.0.dev20230418+cu117
torch-tensorrt==1.4.0.dev0+a245b861
Additional context
The text was updated successfully, but these errors were encountered: