[inductor][aten] treat like a template in GEMMs (#161342)

# why

- central point to analyze and override all generated choices

# what

- add a pseudo heuristic for aten that just yields a single, empty
  kwargs
- add a pseudo heuristic with the bias_addmm logic for it
- add an addmm specific heuristic that yields a single choice, but
  also expands it with alpha and beta kwargs

- replace all the aten.bind calls with V.choices.get_mm_configs
  using the now matching API for aten

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520580](https://our.internmc.facebook.com/intern/diff/D81520580)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/161342
Approved by: https://github.com/jansel
ghstack dependencies: #162075, #161340, #161341
This commit is contained in:
Ruben Rodriguez Buchillon
2025-09-05 07:38:41 -07:00
committed by PyTorch MergeBot
parent 4902c76c65
commit af590cb729
7 changed files with 229 additions and 116 deletions

View File

@ -420,11 +420,12 @@ def rand_strided(
device: Union[str, torch.device] = "cpu",
extra_size: int = 0,
) -> torch.Tensor:
needed_size = (
sum((shape - 1) * stride for shape, stride in zip(size, stride))
+ 1
+ extra_size
)
needed_size = extra_size
if all(s > 0 for s in size):
# only need to allocate if all sizes are non-zero
needed_size += (
sum((shape - 1) * stride for shape, stride in zip(size, stride)) + 1
)
if dtype.is_floating_point:
if dtype.itemsize == 1:
"""