-
Notifications
You must be signed in to change notification settings - Fork 373
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
Exception or pass elimination incorrectly identifies an if block with only a list append in it as a removable exception. This changes model behavior and creates incorrect outputs.
GRAPH: [Torch-TensorRT - Debug Build] - Found that node = prim::If(%51)
block0():
%10 : Tensor[] = aten::append(%mod_list.1, %y.1)
-> ()
block1():
-> ()
is an exception or pass node (EliminateChecks)
To Reproduce
Steps to reproduce the behavior:
class ExceptionEliminationError(nn.Module):
def __init__(self):
super(ExceptionEliminationError, self).__init__()
def forward(self, x, y):
mod_list = [x]
if x.sum() > y.sum():
mod_list.append(y)
z = torch.cat(mod_list)
return z
- Attempt to compile the model above with torch-tensorrt
Expected behavior
The exception elimination pass should not remove this if.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working