question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: Mac M1 (arm) ODE solver incorrect results conda installation

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jsmarsha11commented, Aug 4, 2022

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.

@jsmarsha11 you said you observed other issues. Are they also related to this function or other functions?

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.

1reaction
rgommerscommented, Aug 4, 2022

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 get 0.3.20. That’s a known bad version for macOS M1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

M1 Mac - GDAL Wrong Architecture Error [Django]
I'm working on a M1 based mac. Following the instructions on official Django docs, I've installed the necessary packages via brew $ brew...
Read more >
M1 Pro After installing TF based o… | Apple Developer Forums
M1 Pro After installing TF based on Official apple guide gives ERROR for even importing TF · I have followed this for ARM...
Read more >
M1 mac: mach-o file, but is an incompatible architecture (have ...
I use conda from miniforge for python packages etc. This works. This means that I don't know first hand how pypi works, I...
Read more >
Managing ARM vs X86 Python on M1 Macs - Thinking Studio
I realised the best solution was not to use compatibility, rather, force the Conda installation to use M1 specific ARM builds for everything. ......
Read more >
Available CRAN Packages By Date of Publication
2022-12-09, requiRements, Helper Package to Install Packages for R ... 2022-11-09, osqp, Quadratic Programming Solver using the 'OSQP' Library.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found