Skip to content
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

BUG: spatial.transform.Rotation.from_rotvec slow on arm64 #16876

Open
mhavu opened this issue Aug 22, 2022 · 0 comments
Open

BUG: spatial.transform.Rotation.from_rotvec slow on arm64 #16876

mhavu opened this issue Aug 22, 2022 · 0 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.spatial

Comments

@mhavu
Copy link

mhavu commented Aug 22, 2022

Describe your issue.

I am running macOS 12.4 on Apple M1 Pro. I have a conda environment that runs osx-arm64 code natively and another one that runs osx-64 (x86-64) code via Rosetta 2 translation. Both environments use the following package versions from conda-forge:

  • python 3.9.13
  • numpy 1.23.2
  • scipy 1.9.0
  • libopenblas 0.3.21
  • liblapack 3.9.0.

The arm64 native version of scipy.spatial.transform.Rotation.from_rotvec is up to four times slower than the translated version.

Reproducing Code Example

import numpy as np
from scipy.spatial.transform import Rotation

rotvec = np.random.rand(10000, 3)
%timeit rot = Rotation.from_rotvec(rotvec)
# osx-arm64: 407 µs ± 106 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
# osx-64:    145 µs ± 88.2 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)

Error message

There are no error messages.

SciPy/NumPy/Python version information

1.9.0 1.23.2 sys.version_info(major=3, minor=9, micro=13, releaselevel='final', serial=0)

@mhavu mhavu added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.spatial
Projects
None yet
Development

No branches or pull requests

2 participants