Repository: pytorch
Issue: [torchbench] stable_diffusion_unet compilation failure
Labels: triaged,oncall: pt2,oncall: export,module: aotinductor,pt2-pass-rate-regression

### 🐛 Describe the bug

```
python benchmarks/dynamo/torchbench.py --only stable_diffusion_unet --performance --cold-start-latency --inference --bfloat16 --export-aot-inductor --disable-cudagraphs --device cuda
```
```
cuda eval  stable_diffusion_unet              
ERROR:common:Backend dynamo failed in warmup()
Traceback (most recent call last):
  File "/data/users/ivankobzarev/a/pytorch/benchmarks/dynamo/common.py", line 3386, in warmup
    fn(model, example_inputs)
  File "/data/users/ivankobzarev/a/pytorch/benchmarks/dynamo/common.py", line 1635, in export_aot_inductor
    optimized = AOTInductorModelCache.load(model, example_inputs)
  File "/data/users/ivankobzarev/a/pytorch/benchmarks/dynamo/common.py", line 1596, in load
    ep = torch.export.export(
  File "/data/users/ivankobzarev/a/pytorch/torch/export/__init__.py", line 368, in export
    return _export(
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1040, in wrapper
    raise e
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1013, in wrapper
    ep = fn(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/export/exported_program.py", line 128, in wrapper
    return fn(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 2064, in _export
    return _export_for_training(
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1040, in wrapper
    raise e
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1013, in wrapper
    ep = fn(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/export/exported_program.py", line 128, in wrapper
    return fn(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1929, in _export_for_training
    export_artifact = export_func(  # type: ignore[operator]
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1864, in _non_strict_export
    aten_export_artifact = _to_aten_func(  # type: ignore[operator]
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1650, in _export_to_aten_ir_make_fx
    gm, graph_signature = transform(_make_fx_helper)(
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1794, in _aot_export_non_strict
    gm, sig = aot_export(wrapped_mod, args, kwargs=kwargs, **flags)
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1570, in _make_fx_helper
    gm = make_fx(
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 2200, in wrapped
    return make_fx_tracer.trace(f, *args)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 2138, in trace
    return self._trace_inner(f, *args)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 2109, in _trace_inner
    t = dispatch_trace(
  File "/data/users/ivankobzarev/a/pytorch/torch/_compile.py", line 51, in inner
    return disable_fn(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/_dynamo/eval_frame.py", line 755, in _fn
    return fn(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 1142, in dispatch_trace
    graph = tracer.trace(root, concrete_args)  # type: ignore[arg-type]
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 1698, in trace
    res = super().trace(root, concrete_args)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 843, in trace
    (self.create_arg(fn(*args)),),
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 1197, in wrapped
    out = f(*tensors)  # type:ignore[call-arg]
  File "<string>", line 1, in <lambda>
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1473, in wrapped_fn
    return tuple(flat_fn(*args))
  File "/data/users/ivankobzarev/a/pytorch/torch/_functorch/_aot_autograd/utils.py", line 184, in flat_fn
    tree_out = fn(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/_functorch/_aot_autograd/traced_function_transforms.py", line 879, in functional_call
    out = mod(*args[params_len:], **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 821, in module_call_wrapper
    return self.call_module(mod, forward, args, kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 1768, in call_module
    return Tracer.call_module(self, m, forward, args, kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 539, in call_module
    ret_val = forward(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 814, in forward
    return _orig_module_call(mod, *args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/nn/modules/module.py", line 1749, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/nn/modules/module.py", line 1760, in _call_impl
    return forward_call(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/export/_trace.py", line 1778, in forward
    tree_out = mod(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 821, in module_call_wrapper
    return self.call_module(mod, forward, args, kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 1768, in call_module
    return Tracer.call_module(self, m, forward, args, kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 539, in call_module
    ret_val = forward(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 814, in forward
    return _orig_module_call(mod, *args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/nn/modules/module.py", line 1749, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/nn/modules/module.py", line 1760, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/ivankobzarev/local/a/pytorch-env/lib/python3.10/site-packages/diffusers/models/unets/unet_2d_condition.py", line 1246, in forward
    sample = self.mid_block(
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 821, in module_call_wrapper
    return self.call_module(mod, forward, args, kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/experimental/proxy_tensor.py", line 1768, in call_module
    return Tracer.call_module(self, m, forward, args, kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 539, in call_module
    ret_val = forward(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/fx/_symbolic_trace.py", line 814, in forward
    return _orig_module_call(mod, *args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/nn/modules/module.py", line 1749, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/data/users/ivankobzarev/a/pytorch/torch/nn/modules/module.py", line 1760, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/ivankobzarev/local/a/pytorch-env/lib/python3.10/site-packages/diffusers/models/unets/unet_2d_blocks.py", line 884, in forward
    for attn, resnet in zip(self.attentions, self.resnets[1:]):
  File "/data/users/ivankobzarev/a/pytorch/torch/nn/modules/container.py", line 322, in __getitem__
    return self.__class__(list(self._modules.values())[idx])
TypeError: _ModuleStackTracer.__init__.<locals>.AttrProxy.__init__() missing 1 required positional argument: 'path'
warmup_failed
```

### Error logs

_No response_

### Versions

master Jan 16

cc @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 @desertfire @chenyang78