Make require_stride_order peek into AliasedLayout
Labels: module: inductor, ciflow/inductor

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #111681

Summary:

`require_stride_order` doesn't know how to handle storage with `AliasedLayout`. It always resorts to a copy even when the view refers to a storage with `FixedLayout`. This causes an unneccessary allocation + copy for collective outputs. Peeking into `AliasedLayout` in `require_stride_order` seems to be the proper way to address the issue.

Original program:
```python
import tempfile

import torch
import torch.distributed as dist
from torch.distributed._functional_collectives import *  # noqa
from torch._inductor.utils import run_and_get_triton_code


def func(arg: torch.Tensor) -> torch.Tensor:
    buf0 = arg + 42
    out0 = torch.ops.c10d_functional.all_reduce(buf0, "avg", "default", [0], 1)
    out0 = torch.ops.c10d_functional.wait_tensor(out0)
    return out0


if __name__ == "__main__":
    with tempfile.NamedTemporaryFile(delete=False) as tmpf:
        dist.init_process_group(
            backend="nccl", init_method=f"file://{tmpf.name}", rank=0, world_size=1
        )
        device = torch.device("cuda:0")

        compiled = torch.compile(func)
        print(run_and_get_triton_code(compiled, torch.rand(4, 4, device=device)))

        torch.cuda.synchronize()
        dist.destroy_process_group()
```

Before:
```python
def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4), (4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = empty_strided((4, 4), (4, 1), device='cuda', dtype=torch.float32)
        # Source Nodes: [buf0], Original ATen: [aten.add]
        stream0 = get_cuda_stream(0)
        triton_poi_fused_add_0.run(arg0_1, buf0, 16, grid=grid(16), stream=stream0)
        del arg0_1
        buf1 = buf0; del buf0  # reuse
        buf2_pg = c10d._find_or_create_pg_by_ranks_and_tag('default', [0], 1)
        buf2 = buf1
        buf2_work = dist.all_reduce(buf2, async_op=True, group=buf2_pg, op=fun_col_impl._str_to_reduce_op('avg'))
        fun_col_impl._register_tensor_work(buf2, buf2_work)
        buf1 = _wait_tensor(buf1)
        buf3 = buf1
        buf4 = empty_strided((4, 4), (4, 1), device='cuda', dtype=torch.float32)
        # Source Nodes: [out0_1], Original ATen: [c10d_functional.wait_tensor]
        triton_poi_fused_wait_tensor_1.run(buf3, buf4, 16, grid=grid(16), stream=stream0)
        del buf1
        del buf3
        return (buf4, )
```

After:
```python
def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4), (4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = empty_strided((4, 4), (4, 1), device='cuda', dtype=torch.float32)
        # Source Nodes: [buf0], Original ATen: [aten.add]
        stream0 = get_cuda_stream(0)
        triton_poi_fused_add_0.run(arg0_1, buf0, 16, grid=grid(16), stream=stream0)
        del arg0_1
        buf1 = buf0; del buf0  # reuse
        buf2_pg = c10d._find_or_create_pg_by_ranks_and_tag('default', [0], 1)
        buf2 = buf1
        buf2_work = dist.all_reduce(buf2, async_op=True, group=buf2_pg, op=fun_col_impl._str_to_reduce_op('avg'))
        fun_col_impl._register_tensor_work(buf2, buf2_work)
        buf1 = _wait_tensor(buf1)
        buf3 = buf1
        del buf3
        return (buf1, )
```

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler