Skip to content

Build wheels for Apple Silicon #10114

Closed
Closed

Description

@JukkaL

Currently we don't generate binary wheels for macs with Apple Silicon, and the only option is to use the slower, interpreted version of mypy when using an ARM CPython build. A compiled wheel could up to 4x faster than the interpreted one.

cibuildwheel (https://github.com/joerick/cibuildwheel), which we use to compile wheels, now supports cross-compiling arm64 wheels for Apple Silicon on Intel. We should generate arm64 wheels for macOS. We can support at least Python 3.9 and possibly 3.8 (https://bugs.python.org/msg382939). Just supporting 3.9 would be okay.

Building the wheels happens in a GitHub action here.

Would anybody to like to try this out? If you can generate the wheels, I can help test them, since I have a Mac with Apple Silicon.

Activity

  1. 97littleleaf11 commented on Feb 23, 2021

    @97littleleaf11
    Collaborator

    Hey @JukkaL, I briefly went through the workflows/build.yml just now. What should I do next, to modifymypy/misc/build_wheel.py or build wheels locally?

  2. JukkaL commented on Feb 23, 2021

    @JukkaL
    CollaboratorAuthor

    @97littleleaf11 You can modify misc/build_wheel.py to also generate arm64 wheels when running on macOS and Python 3.9. I think that you can use CIBW_ARCHS_MACOS to define the platforms. We don't want universal wheels, since they will be much bigger. If you will create a PR, I can try the wheel generation manually.

  3. 97littleleaf11 commented on Feb 26, 2021

    @97littleleaf11
    Collaborator

    @JukkaL I just made a PR about it.

  4. JukkaL commented on Feb 27, 2021

    @JukkaL
    CollaboratorAuthor

    @97littleleaf11 Thanks for the PR! This seems to work great based on some quick experiments, with about 4.3x performance improvement. Here is a Python 3.9 arm64 wheel for the current GitHub master. More recent builds will appear here.

  5. henryiii commented on Mar 4, 2021

    @henryiii
    Contributor

    That wheel works correctly for me on AS as well, thanks! (sorry for the delay, haven't had a chance to boot my AS machine back up till today 👶 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions