Repository: pytorch
Issue: aot_compile default configuration doesn't seem to appropriately setup support for unbacked SymInts
Labels: triaged,oncall: pt2,module: dynamic shapes,oncall: export,module: aotinductor

### 🐛 Describe the bug

I tried to run this test in test/inductor/test_aot_inductor.py

```
    @torch._dynamo.config.patch(capture_scalar_outputs=True)
    def test_unbacked_arg(self):
        def f():
            full = torch.full((), 11)
            i0 = full.item()
            return torch.full((i0,), 0)
    
        from torch.fx.experimental.proxy_tensor import make_fx
        gm = make_fx(f, tracing_mode="symbolic")()
        
        torch._inductor.aot_compile(gm, ())
```

but it fails with

```
  File "/data/users/ezyang/a/pytorch/test/inductor/test_aot_inductor.py", line 1007, in test_unbacked_arg
    torch._inductor.aot_compile(gm, ())                                                           
  File "/data/users/ezyang/a/pytorch/torch/_inductor/__init__.py", line 76, in aot_compile    
    return compile_fx_aot(                                                                        
  File "/data/users/ezyang/a/pytorch/torch/_inductor/compile_fx.py", line 885, in compile_fx_aot                                                                                                    
    compiled_lib_path = compile_fx(                                                               
  File "/data/users/ezyang/a/pytorch/torch/_inductor/compile_fx.py", line 990, in compile_fx                                                                                                        
    return compile_fx(                                                                            
  File "/data/users/ezyang/a/pytorch/torch/_inductor/compile_fx.py", line 1024, in compile_fx                                                                                                       
    return compile_fx(                                                                            
  File "/data/users/ezyang/a/pytorch/torch/_inductor/compile_fx.py", line 1038, in compile_fx                                                                                                       
    return make_graph_return_tuple(         
  File "/data/users/ezyang/a/pytorch/torch/_inductor/compile_fx.py", line 1293, in make_graph_return_tuple
    compiled_fn = compile_gm(gm, inputs)
  File "/data/users/ezyang/a/pytorch/torch/_inductor/compile_fx.py", line 1200, in compile_fx                                                                                                       
    gm, graph_signature = aot_export_module(
  File "/data/users/ezyang/a/pytorch/torch/_functorch/aot_autograd.py", line 1029, in aot_export_module
    fx_g, metadata, in_spec, out_spec = _aot_export_function(
  File "/data/users/ezyang/a/pytorch/torch/_functorch/aot_autograd.py", line 1214, in _aot_export_function
    fx_g, meta = create_aot_dispatcher_function(                                                  
  File "/data/users/ezyang/a/pytorch/torch/_dynamo/utils.py", line 248, in time_wrapper
    r = func(*args, **kwargs)                                                                     
  File "/data/users/ezyang/a/pytorch/torch/_functorch/aot_autograd.py", line 507, in create_aot_dispatcher_function
    fw_metadata = run_functionalized_fw_and_collect_metadata(         
  File "/data/users/ezyang/a/pytorch/torch/_functorch/_aot_autograd/collect_metadata_analysis.py", line 113, in inner
    flat_f_outs = f(*flat_f_args)
  File "/data/users/ezyang/a/pytorch/torch/_functorch/_aot_autograd/utils.py", line 160, in flat_fn
    tree_out = fn(*args, **kwargs)                                                                
  File "/data/users/ezyang/a/pytorch/torch/_functorch/_aot_autograd/traced_function_transforms.py", line 622, in functional_call
    out = PropagateUnbackedSymInts(mod).run(
  File "/data/users/ezyang/a/pytorch/torch/fx/interpreter.py", line 144, in run
    self.env[node] = self.run_node(node)
  File "/data/users/ezyang/a/pytorch/torch/_functorch/_aot_autograd/traced_function_transforms.py", line 602, in run_node
    result = super().run_node(n)
  File "/data/users/ezyang/a/pytorch/torch/fx/interpreter.py", line 201, in run_node
    return getattr(self, n.op)(n.target, args, kwargs)
  File "/data/users/ezyang/a/pytorch/torch/fx/interpreter.py", line 273, in call_function
    return target(*args, **kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_ops.py", line 571, in __call__
    return self_._op(*args, **kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_subclasses/functional_tensor.py", line 380, in __torch_dispatch__
    outs_unwrapped = func._op_dk(
  File "/data/users/ezyang/a/pytorch/torch/utils/_stats.py", line 20, in wrapper
    return fn(*args, **kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_subclasses/fake_tensor.py", line 1635, in __torch_dispatch__
    return self.dispatch(func, types, args, kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_subclasses/fake_tensor.py", line 1975, in dispatch
    return self._cached_dispatch_impl(func, types, args, kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_subclasses/fake_tensor.py", line 1713, in _cached_dispatch_impl
    output = self._dispatch_impl(func, types, args, kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_subclasses/fake_tensor.py", line 2165, in _dispatch_impl
    op_impl_out = op_impl(self, func, *args, **kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_subclasses/fake_tensor.py", line 458, in dispatch_to_op_implementations_dict
    return op_implementations_dict[func](fake_mode, func, *args, **kwargs)
  File "/data/users/ezyang/a/pytorch/torch/_subclasses/fake_tensor.py", line 587, in local_scalar_dense
    raise DataDependentOutputException(func)
torch._subclasses.fake_tensor.DataDependentOutputException: aten._local_scalar_dense.default
```

This shouldn't happen, aot_compile should be initializing a FakeTensorMode with ShapeEnv so that we can return an unbacked SymInt in this case. Seems like some sort of misconfiguration.

cc @msaroufim @bdhirsh @anijain2305 @zou3519 @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 @desertfire 

### Versions

main