-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Closed
Labels
module: linear algebraIssues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmulIssues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmultriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
addr implementation here
https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/LinearAlgebra.cpp#L147-L159
does explicit multiplications by alpha and beta even though by default alpha and beta are 1, so no multiplication is necessary. This degrades performance and memory usage.
In addition, line 55 does invalid cast, so invocation with complex beta results in an error:
a=torch.randn(3, dtype=torch.complex64)
b=torch.randn(3, dtype=torch.complex64)
c=torch.randn(3,3, dtype=torch.complex64)
c.addr(a,b, beta=0+0.1j)
RuntimeError: value cannot be converted to type double without overflow: (0,0.1)
related: #44364
cc @vishwakftw @jianyuh @nikitaved @pearu @mruberry @heitorschueroff
cc @ivannz
Metadata
Metadata
Assignees
Labels
module: linear algebraIssues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmulIssues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmultriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module