[Inductor] Update should_decompose_mm condition for CPU (#147673)

Summary:
Previously, for cpu we decompose addmm if
```
check_device(mat1, mat2, device="cpu")
        and mat1.shape[0] == 1
        and mat2.shape[0] <= 64
        and mat2.shape[1] <= 16
```
We have a new case where `mat2.shape[2] = 304`, and benchmark shows that it will beneficial if we decompose, so update the condition to
```
check_device(mat1, mat2, device="cpu")
        and mat1.shape[0] == 1
        and mat2.shape[0] <= 64
        and mat2.shape[1] <= 512
```

Differential Revision: D70033166

Pull Request resolved: https://github.com/pytorch/pytorch/pull/147673
Approved by: https://github.com/houseroad
This commit is contained in:
Huamin Li 2025-02-24 05:51:50 +00:00 committed by PyTorch MergeBot
parent 8b65dbad13
commit cee03b7746

View File

@ -78,7 +78,7 @@ def should_decompose_mm(mat1, mat2) -> bool:
check_device(mat1, mat2, device="cpu")
and mat1.shape[0] == 1
and mat2.shape[0] <= 64
and mat2.shape[1] <= 16
and mat2.shape[1] <= 512
)