Repository: pytorch
Issue: [PT2.2] PyTorch dispacthing non core ATen ops in .compile mode for torch ops.
Labels: triaged,oncall: pt2,module: pt2-dispatcher

### 🐛 Describe the bug

PyTorch dispacthing non core ATen ops in .compile mode for torch ops. 
Same non core ATen ops are observed as part of our backend.

**List of non core ATen ops observed are:**
```
addmv.default
addbmm.default
cumprod.default
median.default
min.default
```

### Error logs

aten ops getting involved for addmv ['addmv.default']
aten ops getting involved for addbmm ['addbmm.default']
aten ops getting involved for cumprod ['cumprod.default']
aten ops getting involved for median ['median.default']
aten ops getting involved for min ['min.default']

### Minified repro

```
import torch
from torch._decomp import core_aten_decompositions
from torch._dynamo.backends.common import aot_autograd

fx_info = {"fx_aten_ops": []}

def inner_compiler(fx_module: torch.fx.GraphModule, inputs):
    for node in fx_module.graph.nodes:
        if node.op == "call_function":
            fx_info["fx_aten_ops"].append(node.target.__name__)
    return fx_module

# UT for addmv ATen op
def addmv_model(M, mat, vec):
  return torch.addmv(M, mat, vec)

M = torch.randn(2)
mat = torch.randn(2, 3)
vec = torch.randn(3)

fx_trace_backend = aot_autograd(
    fw_compiler=inner_compiler, decompositions=core_aten_decompositions()
)
model_compiled = torch.compile(addmv_model, backend=fx_trace_backend)
result_fwd = model_compiled(M, mat, vec)

print(f"aten ops getting involved for addmv {fx_info['fx_aten_ops']}")

# UT for addbmm ATen op
def addbmm_model(M, batch1, batch2):
  return torch.addbmm(M, batch1, batch2)

M = torch.randn(3, 5)
batch1 = torch.randn(10, 3, 4)
batch2 = torch.randn(10, 4, 5)

fx_info = {"fx_aten_ops": []}
fx_trace_backend = aot_autograd(
    fw_compiler=inner_compiler, decompositions=core_aten_decompositions()
)
model_compiled = torch.compile(addbmm_model, backend=fx_trace_backend)
result_fwd = model_compiled(M, batch1, batch2)
print(f"aten ops getting involved for addbmm {fx_info['fx_aten_ops']}")

# UT for cumprod ATen op
def cumprod_model(ifm):
  return torch.cumprod(ifm, dim=0)

ifm = torch.randn(10)

fx_info = {"fx_aten_ops": []}
fx_trace_backend = aot_autograd(
    fw_compiler=inner_compiler, decompositions=core_aten_decompositions()
)
model_compiled = torch.compile(cumprod_model, backend=fx_trace_backend)
result_fwd = model_compiled(ifm)
print(f"aten ops getting involved for cumprod {fx_info['fx_aten_ops']}")


# UT for median ATen op
def median_model(ifm):
  return torch.median(ifm)

ifm = torch.randn(10)

fx_info = {"fx_aten_ops": []}
fx_trace_backend = aot_autograd(
    fw_compiler=inner_compiler, decompositions=core_aten_decompositions()
)
model_compiled = torch.compile(median_model, backend=fx_trace_backend)
result_fwd = model_compiled(ifm)
print(f"aten ops getting involved for median {fx_info['fx_aten_ops']}")


# UT for min ATen op
def min_model(ifm):
  return torch.min(ifm)

ifm = torch.randn(10)

fx_info = {"fx_aten_ops": []}
fx_trace_backend = aot_autograd(
    fw_compiler=inner_compiler, decompositions=core_aten_decompositions()
)
model_compiled = torch.compile(min_model, backend=fx_trace_backend)
result_fwd = model_compiled(ifm)
print(f"aten ops getting involved for min {fx_info['fx_aten_ops']}")

```

### Versions

[pip3] numpy==1.26.4
[pip3] torch==2.2.0a0
[pip3] torchaudio==2.2.0
[pip3] torchdata==0.7.1
[pip3] torchtext==0.17.0
[pip3] torchvision==0.17.0

cc @ezyang @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang