Inductor lowering error for aten fallbacks with multiple outputs
Labels: triaged, oncall: pt2, module: inductor

### 🐛 Describe the bug

aten.sort and aten.topk are aten fallback ops in inductor, and have MultiOutputLayout as `layout`. 
'MultiOutputLayout' object has no attribute 'size'

Questions:
I would expect ir.MultiOutputLayout to be a subclass of ir.Layout, but it's not. Why? 
I am surprised that we don't have UT catching this?

### Error logs

Traceback (most recent call last):
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/testing/_internal/common_utils.py", line 2406, in wrapper
    method(*args, **kwargs)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/deeplearning/aot_inductor/test/test_custom_ops.py", line 119, in test_export_extern_fallback_nodes
    self._test_export_extern_fallback_nodes(dynamic_shape=False)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/deeplearning/aot_inductor/test/test_custom_ops.py", line 103, in _test_export_extern_fallback_nodes
    so_path = torch._inductor.aot_compile(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/__init__.py", line 48, in aot_compile
    result = compile_fx_aot(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 850, in compile_fx_aot
    return compile_fx(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 951, in compile_fx
    return compile_fx(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 980, in compile_fx
    return compile_fx(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 1159, in compile_fx
    return aot_autograd(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_dynamo/backends/common.py", line 55, in compiler_fn
    cg = aot_module_simplified(gm, example_inputs, **kwargs)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_functorch/aot_autograd.py", line 3891, in aot_module_simplified
    compiled_fn = create_aot_dispatcher_function(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_dynamo/utils.py", line 190, in time_wrapper
    r = func(*args, **kwargs)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_functorch/aot_autograd.py", line 3429, in create_aot_dispatcher_function
    compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config, fw_metadata=fw_metadata)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_functorch/aot_autograd.py", line 2212, in aot_wrapper_dedupe
    return compiler_fn(flat_fn, leaf_flat_args, aot_config, fw_metadata=fw_metadata)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_functorch/aot_autograd.py", line 2392, in aot_wrapper_synthetic_base
    return compiler_fn(flat_fn, flat_args, aot_config, fw_metadata=fw_metadata)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_functorch/aot_autograd.py", line 1573, in aot_dispatch_base
    compiled_fw = compiler(fw_module, flat_args)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_dynamo/utils.py", line 190, in time_wrapper
    r = func(*args, **kwargs)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 1096, in fw_compiler_base
    return inner_compile(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 246, in wrapper
    return inner_compile(gm, example_inputs, **kwargs_patched)
  File "/usr/local/fbcode/platform010/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_dynamo/repro/after_aot.py", line 80, in debug_wrapper
    inner_compiled_fn = compiler_fn(gm, example_inputs)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/debug.py", line 228, in inner
    return fn(*args, **kwargs)
  File "/usr/local/fbcode/platform010/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/fb/utils.py", line 101, in newFunction
    return old_func(*args, **kwargs)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 340, in compile_fx_inner
    compiled_graph: CompiledFxGraph = fx_codegen_and_compile(
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/compile_fx.py", line 550, in fx_codegen_and_compile
    compiled_fn = graph.compile_to_fn()
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/graph.py", line 975, in compile_to_fn
    code, linemap = self.codegen()
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/graph.py", line 925, in codegen
    self.scheduler.codegen()
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_dynamo/utils.py", line 190, in time_wrapper
    r = func(*args, **kwargs)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/scheduler.py", line 1782, in codegen
    self.codegen_extern_call(node)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/scheduler.py", line 1705, in codegen_extern_call
    node.codegen(V.graph.wrapper_code)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/ir.py", line 3835, in codegen
    super().codegen(wrapper)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/ir.py", line 3381, in codegen
    V.graph.wrapper_code.generate_extern_kernel_alloc(self, args)
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/codegen/wrapper.py", line 1378, in generate_extern_kernel_alloc
    size = self.codegen_shape_tuple(tuple(extern_kernel.get_size()))
  File "/data/users/bahuang/fbsource/buck-out/v2/gen/fbcode/575d10d63021fe15/deeplearning/aot_inductor/test/__test_custom_ops__/test_custom_ops#link-tree/torch/_inductor/ir.py", line 2366, in get_size
    return list(self.layout.size)
AttributeError: 'MultiOutputLayout' object has no attribute 'size'


### Minified repro

```
        class ModelWithMultiOutut(torch.nn.Module):
            def __init__(self):
                super().__init__()

            def forward(
                self,
                x,
            ):
                return torch.sort(x, dim=-1)

        device = torch.device("cuda")
        m = ModelWithMultiOutut().to(device=device)

        x = torch.zeros(8, device=device)
        user_args = (x,)

        export_model = export(m, user_args)

        with torch.no_grad():
            gm = export_model.graph_module
            so_path = torch._inductor.aot_compile(gm, list(user_args))
```

### Versions

master

cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov