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

Wheel support for Mac Arm (M1) #799

Closed
PhilipVinc opened this issue Nov 26, 2021 · 18 comments
Closed

Wheel support for Mac Arm (M1) #799

PhilipVinc opened this issue Nov 26, 2021 · 18 comments
Assignees
Labels
feature_request Feature Request
Milestone

Comments

@PhilipVinc
Copy link

PhilipVinc commented Nov 26, 2021

There's no issue on this, so I'll open one to track this.

Currently LLVMLite does not provide Wheels on PyPi for Mac Arm (M1) processors, but they are only provided on Conda.
This is annoying because users cannot install using pip packages depending on Numba when running native. Releasing PyPi wheels for LLVMLite would be the first step towards addressing this.

@esc esc added the feature_request Feature Request label Nov 26, 2021
@esc
Copy link
Member

esc commented Nov 26, 2021

@PhilipVinc thank you for opening this issue. We hope to tackle this in Q1/Q2 2022 so that M1 wheels will be available for the 0.39.0 release.

@esc esc added this to the 0.39.0 RC milestone Nov 26, 2021
etejedor added a commit to etejedor/rootspi that referenced this issue Feb 7, 2022
Because it is not possible at the moment to install numba with
pip on macOS12 on ARM.
numba/llvmlite#693
numba/llvmlite#799
etejedor added a commit to root-project/rootspi that referenced this issue Feb 7, 2022
Because it is not possible at the moment to install numba with
pip on macOS12 on ARM.
numba/llvmlite#693
numba/llvmlite#799
@esc
Copy link
Member

esc commented Mar 2, 2022

A quick update on this one. We are getting closer.

M1 support for llvmlite is now (probably) complete: #813
M1 support for Numba is still in progress: numba/numba#7822

We are still hoping to publish M1 wheels with the next Numba and llvmlite releases.

@pikeas
Copy link

pikeas commented Mar 10, 2022

Until #813 is merged and released, what's the best way to install llvmlite in a Python 3.8+ virtualenv on an M1 Mac?

@PhilipVinc
Copy link
Author

In my experience, annoying as it may be, conda-forge

@esc
Copy link
Member

esc commented Mar 26, 2022

Good news, both llvmlite and numba have been extensively tested on an M1 now:

So, we are now in a position to build wheels too. If everything goes according to plan (which it rarely does) I'll be uploading some initial builds somewhere for testing, come next week.

@esc
Copy link
Member

esc commented Mar 30, 2022

An initial set of wheels that I built are now available via anaconda.org:

https://anaconda.org/numba/llvmlite/files?channel=wheels_experimental_m1

While I have not tried this yet, the installation of the native wheels should simply be:

pip install -i https://pypi.anaconda.org/numba/label/wheels_experimental_m1/simple llvmlite

Anyone waiting on these wheels is invited to "give them a spin". Please report back any issues you encounter with m1 wheels on this issue, thank you! 🙏

@esc
Copy link
Member

esc commented Mar 30, 2022

Unfortunately, there seems to be an issue here, I just tried the instructions listed on:

https://anaconda.org/numba/llvmlite

However, I am unable to install the wheels.

(wheeltest) ci@colo-osxarm-02 ~ % pip install -i https://pypi.anaconda.org/numba/label/wheels_experimental_m1/simple llvmlite

Looking in indexes: https://pypi.anaconda.org/numba/label/wheels_experimental_m1/simple
ERROR: Could not find a version that satisfies the requirement llvmlite (from versions: none)
ERROR: No matching distribution found for llvmlite

I will continue to look into this and keep you posted about progress.

@esc
Copy link
Member

esc commented Mar 30, 2022

It seems like something went wrong during the wheel build process:

(wheeltest) ci@colo-osxarm-02 ~ % pip install llvmlite-0.39.0.dev0+61.gf27ac6f-cp310-cp310-macosx_10_9_x86_64.whl
ERROR: llvmlite-0.39.0.dev0+61.gf27ac6f-cp310-cp310-macosx_10_9_x86_64.whl is not a supported wheel on this platform.
(wheeltest) ci@colo-osxarm-02 ~ % file llvmlite-0.39.0.dev0+61.gf27ac6f-cp310-cp310-macosx_10_9_x86_64.whl
llvmlite-0.39.0.dev0+61.gf27ac6f-cp310-cp310-macosx_10_9_x86_64.whl: Zip archive data, at least v2.0 to extract, compression method=deflate

