-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expm is getting slow in scipy==1.13.1
#178
Comments
I will take a look, I should have a profiling notebook somewhere. |
Interestingly if i run the benchmark locally (Fedora, Python 3.10 and 3.12) I don't get any performance regression. Maybe it's a Problem with the runner.
|
I see issues locally, too numpy 2
numpy 1.x
But mainly for the eigen value solver |
The eigenvalue solver is getting faster! Edit: The culprit is SciPy. The regression was introduced in between 1.12 and 1.13. |
Oopsie, true. Sorry, just quickly checked on the side today and I just saw that something changed. I can confirm that Here are the stats with
I did not really find anything on a major change of |
numpy==2.0.0
scipy==1.13.1
Indeed when I run this import time
import numpy as np
from scipy.linalg import expm
mat = np.array(
[
[0.0 - 0.0j, 0.0 - 0.0j, 0.0 - 0.0j, 0.0 - 2.5774387j],
[0.0 - 0.0j, 0.0 - 0.0j, 0.0 + 4.3402231j, 0.0 - 0.0j],
[0.0 - 0.0j, 0.0 + 5.60367362j, 0.0 - 0.0j, 0.0 - 0.0j],
[0.0 - 9.43618706j, 0.0 - 0.0j, 0.0 - 0.0j, 0.0 - 0.0j],
]
)
start_time = time.time()
for _ in range(10000):
expm(mat)
print(f"{(time.time() - start_time) * 1000} ms") I get |
scipy==1.13.1
scipy==1.13.1
hmm... I had a look at the changes of |
Yeah, it's not directly obvious what they changed. We can try to report the regression. On the other hand, I did try out PyTorch again.
|
Yes, sounds good to have an alternative. However, I also tried to use I would also open an issue at scipy to start a discussion there at least. Maybe someone there might just know what's going wrong. |
I have prepared a branch with Pytorch at #181 |
With
numpy==2.0.0
scipy==1.13.1
the performance of the solver drops tremendously. We should investigate where this is coming from and see if we can fix this by replacing to the proper (quicker) functions.The text was updated successfully, but these errors were encountered: