Repository: pytorch
Issue: [export] Dynamic shape torch-trt models fail on torch.export.load 
Labels: triaged,oncall: pt2,export-triaged,oncall: export

### 🐛 Describe the bug

Torch-TensorRT model successfully compiles and can be saved as ExportedProgram. But it fails to load. 

Here is the full error log 
```py
WARNING:py.warnings:/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch_tensorrt/dynamo/_exporter.py:370: UserWarning: Attempted to insert a get_attr Node with no underlying reference in the owning GraphModule! Call GraphModule.add_submodule to add the necessary submodule, GraphModule.add_parameter to add the necessary Parameter, or nn.Module.register_buffer to add the necessary buffer
  engine_node = gm.graph.get_attr(engine_name)

WARNING:py.warnings:/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/graph.py:1586: UserWarning: Node _run_on_acc_0_engine target _run_on_acc_0_engine _run_on_acc_0_engine of  does not reference an nn.Module, nn.Parameter, or buffer, which is what 'get_attr' Nodes typically target
  warnings.warn(f'Node {node} target {node.target} {atom} of {seen_qualname} does '

W1007 15:15:17.998000 397153 site-packages/torch/fx/experimental/symbolic_shapes.py:5124] failed during evaluate_expr(s0 >= 0, hint=True, size_oblivious=False, forcing_spec=False
E1007 15:15:17.999000 397153 site-packages/torch/fx/experimental/recording.py:298] failed while running evaluate_expr(*(s0 >= 0, True), **{'fx_node': False})
Traceback (most recent call last):
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch_tensorrt/_compile.py", line 434, in load
    exp_program = torch.export.load(file_path)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/export/__init__.py", line 473, in load
    ep = deserialize(artifact, expected_opset_version)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_export/serde/serialize.py", line 2437, in deserialize
    .deserialize(
     ^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_export/serde/serialize.py", line 2316, in deserialize
    .deserialize(
     ^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_export/serde/serialize.py", line 1906, in deserialize
    self.deserialize_graph(serialized_graph_module.graph)
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_export/serde/serialize.py", line 1612, in deserialize_graph
    meta_val = self.deserialize_tensor_meta(tensor_value)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_export/serde/serialize.py", line 1579, in deserialize_tensor_meta
    torch.empty_strided(
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/utils/_stats.py", line 21, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_subclasses/fake_tensor.py", line 1238, in __torch_dispatch__
    return self.dispatch(func, types, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_subclasses/fake_tensor.py", line 1692, in dispatch
    return self._cached_dispatch_impl(func, types, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_subclasses/fake_tensor.py", line 1339, in _cached_dispatch_impl
    output = self._dispatch_impl(func, types, args, kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_subclasses/fake_tensor.py", line 1983, in _dispatch_impl
    op_impl_out = op_impl(self, func, *args, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_subclasses/fake_impls.py", line 176, in constructors
    r = func(*args, **new_kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/_ops.py", line 716, in __call__
    return self._op(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/sym_node.py", line 479, in expect_size
    r = b.expect_true(file, line)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/sym_node.py", line 465, in expect_true
    return self.guard_bool(file, line)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/sym_node.py", line 449, in guard_bool
    r = self.shape_env.evaluate_expr(self.expr, self.hint, fx_node=self.fx_node)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/recording.py", line 262, in wrapper
    return retlog(fn(*args, **kwargs))
                  ^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/symbolic_shapes.py", line 5122, in evaluate_expr
    return self._evaluate_expr(orig_expr, hint, fx_node, size_oblivious, forcing_spec=forcing_spec)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/symbolic_shapes.py", line 5198, in _evaluate_expr
    static_expr = self._maybe_evaluate_static(expr,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/symbolic_shapes.py", line 1532, in wrapper
    return fn_cache(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dperi/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torch/fx/experimental/symbolic_shapes.py", line 4479, in _maybe_evaluate_static
    vr = var_ranges[k]
         ~~~~~~~~~~^^^
KeyError: s0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dperi/Downloads/TensorRT/test.py", line 28, in <module>
    ep = torch_tensorrt.load("./trt.ep")
```

Here is the reproducer 
Please install the following versions of libraries 
```py 
pip install torch torch_tensorrt --extra-index-url https://download.pytorch.org/whl/test/cu124
```
```py
import torch
import torch_tensorrt
import torchvision.models as models

model = models.resnet18().eval().cuda()
input = torch.randn((1, 3, 224, 224)).to("cuda")
compile_spec = {
        "inputs": [
            torch_tensorrt.Input(
                min_shape=(1, 3, 224, 224),
                opt_shape=(4, 3, 224, 224),
                max_shape=(8, 3, 224, 224),
                dtype=torch.float32,
                name="x",
            )
        ],
        "ir": "dynamo",
        "min_block_size": 1,
        "cache_built_engines": False,
        "reuse_cached_engines": False,
    }

exp_program = torch_tensorrt.dynamo.trace(model, **compile_spec)
trt_module = torch_tensorrt.dynamo.compile(exp_program, **compile_spec)
torch_tensorrt.save(trt_module, "./trt.ep", inputs=[input])
ep = torch_tensorrt.load("./trt.ep")
```

cc: @angelayi 

### Versions

[pip3] torch==2.6.0.dev20241004+cu124
[pip3] torch_tensorrt==2.6.0.dev0+52df589bb
[pip3] torchmetrics==1.4.0.post0
[pip3] torchprofile==0.0.4
[pip3] torchsurgeon==0.1.2
[pip3] torchvision==0.20.0.dev20241004+cu124
[pip3] triton==3.0.0

cc @ezyang @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4