BUG: Mac M1 (arm) ODE solver incorrect results conda installation
See original GitHub issueDescribe your issue.
Using scipy.integrate.ode I notice many errors and warnings on Mac M1, compared to running the same code on an Intel chip, e.g.
UserWarning: zvode: Excess work done on this call. (Perhaps wrong MF.)
, with then resulting incorrect output of the solver.
The easiest example is if I copy and paste from the website.
In the below example, it does not give the same output as the website (note here, the output itself is incorrect, as well as producing the warning). The correct output should be as on the website above which prints 10 time-steps before quitting the loop, which is what I find on an Intel terminal.
This is just a simple example, I find issues like this quite persistent on Mac M1. I installed scipy using the Apple Silicon version of conda (at 4.13). I assume this is somehow to do with the installation, though I was under the impression scipy was compatible with M1 via conda? Is there an install guide for Mac M1?
Reproducing Code Example
from scipy.integrate import ode
y0, t0 = [1.0j, 2.0], 0
def f(t, y, arg1):
return [1j*arg1*y[0] + y[1], -arg1*y[1]**2]
def jac(t, y, arg1):
return [[1j*arg1, 1], [0, -arg1*2*y[1]]]
r = ode(f, jac).set_integrator('zvode', method='bdf')
r.set_initial_value(y0, t0).set_f_params(2.0).set_jac_params(2.0)
t1 = 10
dt = 1
while r.successful() and r.t < t1:
print(r.t+dt, r.integrate(r.t+dt))
Error message
/opt/miniconda3/lib/python3.9/site-packages/scipy/integrate/_ode.py:1011: UserWarning: zvode: Excess work done on this call. (Perhaps wrong MF.)
warnings.warn('{:s}: {:s}'.format(self.__class__.__name__,
1 [-9.75447932e-05+9.99902455e-01j 1.96095143e+00+7.77841228e-04j]
SciPy/NumPy/Python version information
1.9.0 1.22.4 sys.version_info(major=3, minor=9, micro=13, releaselevel=‘final’, serial=0)
Issue Analytics
- State:
- Created a year ago
- Comments:11 (9 by maintainers)
Wow, thanks for this, and glad it wasn’t just me! And I can also confirm the pip install has correct output on the original post.
And regarding this, let me get back to you. I have a more complex code which is unfortunately still failing, and I expect it is the scipy integration. I’m actually surprised it is still not working given the above now works after installing with pip (I assumed it would be the same issue, as the error messages were the same). Of course, it’s possible the other code is breaking for some other reason. When I get time I will try to get a minimum working example, or i’ll let you know if I no longer believe the issue to be with scipy.
Thanks, this is appreciated.
Yes indeed, there is nothing in the conda-forge recipe that would cause this. It’s also not even clear that this differs between PyPI and conda-forge packages, my guess would be that we ship the wheel on PyPI with OpenBLAS
0.3.18
but when installing from conda-forge you get0.3.20
. That’s a known bad version for macOS M1.