Open peri044 opened 2 weeks ago
The minimal reproducer for this bug:
"""Test script for TRT export"""
import torch
import torch_tensorrt
from torch.export import export, Dim
class TestMod(torch.nn.Module):
def __init__(self):
super().__init__()
self.linear1 = torch.nn.Linear(10,10)
self.linear2 = torch.nn.Linear(10,10)
def forward(self, x):
return self.linear1(x)
x = torch.randn(2,2,10).to("cuda")
mod = TestMod().to("cuda")
dynamic_shapes = (
{
0: Dim("batch_size", min=1, max=10),
1: Dim("seq_len", max=10),
},
)
pgm = export(mod, (x,), dynamic_shapes=dynamic_shapes)
trt_fx_module = torch_tensorrt.dynamo.compile(
pgm, (x,), min_block_size=1, enabled_precisions=(torch.float32,), debug=True
)
This PR fixes this issue : https://github.com/pytorch/TensorRT/pull/2918
Question to pytorch : https://github.com/pytorch/pytorch/issues/128640
Bug Description
Configuration :
llm_examples_main
branch, current torch version : 2.4, transformers==4.41.2 One of the subgraphs is receiving aSymInt
node (s0+1) which relies on otherSymInt
nodes. Hence the node.meta does not have the shape information of this node but it has info about (s0). File a bug with PyTorch if this can be computed.Error message:
To Reproduce
Environment
conda
,pip
,libtorch
, source):Additional context