mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[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:
parent
8b65dbad13
commit
cee03b7746
|
|
@ -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
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user