@esc
Copy link
Member

esc commented Mar 30, 2022

OK, so for some reason the wheels end up having the wrong tag:

(wheeltest) ci@colo-osxarm-02 llvmlite-0.39.0.dev0+61.gf27ac6f.dist-info % cat WHEEL
Wheel-Version: 1.0
Generator: bdist_wheel (0.37.1)
Root-Is-Purelib: false
Tag: cp310-cp310-macosx_10_9_x86_64

My assumption is that the suffix of the Tag entry should be osx-arm64 and not x86_64.

@esc
Copy link
Member

esc commented Mar 30, 2022

After some more fiddling with the CI system that builds the wheels, I managed to get some that work:

(wheeltest) ci@colo-osxarm-02 ~ % pip install -i https://pypi.anaconda.org/numba/label/wheels_experimental_m1/simple llvmlite
Looking in indexes: https://pypi.anaconda.org/numba/label/wheels_experimental_m1/simple
Collecting llvmlite
  Downloading https://pypi.anaconda.org/numba/label/wheels_experimental_m1/simple/llvmlite/0.39.0.dev0%2B61.gf27ac6f/llvmlite-0.39.0.dev0%2B61.gf27ac6f-cp310-cp310-macosx_11_0_arm64.whl (23.1 MB)
     |████████████████████████████████| 23.1 MB 1.3 MB/s
Installing collected packages: llvmlite
Successfully installed llvmlite-0.39.0.dev0+61.gf27ac6f

These are for Python 3.8, 3.9 and 3.10 only. The system we use depends on python being available from defaults on anaconda.org and Python 3.7 is not (was not at the time of writing) available.

@henryiii
Copy link

Python 3.7 was never officially adapted to work on M1. 3.8 is the oldest the M1 changes were backported to (and officially, only 3.9+ is fully supported, 3.8 is considered experimental by CPython, but Apple provides their patched version)

@esc
Copy link
Member

esc commented Mar 30, 2022

Python 3.7 was never officially adapted to work on M1. 3.8 is the oldest the M1 changes were backported to (and officially, only 3.9+ is fully supported, 3.8 is considered experimental by CPython, but Apple provides their patched version)

Excellent, thank you for clarifying that @henryiii 🙏 looks like we may be "in the clear" regarding targeted Python versions for now.

@esc
Copy link
Member

esc commented Mar 30, 2022

For reference, there are Numba wheels now too. See also: numba/numba#7951

@esc
Copy link
Member

esc commented Apr 5, 2022

An announcement for the wheels and a request to test them is here: https://numba.discourse.group/t/wheels-for-apple-silicon-m1/1282

@dbuades
Copy link

dbuades commented Apr 14, 2022

An announcement for the wheels and a request to test them is here: https://numba.discourse.group/t/wheels-for-apple-silicon-m1/1282

I confirm that they work properly. Thank you!

@esc
Copy link
Member

esc commented Apr 14, 2022

An announcement for the wheels and a request to test them is here: https://numba.discourse.group/t/wheels-for-apple-silicon-m1/1282

I confirm that they work properly. Thank you!

Thank you for checking and confirming!

@ghost
Copy link

ghost commented Apr 19, 2022

An announcement for the wheels and a request to test them is here: https://numba.discourse.group/t/wheels-for-apple-silicon-m1/1282

I can also confirm that the wheels are working as expected.

Thank you for finally releasing them!

@ghost ghost mentioned this issue Apr 19, 2022
2 tasks
@esc
Copy link
Member

esc commented May 30, 2022

With llvmlite 0.38.1 M1 wheels are now available:

https://numba.discourse.group/t/llvmlite-0-38-1/1340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request Feature Request
Projects
None yet
Development

No branches or pull requests

5 participants